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