On Jun 18, 2009, at 9:57 AM, Sjoerd Visscher wrote:

I am pleased to announce the first release of Data.FMList, lists represented by their foldMap function: [...]
http://hackage.haskell.org/package/fmlist-0.1

cool!

Just for fun: a derivation translating between different formulations of monadic bind.

    m >>= g
  = flatten (fmap g m)
  = FM $ \f -> unFM (fmap g m) (foldMap f)
  = FM $ \f -> unFM (FM $ \f' -> unFM m (f' . g)) (foldMap f)
  = FM $ \f -> (\f' -> unFM m (f' . g)) (foldMap f)
  = FM $ \f -> unFM m (folfMap f . g)             -- your definition
  = FM $ \f -> unFM m (flip unFM f . g)
  = FM $ \f -> unFM m (\x -> flip unFM f (g x))
= FM $ \f -> unFM m (\x -> unFM (g x) f) -- like continuation monad

Cheers,
Sebastian


--
Underestimating the novelty of the future is a time-honored tradition.
(D.G.)



Attachment: PGP.sig
Description: This is a digitally signed message part

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to