Add try operator
kritzcreek opened this issue · 3 comments
kritzcreek commented
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.
paf31 commented
Sounds good to me.
kritzcreek commented
Fixed with #16