[Haskell-cafe] Re: Re: A free monad theorem?

Udo Stenzel u.stenzel at web.de
Sat Sep 2 19:44:25 EDT 2006

Benjamin Franksen wrote:
> Sure. Your definition of bind (>>=):
> ...
> applies f to something that it has extracted from m, via deconstructor
> unpack, namely a. Thus, your bind implementation must know how to produce
> an a from its first argument m.

I still have no idea what you're driving at, but could you explain how
the CPS monad 'extracts' a value from something that's missing something
that's missing a value (if that makes sense at all)?

For reference (newtype constructor elided for clarity):

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

>instance Monad (Cont r) where
>	return a = \k -> k a
>	m >>= g = \k -> m (\a -> g a k)

Streitigkeiten dauerten nie lange, wenn nur eine Seite Unrecht hätte.
	-- de la Rochefoucauld
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org//pipermail/haskell-cafe/attachments/20060903/cadc9e3b/attachment.bin

More information about the Haskell-Cafe mailing list