darcs patch: Fix kind inference + test (and 6 more)
Mon Mar 31 07:28:01 EDT 2008 Samuel Bronson
On Thu, Apr 3, 2008 at 7:18 PM, Samuel Bronson
Mon Mar 31 07:28:01 EDT 2008 Samuel Bronson
* Fix kind inference + test Also, comment out the case in kindOf that makes things look fine when they aren't -- unless of course * isn't the right kind
This one makes the kind inference actually run when FrontEnd.KindInfer.hsTypeToType, and makes kindOf stop reporting * when the name in question is not in the environment -- signifying that kind inference has definitely not seen it. The former behaviour was useless, serving only to make things appear to work when they in fact did not, merely because * happened to be the correct kind in most cases.
Mon Mar 31 11:18:39 EDT 2008 Samuel Bronson
* Work around type inference bug relating to main (I didn't do it!)
This one just makes the test case for the previous patch actually run.
Fri Mar 21 00:29:22 EDT 2008 Samuel Bronson
* Split TArrows where appropriate
This one breaks apart TArrows when they must be matched with other things in type inference.
Thu Mar 20 16:42:02 EDT 2008 Samuel Bronson
* Actually define (->)...
This establishes the kind of (->) as ?? -> ? -> *, as copied from GHCi output for :kind (->).
Tue Mar 18 18:43:45 EDT 2008 Samuel Bronson
* Add Control.Monad.Instances to base package Tue Mar 18 18:56:40 EDT 2008 Samuel Bronson
* Add Control.Category Thu Mar 20 17:33:26 EDT 2008 Samuel Bronson
* Make Control.Category actually not import Prelude...
The first two are needed by the still-failing testcase; the third one just makes it build faster by side-stepping Prelude. I seem to have left some patches out this time, though...
On Thu, Apr 03, 2008 at 07:47:28PM -0500, Samuel Bronson wrote:
On Thu, Apr 3, 2008 at 7:18 PM, Samuel Bronson
wrote: Mon Mar 31 07:28:01 EDT 2008 Samuel Bronson
* Fix kind inference + test Also, comment out the case in kindOf that makes things look fine when they aren't -- unless of course * isn't the right kind This one makes the kind inference actually run when FrontEnd.KindInfer.hsTypeToType, and makes kindOf stop reporting * when the name in question is not in the environment -- signifying that kind inference has definitely not seen it. The former behaviour was useless, serving only to make things appear to work when they in fact did not, merely because * happened to be the correct kind in most cases.
This was due to the kind inference algorithm specified in the report, any unconstrained kinds are supposed to be defaulted to *. This may not be necessary anymore though as I think I added an explicit defaulting step. In any case, It wasn't put there by accident or a hack even if it is no longer needed. John -- John Meacham - ⑆repetae.net⑆john⑈
On Thu, Apr 3, 2008 at 9:06 PM, John Meacham
This one makes the kind inference actually run when FrontEnd.KindInfer.hsTypeToType, and makes kindOf stop reporting * when the name in question is not in the environment -- signifying that kind inference has definitely not seen it. The former behaviour was useless, serving only to make things appear to work when they in fact did not, merely because * happened to be the correct kind in most cases.
This was due to the kind inference algorithm specified in the report, any unconstrained kinds are supposed to be defaulted to *. This may not be necessary anymore though as I think I added an explicit defaulting step. In any case, It wasn't put there by accident or a hack even if it is no longer needed.
Well, that's what I thought it must be an attempt at. But in fact there is other code that does a much better job -- or at least, it does it in a way that provides less false comfort. The other code only defaults kinds for things that have made it into the kind environment. Anyway, the rule of thumb for compilers and RTSs is "crash ASAP", so...
On Thu, Apr 03, 2008 at 09:31:33PM -0400, Samuel Bronson wrote:
Well, that's what I thought it must be an attempt at. But in fact there is other code that does a much better job -- or at least, it does it in a way that provides less false comfort. The other code only defaults kinds for things that have made it into the kind environment. Anyway, the rule of thumb for compilers and RTSs is "crash ASAP", so...
Yeah, the original kind checker was out of the THIH in haskell paper, where only simple kinds were allowed so just defaulting to * was a straightforward way to do it. When I added the kind constraint stuff, it became necessary to be a bit smarter in the defaulting stage so that code was no longer needed. You will still find remenants of the old THIH kind checker and type checker around, though I have rewritten both a couple times since then, some code constructs and terminology has a way of sticking around. John -- John Meacham - ⑆repetae.net⑆john⑈
participants (2)
-
John Meacham -
Samuel Bronson