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

Portabilitynon-portable
Stabilityexperimental
Maintainergenerics@haskell.org

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 (C c a) 
(Empty a, Empty b) => Empty (:*: a b) 
(HasRec a, Empty a, Empty b) => Empty (:+: a b) 

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