Skip to content

Add try operator #15

Closed
Closed
@kritzcreek

Description

@kritzcreek

Could we add a try operator like Control.Exception has in Haskell? I'm currently using this:

try   a e. Eff (err  EXCEPTION | e) a  Eff e (Either Error a)
try action = catchException (pure ∘ Left) (Right <$> action)

The only problem would be that this introduces a dependency on purescript-either.

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