[GHC] #9637: Type level programming needs an error function
GHC
ghc-devs at haskell.org
Fri Sep 26 14:11:40 UTC 2014
#9637: Type level programming needs an error function
-------------------------------------+-------------------------------------
Reporter: augustss | Owner:
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.8.3
Keywords: | Operating System:
Architecture: Unknown/Multiple | Unknown/Multiple
Difficulty: Unknown | Type of failure:
Blocked By: | None/Unknown
Related Tickets: | Test Case:
| Blocking:
| Differential Revisions:
-------------------------------------+-------------------------------------
When doing type level programming you often need a way to report errors.
I suggest a closed type family called Error with special semantics.
It is kinded like this Error :: Symbol -> k1 -> k2
If this function has to be reduced during constraint solving it will
simply generate a type error with the given string and printing the type
as extra information (this kind can be generalized a lot if we want to).
I've found that having this function gives more accurate and earlier error
messages.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9637>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list