equational-reasoning-0.5.1.0: Proof assistant for Haskell using DataKinds & PolyKinds

Safe HaskellNone
LanguageHaskell98

Proof.Propositional.Inhabited

Synopsis

Documentation

class Inhabited a where Source #

Types with at least one inhabitant, dual to Empty. Currently, GHC doesn't provide a selective-instance, hence we can't generically derive Inhabited instances for sum types (i.e. by DeriveAnyClass).

To derive an instance for each concrete types, use prove.

Since 0.4.0.0.

Methods

trivial :: a Source #

A generic inhabitant of type a, which means that one cannot assume anything about the value of trivial except that it

  • is of type a, and
  • doesn't contain any partial values.

trivial :: (Generic a, GInhabited (Rep a)) => a Source #

A generic inhabitant of type a, which means that one cannot assume anything about the value of trivial except that it

  • is of type a, and
  • doesn't contain any partial values.

Instances

Inhabited () Source # 

Methods

trivial :: () Source #

Inhabited (IsTrue True) Source # 
Inhabited b => Inhabited (a -> b) Source # 

Methods

trivial :: a -> b Source #

(Inhabited a, Inhabited b) => Inhabited (a, b) Source # 

Methods

trivial :: (a, b) Source #

(Inhabited a, Inhabited b, Inhabited c) => Inhabited (a, b, c) Source # 

Methods

trivial :: (a, b, c) Source #

(Inhabited a, Inhabited b, Inhabited c, Inhabited d) => Inhabited (a, b, c, d) Source # 

Methods

trivial :: (a, b, c, d) Source #

withInhabited :: forall a b. a -> (Inhabited a => b) -> b Source #