kind inference

Ross Paterson ross at soi.city.ac.uk
Fri Nov 18 06:19:49 EST 2005


On Thu, Nov 17, 2005 at 05:43:28PM -0800, John Meacham wrote:
> On Thu, Nov 17, 2005 at 01:17:02PM +0000, Ross Paterson wrote:
> > On Thu, Nov 17, 2005 at 12:46:31PM -0000, 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.



More information about the Glasgow-haskell-users mailing list