[GHC] #14983: Have custom type errors imply Void

#14983: Have custom type errors imply Void -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: task | Status: new Priority: lowest | Milestone: Component: Compiler | Version: 8.5 Keywords: | Operating System: Unknown/Multiple CustomTypeErrors | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- This is a very minor issue, but `TypeError` (CustomTypeErrors) should entail a constraint like {{{#!hs import Data.Void class (forall x. x) => No where no :: Void }}} so users don't have to use `undefined` or `error ..`: {{{#!hs instance TypeError (Text "Can't show functions) => Show (a -> b) where show :: (a -> b) -> String show = no & absurd }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14983 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14983: Have custom type errors imply Void -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: task | Status: new Priority: lowest | Milestone: Component: Compiler | Version: 8.5 Resolution: | Keywords: | CustomTypeErrors Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by Iceland_jack: Old description:
This is a very minor issue, but `TypeError` (CustomTypeErrors) should entail a constraint like
{{{#!hs import Data.Void
class (forall x. x) => No where no :: Void }}}
so users don't have to use `undefined` or `error ..`:
{{{#!hs instance TypeError (Text "Can't show functions) => Show (a -> b) where show :: (a -> b) -> String show = no & absurd }}}
New description: This is a very minor issue, but `TypeError` (CustomTypeErrors) should entail a constraint like {{{#!hs import Data.Void class (forall x. x) => No where no :: Void }}} so users don't have to use `undefined` or `error ..`: {{{#!hs instance TypeError (Text "Can't show functions") => Show (a -> b) where show :: (a -> b) -> String show = no & absurd }}} -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14983#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14983: Have custom type errors imply Void -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: task | Status: new Priority: lowest | Milestone: Component: Compiler | Version: 8.5 Resolution: | Keywords: | CustomTypeErrors | QuantifiedConstraints wipT2893 Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * keywords: CustomTypeErrors => CustomTypeErrors QuantifiedConstraints wipT2893 Comment: Can't you just do this? {{{#!hs {-# LANGUAGE DataKinds #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE QuantifiedConstraints #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE UndecidableSuperClasses #-} module Foo where import Data.Void import GHC.TypeLits class (forall x. x) => No where no :: Void class (TypeError a, forall x. x) => MyTypeError a instance MyTypeError (Text "Can't show functions") => Show (a -> b) where show = absurd no }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14983#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14983: Have custom type errors imply Void -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: task | Status: new Priority: lowest | Milestone: Component: Compiler | Version: 8.5 Resolution: | Keywords: | CustomTypeErrors | QuantifiedConstraints Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * keywords: CustomTypeErrors QuantifiedConstraints wipT2893 => CustomTypeErrors QuantifiedConstraints -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14983#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC