Re: Re [Haskell-cafe] Vanishing polymorphism

2007-05-10 Thread Jules Bean
David House wrote: On 08/05/07, Matthew Sackman [EMAIL PROTECTED] wrote: :t let f r s = let g (fn::forall n . (Num n) = n - n) = return (fn r, fn s) in (return negate) = g in f Ah, I may have been off the mark earlier. I think the problem is due to the fact that you can't pass higher-order

Re: [Haskell-cafe] Vanishing polymorphism

2007-05-09 Thread Tom Schrijvers
To cut a long story short, could someone explain why: :t negate negate :: forall a. (Num a) = a - a :t let f (fn :: forall a . Num a = a - a) r s = (fn r, fn s) in f negate let f (fn :: forall a . Num a = a - a) r s = (fn r, fn s) in f negate :: forall r s. (Num r, Num s) = r -

Re: [Haskell-cafe] Vanishing polymorphism

2007-05-09 Thread Tom Schrijvers
On Tue, 8 May 2007, David House wrote: On 08/05/07, Matthew Sackman [EMAIL PROTECTED] wrote: :t let f r s = (return negate) = (\(fn::forall n . (Num n) = n - n) - return (fn r, fn s)) in f interactive:1:35: Couldn't match expected type `a - a' against inferred type `forall n.

Re: Re [Haskell-cafe] Vanishing polymorphism

2007-05-09 Thread David House
On 08/05/07, Matthew Sackman [EMAIL PROTECTED] wrote: :t let f r s = let g (fn::forall n . (Num n) = n - n) = return (fn r, fn s) in (return negate) = g in f Ah, I may have been off the mark earlier. I think the problem is due to the fact that you can't pass higher-order polymorphic

Re: [Haskell-cafe] Vanishing polymorphism

2007-05-08 Thread David House
On 08/05/07, Matthew Sackman [EMAIL PROTECTED] wrote: :t let f r s = (return negate) = (\(fn::forall n . (Num n) = n - n) - return (fn r, fn s)) in f interactive:1:35: Couldn't match expected type `a - a' against inferred type `forall n. (Num n) = n - n' In the pattern: fn