Data.Void.Compat

base-compat-batteries-0.14.1: base-compat with extra batteries

Safe Haskell | Safe-Inferred
Language | Haskell2010

Data.Void.Compat

Synopsis

- data Void
- absurd :: Void -> a
- vacuous :: Functor f => f Void -> f a

# Documentation

data Void #

Uninhabited data type

@since base-4.8.0.0

#### Instances

Instances details

Semigroup Void | @since base-4.9.0.0
Instance details Defined in GHC.Internal.Base Methods (<>) :: Void -> Void -> Void # sconcat :: NonEmpty Void -> Void # stimes :: Integral b => b -> Void -> Void #
Exception Void | @since base-4.8.0.0
Instance details Defined in GHC.Internal.Exception.Type Methods toException :: Void -> SomeException # fromException :: SomeException -> Maybe Void # displayException :: Void -> String # backtraceDesired :: Void -> Bool #
Read Void | Reading a `Void` value is always a parse error, considering `Void` as a data type with no constructors. @since base-4.8.0.0
Instance details Defined in GHC.Internal.Read Methods readsPrec :: Int -> ReadS Void # readList :: ReadS [Void] # readPrec :: ReadPrec Void # readListPrec :: ReadPrec [Void] #
Show Void | @since base-4.8.0.0
Instance details Defined in GHC.Internal.Show Methods showsPrec :: Int -> Void -> ShowS # show :: Void -> String # showList :: [Void] -> ShowS #
Eq Void | @since base-4.8.0.0
Instance details Defined in GHC.Internal.Base Methods (==) :: Void -> Void -> Bool # (/=) :: Void -> Void -> Bool #
Ord Void | @since base-4.8.0.0
Instance details Defined in GHC.Internal.Base Methods compare :: Void -> Void -> Ordering # (<) :: Void -> Void -> Bool # (<=) :: Void -> Void -> Bool # (>) :: Void -> Void -> Bool # (>=) :: Void -> Void -> Bool # max :: Void -> Void -> Void # min :: Void -> Void -> Void #

absurd :: Void -> a #

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

    >>> let x :: Either Void Int; x = Right 5
    >>> :{
    case x of
        Right r -> r
        Left l  -> absurd l
    :}
    5

@since base-4.8.0.0

vacuous :: 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`.

@since base-4.8.0.0