[Haskell-cafe] Origins of '$'

Joachim Breitner mail at joachim-breitner.de
Mon Dec 8 17:15:53 EST 2008


Hi,

Am Montag, den 08.12.2008, 15:59 -0600 schrieb Nathan Bloomfield:

> Slightly off topic, but the A^B notation for hom-sets also makes the
> natural isomorphism we call currying expressable as A^(BxC) = (A^B)^C.

So A^(B+C) = A^B × A^C ?

Oh, right, I guess that’s actually true:

uncurry either                :: (a -> c, b -> c)  -> (Either a b -> c)
(\f -> (f . Left, f . Right)) :: (Either a b -> c) -> (a -> c, b -> c)

It’s always nice to see that I havn’t learned the elementary power
calculation rules for nothing :-)

Greetings,
Joachim

PS:
For those who prefer Control.Arrow to points:
(.Left) &&& (.Right) :: (Either a b -> c) -> (a -> c, b -> c)
(found by trial and error :-))

-- 
Joachim "nomeata" Breitner
  mail: mail at joachim-breitner.de | ICQ# 74513189 | GPG-Key: 4743206C
  JID: nomeata at joachim-breitner.de | http://www.joachim-breitner.de/
  Debian Developer: nomeata at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20081208/1e447e6d/attachment.bin


More information about the Haskell-Cafe mailing list