At 2001-10-24 01:08, Simon Peyton-Jones wrote:
So I'm interested to know: if GHC allowed arbitrarily-ranked types, who
would use them?
I would. Right now I have a class for 'IO lifted monads', that is, monads
from which one can call IO actions:
class (Monad m) = IOLiftedMonad m where
Hello, and thanks for the various answers!
Martin Odersky writes:
Simon,
You are correct to have doubts. Indeed our system would not handle
this case, as type variables can only be instantiated to monomorophic
types, not to type schemes. The closest you can get to it is to wrap
the
Iavor S. Diatchki writes:
test :: (forall t . (forall a . t a) - t b) - b - b
i am not an expert on this, but isnt this rank 3?
Might be. Does this mean I cannot write it in Haskell? But, with
data T a = C
I can write:
test' :: (forall t . (forall a . t a) - t b) - b - b
test' g x =
-
| From: Janis Voigtlaender [mailto:[EMAIL PROTECTED]]
| Sent: 24 October 2001 08:00
| To: [EMAIL PROTECTED]
| Subject: Re: rank 2-polymorphism and type checking
|
|
| Iavor S. Diatchki writes:
|
|test :: (forall t . (forall a . t a) - t b) - b - b
| i am not an expert on this, but isnt
Simon Peyton-Jones wrote:
| So I'm interested to know: if GHC allowed
| arbitrarily-ranked types, who would use them?
I have certainly come across (very practical) situations
where I would like to use rank-n types (with n 2). One
example is the following.
When using runST, I often end up
So I'm interested to know: if GHC allowed arbitrarily-ranked types, who
would use them?
For Generic Haskell and for Generic Programming problems in general,
arbitarily-ranked types would make life much easier. Therefore I guess
that a couple of people here at Utrecht (including me) would
out of my depth here.
Maybe a types expert can help.
Simon
| -Original Message-
| From: Simon Peyton-Jones [mailto:[EMAIL PROTECTED]]
| Sent: 24 October 2001 09:08
| To: Janis Voigtlaender; [EMAIL PROTECTED]
| Subject: RE: rank 2-polymorphism and type checking
|
|
| Here's the story
PS to my earlier message. I am not at all certain that
the Odersky/Laufer thing would in fact solve Janis's problem.
You want not only a rank-3 type, but also higher-order unification,
since you want to instantiate 't' to
\c. forall d . (c-d) - d - d
Simon,
You are correct to
Simon Peyton-Jones [EMAIL PROTECTED] writes:
So I'm interested to know: if GHC allowed arbitrarily-ranked types, who
would use them?
I can't promise that I would use them, but it would certainly give me
warm fuzzy feelings to know that they were there. :-)
On the other hand, I believe that
hi
test :: (forall t . (forall a . t a) - t b) - b - b
i am not an expert on this, but isnt this rank 3?
bye
iavor
--
==
| Iavor S. Diatchki, Ph.D. student |
| Department of Computer Science and Engineering |
| School of OGI
10 matches
Mail list logo