logical-constraints-0.1.3.0: Simple logical constraints 'syntax-sugar' writing library.
Copyright(c) Oleksandr Zhabenko 2022-2023
LicenseMIT
Maintaineroleksandr.zhabenko@yahoo.com
StabilityExperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Logical.OrdConstraints

Description

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

Documentation

data OrdConstraints a Source #

Data type to encode the simple logical contstraints for some Ordered 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.

Constructors

O [a] 
C [a] 

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.

ordCs2HPred1 :: (Ord a, Foldable t1) => OrdCs t1 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 #

ordCs2HPredG :: (Ord a, Foldable t, Foldable t1) => OrdCs t1 a -> (t a -> Maybe a) -> t a -> Bool Source #