Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- class Universe a where
- all_elements :: [a]
- separator :: (Universe a, Eq b) => (a -> b) -> (a -> b) -> Bool
- equivalence_class :: Universe b => (a -> b -> Bool) -> a -> [b]
- different_elements :: (Universe a, Eq b) => (a -> b) -> (a -> b) -> [a]
- isMonotone :: (Universe a, Ord a, Ord b) => (a -> b) -> Bool
- domain :: Universe a => (a -> b) -> [a]
- all_nums :: (Num t, Bounded t, Enum t) => [t]
- all_lists :: [a] -> [[a]]
- table_to_function :: Eq a => [(a, b)] -> a -> b
- all_functions :: (Universe d, Universe c) => [[(c, d)]]
- all_subsets :: [a] -> [[a]]
- all_functions_with_domain :: Universe c => [d] -> [[(d, c)]]
- all_functions_from :: [c] -> [d] -> [[(c, d)]]
- all_sets :: Ord a => [a] -> [Set a]
Documentation
class Universe a where Source #
The universe class describes a listing of elements of type a, not
including the undefined
.
This class is frequently needed when dealing with properties.
This is a representation of a recursively enumerable set.
Note that algorithms based on this can be excessively inefficient
e.g. for 64 bit integers going through all alternatives is not likely
to be fully successful. The instances for big types are designed
so that most likely occurring values are in the beginning of
the list, e.g. for Integer type, the universe is
[0,1,-1,2,-2,...]
.
all_elements :: [a] Source #
Instances
equivalence_class :: Universe b => (a -> b -> Bool) -> a -> [b] Source #
different_elements :: (Universe a, Eq b) => (a -> b) -> (a -> b) -> [a] Source #
all_nums :: (Num t, Bounded t, Enum t) => [t] Source #
order here is chosen based on what numbers are more likely in applications, so numbers close to zero occur first.
table_to_function :: Eq a => [(a, b)] -> a -> b Source #
all_functions :: (Universe d, Universe c) => [[(c, d)]] Source #
all_subsets :: [a] -> [[a]] Source #
all_functions_with_domain :: Universe c => [d] -> [[(d, c)]] Source #
all_functions_from :: [c] -> [d] -> [[(c, d)]] Source #
all_functions_from only produces any results if the domain list is finite.