Proposal: Partial Type Signatures - Status update

Richard Eisenberg eir at cis.upenn.edu
Fri Jun 20 00:09:33 UTC 2014


Great -- this agrees with the current proposal at the type level ((NEWCUSK) in the language of #9200.)

Thanks for the quick response!
Richard

On Jun 19, 2014, at 6:00 PM, Simon Peyton Jones <simonpj at microsoft.com> wrote:

> 
> | So in general, if there is a partial type signature, the compiler
> | tries to infer a type under the assumption that there is no
> | polymorphic recursion, similar to what it does when there is no
> | signature.
> 
> Yes. The way to think of it (at both term and type level) is this.  
> 
> A full type signature breaks dependency loops, and supports polymorphic recursion.
> 
> A partial type signature is treated exactly like *no* type signature, except that extra typing constraints are added.  Where the signature has a variable, we insist that the result is a variable; where the signature are distinct variables we insist that the final inferred type has distinct variables. Moreover, the explicitly mentioned variables can lexically scope over the definition.  
> 
> But no polymorphic recursion at all, with a partial type signature.
> 
> Simon
> 



More information about the ghc-devs mailing list