Portability | non-portable |
---|---|
Stability | experimental |
Maintainer | sweirich@cis.upenn.edu |
A library of specializable, type-indexed functions
- 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
- zero :: a
- class Rep1 GenerateD a => Generate a where
- class Rep1 EnumerateD a => Enumerate a where
- enumerate :: [a]
- class Rep1 ShrinkD a => Shrink a where
- shrink :: a -> [a]
- class Rep1 (LreduceD b) a => Lreduce b a where
- lreduce :: b -> a -> b
- class Rep1 (RreduceD b) a => Rreduce b a where
- rreduce :: a -> b -> b
- 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 {
- zeroD :: a
- data GenerateD a = GenerateD {}
- data EnumerateD a = EnumerateD {
- enumerateD :: [a]
- data ShrinkD a = ShrinkD {
- shrinkD :: a -> [a]
- data LreduceD b a = LreduceD {
- lreduceD :: b -> a -> b
- data RreduceD b a = RreduceD {
- rreduceD :: a -> b -> b
- 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 :: Rep a => a -> b -> bSource
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
class Rep1 EnumerateD a => Enumerate a whereSource
enumerate the elements of a type, in DFS order.
Generic operations based on Fold
Types and generators for derivable classes
generateR1 :: R1 GenerateD a -> Int -> [a]Source
enumerateR1 :: R1 EnumerateD a -> [a]Source