Safe Haskell | None |
---|---|
Language | GHC2021 |
Box.Codensity
Contents
Description
Extra Codensity operators.
Synopsis
- close :: forall {k} m (r :: k). Codensity m (m r) -> m r
- process :: forall {k} a m (r :: k). (a -> m r) -> Codensity m a -> m r
- (<$|>) :: forall {k} a m (r :: k). (a -> m r) -> Codensity m a -> m r
- (<*|>) :: forall {k} m a (r :: k). Codensity m (a -> m r) -> Codensity m a -> m r
- module Control.Monad.Codensity
Documentation
close :: forall {k} m (r :: k). Codensity m (m r) -> m r Source #
close the Codensity continuation.
>>>
close $ glue showStdout <$> qList [1..3]
1 2 3
process :: forall {k} a m (r :: k). (a -> m r) -> Codensity m a -> m r Source #
fmap then close a continuation.
>>>
process (glue showStdout) (qList [1..3])
1 2 3
(<$|>) :: forall {k} a m (r :: k). (a -> m r) -> Codensity m a -> m r infixr 0 Source #
fmap then close a continuation.
>>>
glue showStdout <$|> qList [1..3]
1 2 3
(<*|>) :: forall {k} m a (r :: k). Codensity m (a -> m r) -> Codensity m a -> m r infixr 3 Source #
apply and then close a continuation.
>>>
glue <$> (pure showStdout) <*|> qList [1..3]
1 2 3
module Control.Monad.Codensity