[Haskell-cafe] Mysterious fact

Joachim Breitner mail at joachim-breitner.de
Tue Nov 2 16:26:48 EDT 2010


Hi,

Am Montag, den 01.11.2010, 22:28 +0000 schrieb Andrew Coppin:
> The other day, I accidentally came up with this:
> 
> {-# LANGUAGE RankNTypes #-}
> 
> type Either x y = forall r. (x -> r) -> (y -> r) -> r
> 
> left :: x -> Either x y
> left x f g = f x
> 
> right :: y -> Either x y
> right y f g = g y
> 
> This is one example; it seems that just about any algebraic type can
> be encoded this way. I presume that somebody else has thought of this
> before. Does it have a name?

that reminds me very much of a similar sounding mail to this list by
me¹. Is there a name for this meme already? :-)

Greetings,
Joachim


¹ http://www.mail-archive.com/[email protected]/msg21500.html

-- 
Joachim Breitner
  e-Mail: mail at joachim-breitner.de
  Homepage: http://www.joachim-breitner.de
  ICQ#: 74513189
  Jabber-ID: nomeata at joachim-breitner.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20101102/02118118/attachment.bin


More information about the Haskell-Cafe mailing list