Tentative high-level plans for 7.10.1

Simon Peyton Jones simonpj at microsoft.com
Tue Oct 7 22:21:45 UTC 2014


Is the wiki page up to date?  https://ghc.haskell.org/trac/ghc/wiki/PartialTypeSignatures

I'd move the Constraint Wildcards bit out to an appendix or delete altogether -- it's a distraction since it's not part of the design.

Named wildcard are described as a "fourth form" but actually it's "third" I suppose. And aren't they just a vairant of "type wildcards"?  You can't name "extra-constraint wildcards" can you?

There's a long section on "partial expressions and pattern signatures" but I think the conclusion is "we don't do this".  Again, move to an appendix of not-implemented ideas.

Try to focus on the actual design.

Thanks!

Simon


________________________________________
From: ghc-devs [ghc-devs-bounces at haskell.org] on behalf of Thomas Winant [Thomas.Winant at cs.kuleuven.be]
Sent: 07 October 2014 17:07
To: ghc-devs at haskell.org
Subject: Re: Tentative high-level plans for 7.10.1

Hi,

On 2014-10-03 23:35, Austin Seipp wrote:
> ..
> Here are the major patches on Phabricator still needing review, that I
> think we'd like to see for 7.10.1:
>
>   - D168: Partial type signatures
> ..

As Austin said, our patch implementing Partial Type Signatures is still
up for code review on Phabricator [1]. It is our goal too to get it in
7.10.1, and we will try to do as much as we can to help out with this
process.

We'd like it very much if people had a thorough look at it (thanks
Richard for the feedback). We're glad to provide additional info
(including extra comments in the code), rewrite confusing code, etc.

= Status =

The implementation is nearly complete:
* We've integrated support for Holes, i.e. by default, an underscore in
   a type signature will generate an error message mentioning the
   inferred type. By enabling -XPartialTypeSignatures, the inferred type
   is used and the underscore can remain in the type signature.
* SPJ's proposed simplifications (over Skype) have been implemented,
   except for the fact that we still use the annotated constraints for
   solving, see [2].
* Richard's comments on Phabricator [1] have been addressed in extra
   commits.
* I've rebased the patch against master on Monday.
* I've added docstring for most of the new functions I've added.
* Some TODOs still remain, I'll summarise the most important ones here.
   See [3] for a detailed list with examples.
   * When -XMonoLocalBinds is enabled (implied by -XGADTs and
     -XTypeFamilies), (some) local bindings without type signature aren't
     generalised. Partial type signatures should follow this behaviour.
     This is currently not handled correctly. We have a stopgap solution
     involving generating an error in mind, but would prefer a real fix.
     We'd like some help with this.
   * Partial type signatures are currently ignored for pattern bindings.
     This bug doesn't seem to be difficult to solve, but requires some
     debugging.
   * The following code doesn't type check:

     {-# LANGUAGE MonomorphismRestriction, PartialTypeSignatures #-}
     charlie :: _ => a
     charlie = 3

     Type error: No instance for (Num a) arising from the literal ‘3’. We
     would like the (Num a) constraint to be inferred (because of the
     extra-constraint wildcard).
   * Some smaller things, e.g. improving error messages.

We'll try to fix the remaining TODOs, but help is certainly appreciated
and will speed up integrating this patch!

Please have a look at the code and let us know what we can do to help.


Cheers,
Thomas Winant

[1]: https://phabricator.haskell.org/D168
[2]:
https://ghc.haskell.org/trac/ghc/wiki/PartialTypeSignatures#extra-constraints-wildcard
[3]: https://ghc.haskell.org/trac/ghc/wiki/PartialTypeSignatures#TODOs

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
_______________________________________________
ghc-devs mailing list
ghc-devs at haskell.org
http://www.haskell.org/mailman/listinfo/ghc-devs


More information about the ghc-devs mailing list