Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Reconsider Use of PartialFunction[A, ZIO[R, E, B]] Signature #3442

@adamgfraser

Description

@adamgfraser

Currently we use the signature PartialFunction[A, ZIO[R, E, B]] for the effectual version of functions that take a partial function. However, I think that may not be quite the right signature. As I understand it, the contract there would be that given a value of type A, the partial function can immediately and purely tell us whether it is defined at a given input, but if we want to compute the value of the partial function for that input we need to evaluate the effect. But I think most of the time when we think of effectual partial functions we need to evaluate effects to even know whether the function is defined for an input. I would suggestion we consider changing to A => ZIO[R, E, Option[B]].

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions