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
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 -
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.
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
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