Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
newtype Committer m a Source #
A Committer commit
s values of type a and signals success or otherwise. A Sink and a Consumer are some other metaphors for this.
A Committer absorbs the value being committed; the value disappears into the opaque thing that is a Committer from the pov of usage.
>>>
commit toStdout "I'm committed!"
I'm committed! True
witherC :: Monad m => (b -> m (Maybe a)) -> Committer m a -> Committer m b Source #
A monadic Witherable
>>>
glue (witherC (\x -> pure $ bool Nothing (Just x) (even x)) showStdout) <$|> qList [0..5]
0 2 4