disco-0.1.6: Functional programming language for teaching discrete math.
Copyrightdisco team and contributors
LicenseBSD-3-Clause
Maintainerbyorgey@gmail.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

Disco.Enumerate

Description

Enumerate values inhabiting Disco types.

Synopsis

Documentation

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.

enumTypes :: [Type] -> IEnumeration [Value] Source #

Enumerate a finite product of types.

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.