Module

Data.Void

Package
purescript-prelude
Repository
purescript/purescript-prelude

#Void Source

newtype Void

An uninhabited data type.

Void is useful to eliminate the possibility of a value being created. For example, a value of type Either Void Boolean can never have a Left value created in PureScript.

Instances

#absurd Source

absurd :: forall a. Void -> a

Eliminator for the Void type. Useful for stating that some code branch is impossible because you've "acquired" a value of type Void (which you can't).

rightOnly :: forall t . Either Void t -> t
rightOnly (Left v) = absurd v
rightOnly (Right t) = t