Data.Void

void-0.6.1: A Haskell 98 logically uninhabited data type

Copyright | (C) 2008-2013 Edward Kmett
License | BSD-style (see the file LICENSE)
Maintainer | Edward Kmett <ekmett@gmail.com>
Stability | provisional
Portability | portable
Safe Haskell | Trustworthy
Language | Haskell98

Data.Void

Description

Synopsis

- data Void
- absurd :: Void -> a
- vacuous :: Functor f => f Void -> f a
- vacuousM :: Monad m => m Void -> m a

# Documentation

data Void

A logically uninhabited data type.

Instances

Eq Void |
Data Void |
Ord Void |
Read Void | Reading a `Void` value is always a parse error, considering `Void` as a data type with no constructors.
Show Void |
Ix Void |
Generic Void |
Exception Void |
Hashable Void |
Semigroup Void |
type Rep Void |

absurd :: Void -> a

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

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.

vacuousM :: Monad m => m Void -> m a

If `Void` is uninhabited then any `Monad` that holds values of type `Void` is holding no values.