
#9334: Implement "instance chains" -------------------------------------+------------------------------------- Reporter: diatchki | Owner: diatchki Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 7.9 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Iceland_jack): Replying to [comment:9 aavogt]:
In some sense this can already be done: {{{ class FailHasNoInstances a => Fail a class FailHasNoInstances a -- not exported to ban Fail instances
instance Fail "Char may not have a Num instance" => Num Char main = print $ '1' + '1' }}}
Is there a difference between using `Fail` and Proposal/CustomTypeErrors? (see #11967) {{{#!hs instance TypeError (Text "Boo-urns!") => Num Char }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9334#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler