> Date: Sun, 5 Jul 1998 16:05:11 +0200
> From: Hans Aberg <[EMAIL PROTECTED]>

> Koen Claessen wrote:
> >I think you can "encode", or "mimick" every monad by the following type,
> >which is the monad of continuations:
> >
> >  type M a = (a -> Action) -> Action
> >
> >  unit :: a -> M a
> >  unit a = \cont -> cont a
> >
> >  bind :: M a -> (a -> M b) -> M b
> >  m `bind` k = \cont -> m (\a -> k a cont)
> >
> >As you see, the type Action is not mentioned in these definitions, so we
> >can choose any structure on Action we want, to encode the "features" of
> >the monad.
> 
>   I do not think it is possible to write every monad on this form.

If it is possible, who could find a counter example?  What about
Extended Continuation Passing Style (used to express Danvy's
composable continuation or operators reset/shift) ?

Regards,

F-Nicola

Francois-Nicola Demers
[EMAIL PROTECTED]
[EMAIL PROTECTED]



Reply via email to