Open chshersh opened 6 years ago
Currently whenLeft has this type:
whenLeft
whenLeft :: Applicative f => Either l r -> (l -> f ()) -> f ()
I propose to rename whenLeft to whenLeft_ and add the following whenLeft:
whenLeft_
whenLeft :: Applicative f => Either l r -> (l -> f r) -> f r
This might be useful when you want to throw exception on Left constructor, like this:
Left
foo = do result <- decodeFile "path/to/config/file" config <- whenLeft result throwIO ...
Also consider doing the same for whenJust. Relates to #150.
whenJust
Currently
whenLeft
has this type:I propose to rename
whenLeft
towhenLeft_
and add the followingwhenLeft
:This might be useful when you want to throw exception on
Left
constructor, like this:Also consider doing the same for
whenJust
. Relates to #150.