-
Hi all, Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Obviously, you could throw an exception in the |
Beta Was this translation helpful? Give feedback.
-
Hi all, Thanks in advance! |
Beta Was this translation helpful? Give feedback.
-
Obviously, you could throw an exception in the |
Beta Was this translation helpful? Give feedback.
AffMaybe(...)
allows you to return aFin<A>
, that gives you the opportunity to lift a lambda that could fail (i.e. returnFin.Succ
orFin.Fail
).Aff(...)
doesn't allow that, so it expects the lifted function to always succeed (i.e. it's pure).Obviously, you could throw an exception in the
Aff
lifted function, so it's not entirely clear cut. However, best practice is to avoid throwing exceptions for 'known' errors (i..e. exceptions are only for exceptional events, like running out of memory).