[GHC] #9180: New magic function `staticError`
GHC
ghc-devs at haskell.org
Sat Jun 7 08:05:35 UTC 2014
#9180: New magic function `staticError`
------------------------------------+-------------------------------------
Reporter: nomeata | Owner: nomeata
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.8.2
Keywords: | Operating System: Unknown/Multiple
Architecture: Unknown/Multiple | Type of failure: None/Unknown
Difficulty: Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: |
------------------------------------+-------------------------------------
While playing games with `RULES`, I had the need for a way to tell the
compiler “please spit out an error message”, in my case if list fusion
fails where the user explicitly requested for it.
Currently I put an `error "List did not fuse"` in the code using a `RULE`,
but what I’d really like to do is to put in a `staticError "List did not
fuse"` that, if appearing in Core (say, after the final simplification)
causes GHC to abort and print this message.
(I’m tempted to use type level strings somehow to make sure that the
parameter to `staticError` is not present at the value level, and also
that the string is easier to obtain. I’ll see.)
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9180>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list