Re: polymorphic higher-order terms

1997-03-14 Thread Fergus Henderson
I wrote: > ... the Haskell report says that there is no way to declare an > explicitly universally quantified type. My question is simple: why not? I apologize: it is bad form to ask the same question twice, I know, but I'm afraid my memory is failing -- I must be getting old ;-). I forgot that

polymorphic higher-order terms

1997-03-14 Thread Fergus Henderson
Hi, For the following program > foo :: (Int, String, t -> t) -> (Int, String) > foo (i, s, f) = (f i, f s) ghc 0.24 reports "foo.hs", line 2: Couldn't match the type `Int' against `String'. In the first argument of `f', namely `s', Expected type of

Re: polymorphic higher-order terms

1997-03-13 Thread Lennart Augustsson
> data F = MkF t -> t -- did I get the syntax right? Almost data F = MkF (t -> t) > > foo :: (Int, String, F) -> (Int, String) > foo (i, s, MkF f) = (f i, f s) In fact, this extension has been implemented in Hugs and ghc as well as I understand it, but neither of t

Re: polymorphic higher-order terms

1997-03-13 Thread Simon L Peyton Jones
| > data F = MkF t -> t -- did I get the syntax right? | Almost | data F = MkF (t -> t) | > | > foo :: (Int, String, F) -> (Int, String) | > foo (i, s, MkF f) = (f i, f s) | | In fact, this extension has been implemented in Hugs | and ghc as well as I understand it, but