Copyright | (c) 2017 Commonwealth Scientific and Industrial Research Organisation |
---|---|
License | BSD3 |
Maintainer | jack.kelly@data61.csiro.au |
Stability | experimental |
Portability | Non-Portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- banInstance :: TypeQ -> String -> DecsQ
Documentation
:: TypeQ | The instance you want to ban.
Most easily written with a type-quote: |
-> String | The reason that this instance is banned. |
-> DecsQ |
Ban an instance of a typeclass; code which tries to use the banned instance will fail at compile time. This works by generating an instance that depends on a custom type error:
instance TypeError (..) => ToJSON Foo where ...
Use it like this:
$(banInstance [t|ToJSON Foo|] "why ToJSON Foo should never be defined")