[Haskell-cafe] Re: Re: A free monad theorem?
lennart at augustsson.net
Sun Sep 3 09:39:22 EDT 2006
Well, bind is extracting an 'a'. I clearly see a '\ a -> ...'; it
getting an 'a' so it can give that to g. Granted, the extraction is
very convoluted, but it's there.
On Sep 2, 2006, at 19:44 , Udo Stenzel wrote:
> Benjamin Franksen wrote:
>> Sure. Your definition of bind (>>=):
>> applies f to something that it has extracted from m, via
>> unpack, namely a. Thus, your bind implementation must know how to
>> 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
> 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
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe