| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Box.Committer
Description
Committer wraps a consumer destructor.
"Commitment is an act, not a word." ~ Jean-Paul Sartre
Documentation
newtype Committer m a Source #
A Committer commits values of type a and signals success or otherwise. A sink or 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