You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Result is not a very composable data type, which makes it clunky to work with. If we add a Testable instance for Either String Unit we can use the whole machinery around the Either type and make testing a much more pleasant experience.
Contrived example of pleasant experience:
p :: Array String -> Either String Unit
p a = do
i <- note "Couldn't find hello." (elemIndex "hello" a)
if mod i 2 > 0
then Left "hello isn't on an index divisible by two."
else Right unit
In my opinion this experience becomes pleasant because I can use do-notation, note and a load of other niceties.
If you think this is a good idea I can implement the instance(s) needed and make a PR.
The text was updated successfully, but these errors were encountered:
Result
is not a very composable data type, which makes it clunky to work with. If we add aTestable
instance forEither String Unit
we can use the whole machinery around theEither
type and make testing a much more pleasant experience.Contrived example of pleasant experience:
In my opinion this experience becomes pleasant because I can use do-notation,
note
and a load of other niceties.If you think this is a good idea I can implement the instance(s) needed and make a PR.
The text was updated successfully, but these errors were encountered: