|
Data.RepLib.Lib | Portability | non-portable | Stability | experimental | Maintainer | sweirich@cis.upenn.edu |
|
|
|
|
|
Description |
A library of specializable, type-indexed functions
|
|
Synopsis |
|
subtrees :: forall a. Rep a => a -> [a] | | deepSeq :: Rep a => a -> b -> b | | rnf :: Rep a => a -> a | | class Rep1 GSumD a => GSum a where | | | class Rep1 ZeroD a => Zero a where | | | class Rep1 GenerateD a => Generate a where | | | class Rep1 EnumerateD a => Enumerate a where | | | class Rep1 ShrinkD a => Shrink a where | | | class Rep1 (LreduceD b) a => Lreduce b a where | | | class Rep1 (RreduceD b) a => Rreduce b a where | | | class Fold f where | | | crush :: (Rep a, Fold t) => (a -> a -> a) -> a -> t a -> a | | gproduct :: (Rep a, Num a, Fold t) => t a -> a | | gand :: Fold t => t Bool -> Bool | | gor :: Fold t => t Bool -> Bool | | flatten :: (Rep a, Fold t) => t a -> [a] | | count :: (Rep a, Fold t) => t a -> Int | | comp :: (Rep a, Fold t) => t (a -> a) -> a -> a | | gconcat :: (Rep a, Fold t) => t [a] -> [a] | | gall :: (Rep a, Fold t) => (a -> Bool) -> t a -> Bool | | gany :: (Rep a, Fold t) => (a -> Bool) -> t a -> Bool | | gelem :: (Rep a, Eq a, Fold t) => a -> t a -> Bool | | data GSumD a = GSumD {} | | data ZeroD a = ZD {} | | data GenerateD a = GenerateD {} | | data EnumerateD a = EnumerateD {} | | data ShrinkD a = ShrinkD {} | | data LreduceD b a = LreduceD {} | | data RreduceD b a = RreduceD {} | | rnfR :: R a -> a -> a | | deepSeqR :: R a -> a -> b -> b | | gsumR1 :: R1 GSumD a -> a -> Int | | zeroR1 :: R1 ZeroD a -> a | | generateR1 :: R1 GenerateD a -> Int -> [a] | | enumerateR1 :: R1 EnumerateD a -> [a] | | lreduceR1 :: R1 (LreduceD b) a -> b -> a -> b | | rreduceR1 :: R1 (RreduceD b) a -> a -> b -> b |
|
|
|
Available for all representable types
|
|
subtrees :: forall a. Rep a => a -> [a] | Source |
|
Produce all children of a datastructure with the same type
Note that subtrees is available for all representable types. For those that
are not recursive datatypes, subtrees will always return the
empty list. But, these trivial instances are convenient to have
for the Shrink operation below.
|
|
|
deepSeq recursively forces the evaluation of its entire
argument.
|
|
|
rnf forces the evaluation of *datatypes* to their normal
forms. However, other types are left alone and not forced.
|
|
Derivable classes
|
|
|
Add together all of the Ints in a datastructure
| | Methods | | | Instances | |
|
|
|
Create a zero element of a type
| | Methods | | | Instances | |
|
|
|
Generate elements of a type up to a certain depth
| | Methods | | | Instances | |
|
|
|
enumerate the elements of a type, in DFS order.
| | Methods | |
|
|
|
| Methods | | | Instances | |
|
|
|
| Methods | | | Instances | |
|
|
|
| Methods | | | Instances | |
|
|
Generic operations based on Fold
|
|
|
| Methods | foldRight :: Rep a => (a -> b -> b) -> f a -> b -> b | Source |
| | foldLeft :: Rep a => (b -> a -> b) -> b -> f a -> b | Source |
|
| | Instances | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Types and generators for derivable classes
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
|
deepSeqR :: R a -> a -> b -> b | Source |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Produced by Haddock version 2.4.2 |