instant-generics-0.3.6: Generic programming library with a sum of products view

Portabilitynon-portable
Stabilityexperimental
Maintainergenerics@haskell.org
Safe HaskellNone

Generics.Instant.Functions.Empty

Description

Generically produce a single finite value of a datatype.

Synopsis

Documentation

class Empty a whereSource

Methods

empty' :: aSource

Instances

Empty Bool 
Empty Char 
Empty Double 
Empty Float 
Empty Int 
Empty Integer 
Empty U 
Empty a => Empty [a] 
Empty a => Empty (Maybe a) 
Empty a => Empty (Rec a) 
Empty a => Empty (Var a) 
(Empty a, Empty b) => Empty (a, b) 
(Empty a, Empty b) => Empty (:*: a b) 
(HasRec a, Empty a, Empty b) => Empty (:+: a b) 
Empty a => Empty (CEq c p p a) 

class HasRec a whereSource

We use HasRec to check for recursion in the structure. This is used to avoid selecting a recursive branch in the sum case for Empty.

Methods

hasRec' :: a -> BoolSource

Instances

HasRec Char 
HasRec Double 
HasRec Float 
HasRec Int 
HasRec Integer 
HasRec U 
HasRec (Rec a) 
HasRec (Var a) 
(HasRec a, HasRec b) => HasRec (:*: a b) 
(HasRec a, HasRec b) => HasRec (:+: a b) 
HasRec a => HasRec (CEq c p q a)