Andrew Coppin wrote:
> 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
Lennart Augustsson writes:
> Jon, you beat me to it. I was going to mention Ponder.
Strange chance; yesterday was the first time I read haskell café
for something like half a year.
> But Ponder did have a builtin type, it had the function type built in. :)
Well, to use the nomenclature of Pon
Jon, you beat me to it. I was going to mention Ponder.
But Ponder did have a builtin type, it had the function type built in. :)
-- Lennart
On Tue, Nov 2, 2010 at 9:47 PM, Jon Fairbairn
wrote:
> Andrew Coppin writes:
>
>> The other day, I accidentally came up with this:
>>
>> |{-# LANGUAGE
Andrew Coppin writes:
> 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 exam