ban-instance-0.1.0.0: For when a type should never be an instance of a class

Copyright(c) 2017 Commonwealth Scientific and Industrial Research Organisation
LicenseBSD3
Maintainerjack.kelly@data61.csiro.au
Stabilityexperimental
PortabilityNon-Portable
Safe HaskellNone
LanguageHaskell2010

Language.Haskell.Instance.Ban

Description

 
Synopsis

Documentation

banInstance Source #

Arguments

:: TypeQ

The instance you want to ban. Most easily written with a type-quote: [t|ToJSON Foo|]

-> 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")