ยค Mk, Mkc, et al

Monadic style

Types

newtype Mk k r = Mk {unMk :: Cont k r}
instance Functor (Mk k)
instance Applicative (Mk k)
instance Monad (Mk k)

type Mkc k = Mk k ()

putMk :: StreamProcIO sp => o -> Mk (sp i o) ()
getMk :: StreamProcIO sp => Mk (sp i o) i

type Cont c a = (a -> c) -> c

Description

Mk is a generic continuation monad. It can be used e.g. to program stream processors or fudget kernels in monadic style.

See Also

Continuation monad with state: Ms.

Continuation monad specialized to stream processors: SPm.