Copyright | (c) Oleksandr Zhabenko 2022-2023 |
---|---|
License | MIT |
Maintainer | oleksandr.zhabenko@yahoo.com |
Stability | Experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Some simple logical encoding 'syntactical sugar' to represent point-wise or intervals-based logics.
If you would like to use data types not in the functions of the module imported, but in your
own ones, please, consider using before the validOrdCs
function for them. If you use just
the functions defined here, you do not need to use it before because it is used internally.
Synopsis
- data OrdConstraints a
- type OrdCs t a = t (OrdConstraints a)
- validOrdCs :: Ord a => OrdConstraints a -> Bool
- ordCs2Predicate1 :: Ord a => OrdConstraints a -> a -> Bool
- ordCs2HPred1 :: (Ord a, Foldable t1) => OrdCs t1 a -> a -> Bool
- ordCs2Predicate :: Ord a => OrdConstraints a -> [a] -> Bool
- ordCs2HPred :: (Ord a, Foldable t1) => OrdCs t1 a -> [a] -> Bool
- ordCs2PredicateG :: (Ord a, Foldable t) => OrdConstraints a -> (t a -> Maybe a) -> t a -> Bool
- ordCs2HPredG :: (Ord a, Foldable t, Foldable t1) => OrdCs t1 a -> (t a -> Maybe a) -> t a -> Bool
Documentation
data OrdConstraints a Source #
Data type to encode the simple logical contstraints for some Ord
ered data type value to be kept in some bounds (to lay in some intervals or points). O
constructor encodes
point-wise logics, and C
encodes intervals logics.
Instances
type OrdCs t a = t (OrdConstraints a) Source #
Primary intention: the t
here refers to Foldable
t
.
validOrdCs :: Ord a => OrdConstraints a -> Bool Source #
The predicate to check whether the data is encoded logically correct just enough to be used by the functions in the library (minimal necessary validation). Checks whether at least just one point or interval is set.
ordCs2Predicate1 :: Ord a => OrdConstraints a -> a -> Bool Source #
ordCs2Predicate :: Ord a => OrdConstraints a -> [a] -> Bool Source #
Just the head of the list is used. Therefore, is intended to be used mainly with the singleton list as the second argument.
ordCs2HPred :: (Ord a, Foldable t1) => OrdCs t1 a -> [a] -> Bool Source #
Just the head of the list is used. Therefore, is intended to be used mainly with the singleton list as the second argument.
ordCs2PredicateG :: (Ord a, Foldable t) => OrdConstraints a -> (t a -> Maybe a) -> t a -> Bool Source #