base-compat-batteries-0.13.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 Source #

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.Base Methods (<>) :: Void -> Void -> Void Source # sconcat :: NonEmpty Void -> Void Source # stimes :: Integral b => b -> Void -> Void Source #
Exception Void | Since: base-4.8.0.0
Instance details Defined in GHC.Exception.Type Methods toException :: Void -> SomeException Source # fromException :: SomeException -> Maybe Void Source # displayException :: Void -> String Source #
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.Read Methods readsPrec :: Int -> ReadS Void Source # readList :: ReadS [Void] Source # readPrec :: ReadPrec Void Source # readListPrec :: ReadPrec [Void] Source #
Show Void | Since: base-4.8.0.0
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Void -> ShowS Source # show :: Void -> String Source # showList :: [Void] -> ShowS Source #
Eq Void | Since: base-4.8.0.0
Instance details Defined in GHC.Base Methods (==) :: Void -> Void -> Bool Source # (/=) :: Void -> Void -> Bool Source #
Ord Void | Since: base-4.8.0.0
Instance details Defined in GHC.Base Methods compare :: Void -> Void -> Ordering Source # (<) :: Void -> Void -> Bool Source # (<=) :: Void -> Void -> Bool Source # (>) :: Void -> Void -> Bool Source # (>=) :: Void -> Void -> Bool Source # max :: Void -> Void -> Void Source # min :: Void -> Void -> Void Source #

absurd :: Void -> a Source #

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 Source #

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