Copyright | disco team and contributors |
---|---|
License | BSD-3-Clause |
Maintainer | byorgey@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
Enumerate values inhabiting Disco types.
Synopsis
- type ValueEnumeration = IEnumeration Value
- enumVoid :: ValueEnumeration
- enumUnit :: ValueEnumeration
- enumBool :: ValueEnumeration
- enumN :: ValueEnumeration
- enumZ :: ValueEnumeration
- enumF :: ValueEnumeration
- enumQ :: ValueEnumeration
- enumC :: ValueEnumeration
- enumSet :: ValueEnumeration -> ValueEnumeration
- enumList :: ValueEnumeration -> ValueEnumeration
- enumType :: Type -> ValueEnumeration
- enumTypes :: [Type] -> IEnumeration [Value]
- enumerateType :: Type -> [Value]
- enumerateTypes :: [Type] -> [[Value]]
Documentation
type ValueEnumeration = IEnumeration Value Source #
Base types
enumVoid :: ValueEnumeration Source #
Enumerate all values of type Void
(none).
enumUnit :: ValueEnumeration Source #
Enumerate all values of type Unit
(the single value unit
).
enumBool :: ValueEnumeration Source #
Enumerate the values of type Bool
as [false, true]
.
enumN :: ValueEnumeration Source #
Enumerate all values of type Nat
(0, 1, 2, ...).
enumZ :: ValueEnumeration Source #
Enumerate all values of type Integer
(0, 1, -1, 2, -2, ...).
enumF :: ValueEnumeration Source #
Enumerate all values of type Fractional
in the Calkin-Wilf
order (1, 12, 2, 13, 32, 23, 3, ...).
enumQ :: ValueEnumeration Source #
Enumerate all values of type Rational
in the Calkin-Wilf order,
with negatives interleaved (0, 1, -1, 12, -12, 2, -2, ...).
enumC :: ValueEnumeration Source #
Enumerate all Unicode characters.
Containers
enumSet :: ValueEnumeration -> ValueEnumeration Source #
Enumerate all *finite* sets over a certain element type, given an enumeration of the elements. If we think of each finite set as a binary string indicating which elements in the enumeration are members, the sets are enumerated in order of the binary strings.
enumList :: ValueEnumeration -> ValueEnumeration Source #
Enumerate all *finite* lists over a certain element type, given an enumeration of the elements. It is very difficult to describe the order in which the lists are generated.
Any type
enumType :: Type -> ValueEnumeration Source #
Enumerate the values of a given type.
Lifted functions that return lists
enumerateType :: Type -> [Value] Source #
Produce an actual list of the values of a type.
enumerateTypes :: [Type] -> [[Value]] Source #
Produce an actual list of values enumerated from a finite product of types.