HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleghc-internal-9.1003.0Haskell2010

GHC.Internal.Data.Void

A logically uninhabited data type, used to indicate that a given term should not exist.

  • 1 type
  • 2 values
datadata Void
#

Uninhabited data type

Instances10Eq, Data, Ord, Read, Show, Ix, …
  • Eq VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Data VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Ord VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Read VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Read

    Reading a Void value is always a parse error, considering Void as a data type with no constructors.

  • Show VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Ix VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Ix
  • Generic VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Semigroup VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Exception VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Exception.Type
  • type Rep Void = D1 ('MetaData "Void" "GHC.Internal.Base" "ghc-internal" 'False) V1Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
valueabsurd :: Void -> a
#

Since Void values logically don't exist, this witnesses the logical reasoning tool of "ex falso quodlibet".

Example2 expressions
let x :: Either Void Int; x = Right 5:{case x of    Right r -> r    Left l  -> absurd l:}5
valuevacuous :: Functor f => f Void -> f a
#

If Void is uninhabited then any Functor that holds only values of type Void is holding no values. It is implemented in terms of fmap absurd.