[GHC] #9180: New magic function `staticError`

GHC ghc-devs at haskell.org
Thu Oct 2 08:52:34 UTC 2014


#9180: New magic function `staticError`
-------------------------------------+-------------------------------------
              Reporter:  nomeata     |            Owner:  nomeata
                  Type:  feature     |           Status:  new
  request                            |        Milestone:
              Priority:  normal      |          Version:  7.8.2
             Component:  Compiler    |         Keywords:
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:              |  Related Tickets:
  None/Unknown                       |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by nomeata):

 Lint is not run by default, is it?

 In that case I don’t think it would quite cut it. I imagine that
 `staticError` could be quite a general tool that library authors can use
 to warn unaware users when they use the library wrongly; a user that
 deliberately runs the linter is, by definition, not unaware.

 Another use case would be to have rules that detect certain patterns that
 the library author knows that do not make sense, by having a rule `foo
 doNotPassMeToFoo = staticError "Bad user!"` he could prevent that. (Of
 course we’d like library authors to use the type system for that, but that
 might not be possible in all cases...)

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9180#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list