Re: kind inference

2005-11-18 Thread Ross Paterson
On Thu, Nov 17, 2005 at 05:43:28PM -0800, John Meacham wrote:
 On Thu, Nov 17, 2005 at 01:17:02PM +, Ross Paterson wrote:
  On Thu, Nov 17, 2005 at 12:46:31PM -, Simon Peyton-Jones wrote:
   On 17 November 2005 12:45, Ross Paterson wrote:
   | I think the H98 rule is arbitrarily restrictive.  But what about
   | going further and considering the occurrences of type constructors
   | in instance declarations, type signature declarations and expression
   | type signatures?
  
   one could. but GHC doesn't.  feels low prio to me...
  
  It would probably not make many more practical programs legal, but it
  would be less arbitrary and easier to explain.
 
 explicit kinds allow you to type everything that this would make legal
 right?  

Yes.  On the other hand if kind inference used all the available
information in a module you'd hardly ever need explicit kinds.
(And if polymorphic kinds were inferred in dependency order, you'd
never need them.)

I'm thinking of what a clean kind inference rule would look like,
and neither the H98 nor the GHC rules are easy to explain or remember.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


RE: kind inference

2005-11-17 Thread Simon Peyton-Jones
Yes it's deliberate.  (Turned out to be easy and convenient.)   Yes it
goes beyond H98, so GHC types a few too many programs even in H98 mode.
I guess I should document it.

Simon

| -Original Message-
| From: [EMAIL PROTECTED]
[mailto:glasgow-haskell-users-
| [EMAIL PROTECTED] On Behalf Of Ross Paterson
| Sent: 17 November 2005 11:31
| To: glasgow-haskell-users@haskell.org
| Subject: kind inference
| 
| The Haskell 98 Report says kind inference is to be done over
dependency
| groups with polymorphic kinds defaulted to *, and hence the following
| example (from 4.6) is illegal:
| 
|   data Tree a  = Leaf | Fork (Tree a) (Tree a)
| 
|   type TreeList = Tree []
| 
| GHC 6.4 seems to perform kind inference across all the data, newtype,
| type and class declarations of a module before defaulting, and so
accepts
| the above.  An improvement, I think, but unadvertised.  Was it
intentional?
| 
| ___
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users@haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


RE: kind inference

2005-11-17 Thread Simon Peyton-Jones
one could. but GHC doesn't.  feels low prio to me...

| -Original Message-
| From: Ross Paterson [mailto:[EMAIL PROTECTED]
| Sent: 17 November 2005 12:45
| To: Simon Peyton-Jones
| Cc: glasgow-haskell-users@haskell.org
| Subject: Re: kind inference
| 
| On Thu, Nov 17, 2005 at 12:32:37PM -, Simon Peyton-Jones wrote:
|  Yes it's deliberate.  (Turned out to be easy and convenient.)   Yes
it
|  goes beyond H98, so GHC types a few too many programs even in H98
mode.
|  I guess I should document it.
| 
| I think the H98 rule is arbitrarily restrictive.  But what about going
| further and considering the occurrences of type constructors in
instance
| declarations, type signature declarations and expression type
signatures?

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: kind inference

2005-11-17 Thread Ross Paterson
On Thu, Nov 17, 2005 at 12:46:31PM -, Simon Peyton-Jones wrote:
 On 17 November 2005 12:45, Ross Paterson wrote:
 | I think the H98 rule is arbitrarily restrictive.  But what about
 | going further and considering the occurrences of type constructors
 | in instance declarations, type signature declarations and expression
 | type signatures?

 one could. but GHC doesn't.  feels low prio to me...

It would probably not make many more practical programs legal, but it
would be less arbitrary and easier to explain.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: kind inference

2005-11-17 Thread John Meacham
On Thu, Nov 17, 2005 at 01:17:02PM +, Ross Paterson wrote:
 On Thu, Nov 17, 2005 at 12:46:31PM -, Simon Peyton-Jones wrote:
  On 17 November 2005 12:45, Ross Paterson wrote:
  | I think the H98 rule is arbitrarily restrictive.  But what about
  | going further and considering the occurrences of type constructors
  | in instance declarations, type signature declarations and expression
  | type signatures?
 
  one could. but GHC doesn't.  feels low prio to me...
 
 It would probably not make many more practical programs legal, but it
 would be less arbitrary and easier to explain.

explicit kinds allow you to type everything that this would make legal
right?  
John

-- 
John Meacham - ⑆repetae.net⑆john⑈ 
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users