[Haskell] Higher types in contexts

2012-03-05 Thread Barney Hilken
Is there any deep reason why I can't write a polymorphic type in a context? I 
think the record update problem can be (sort of) solved if you could write:

class Has r Rev (forall a. [a] -> [a]) => HRClass r where
setHRClass :: (forall a.[a] -> [a]) -> r -> r

but polymorphic types are not allowed in contexts. Is this one of the problems 
SPJ considers "Hard" or is it a feasible extension?

Barney.


___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Higher types in contexts

2012-03-06 Thread Simon Peyton-Jones
Yes, it's hard: it's impredicative polymorphism.  Dimitrios and Tim and I have 
a plan for a modest but reliable form of impredicative polymorphism, which we 
hope to have ready for the Haskell Symposium deadline.  It is relatively 
simple, like QML, but a bit clumsy.  That's the tradeoff.

Simon

|  -Original Message-
|  From: haskell-boun...@haskell.org [mailto:haskell-boun...@haskell.org] On
|  Behalf Of Barney Hilken
|  Sent: 05 March 2012 12:22
|  To: haskell@haskell.org
|  Subject: [Haskell] Higher types in contexts
|  
|  Is there any deep reason why I can't write a polymorphic type in a context? 
I think
|  the record update problem can be (sort of) solved if you could write:
|  
|  class Has r Rev (forall a. [a] -> [a]) => HRClass r where
|   setHRClass :: (forall a.[a] -> [a]) -> r -> r
|  
|  but polymorphic types are not allowed in contexts. Is this one of the 
problems SPJ
|  considers "Hard" or is it a feasible extension?
|  
|  Barney.
|  
|  
|  ___
|  Haskell mailing list
|  Haskell@haskell.org
|  http://www.haskell.org/mailman/listinfo/haskell



___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell