[Haskell-cafe] ANNOUNCE fmlist

Sebastian Fischer sebf at informatik.uni-kiel.de
Thu Jun 18 05:28:02 EDT 2009


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.)



-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 163 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20090618/24a592d5/PGP.bin


More information about the Haskell-Cafe mailing list