[Haskell-cafe] Off-topic [was: Distributing monadic(?) functions across dyadic functions]

Daniel McAllansmith dagda at xtra.co.nz
Sun Apr 2 16:48:34 EDT 2006


On Monday 03 April 2006 08:09, David Menendez wrote:
> If you look at it in terms of folds over pairs,
>
>     cata (&) (x,y) = x & y   -- corresponds to uncurry
>     ana f g x = (f x, g x)   -- corresponds to (&&&)
>
> Then you can de-forest:
>
>     hylo (&) f g x = f x & g x
>
>         -- hylo (&) f g == cata (&) . ana f g
>         --              == uncurry (&) . f &&& g
>         --
>         -- cata (&) == hylo (&) fst snd
>         -- ana f g  == hylo (,) f g
>
> This seems remeniscent of pull-backs (or push-outs) in category theory,
> but I don't know enough to say for certain.

I especially like the above code after it has been automatically transformed 
to use the puppy operator by my email client.

Actually, the more I look at it... maybe the new crop of haskell editors 
should define some 'haskicon' replacements. :)

Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: puppy_op.jpg
Type: image/jpeg
Size: 4831 bytes
Desc: not available
Url : http://www.haskell.org//pipermail/haskell-cafe/attachments/20060403/9861e566/puppy_op.jpg


More information about the Haskell-Cafe mailing list