mirrored from https://gitlab.haskell.org/ghc/ghc.git
-
Notifications
You must be signed in to change notification settings - Fork 704
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add type "holes", enabled by -XTypeHoles, Trac #5910
This single commit combines a lot of work done by Thijs Alkemade <thijsalkemade@gmail.com>, plus a slew of subsequent refactoring by Simon PJ. The basic idea is * Add a new expression form "_", a hole, standing for a not-yet-written expression * Give a useful error message that (a) gives the type of the hole (b) gives the types of some enclosing value bindings that mention the hole Driven by this goal I did a LOT of refactoring in TcErrors, which in turn allows us to report enclosing value bindings for other errors, not just holes. (Thijs rightly did not attempt this!) The major data type change is a new form of constraint data Ct = ... | CHoleCan { cc_ev :: CtEvidence, cc_hole_ty :: TcTauType, cc_depth :: SubGoalDepth } I'm still in two minds about whether this is the best plan. Another possibility would be to have a predicate type for holes, somthing like class Hole a where holeValue :: a It works the way it is, but there are some annoying special cases for CHoleCan (just grep for "CHoleCan").
- Loading branch information
Simon Peyton Jones
committed
Sep 17, 2012
1 parent
b0db930
commit 8a9a7a8
Showing
20 changed files
with
565 additions
and
401 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.