thrist-0.2: Data/Thrist/Monad.hs
module Data.Thrist.Monad ( Monad'(..) ) where
-- DISCLAIMER:
-- Highly speculative module, naming, signatures not settled yet!
-- import Data.Thrist
import qualified Control.Monad as CM
-- Adapter for creating monads:
-- (Thrist (Monad' m) a b) is isomorphic to the monadic join : a -> mb
data Monad' :: (* -> *) -> * -> * -> * where
Feed :: CM.Monad m => m b -> Monad' m a b
Digest :: CM.Monad m => (a -> m b) -> Monad' m a b
-- It forms a monad -- gosh!
--
{-
instance Monad List' where
return a = List' $ Cons (El a) Nil
List' a >>= f = undefined
-}