| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Language.REST.WQOConstraints.Strict
Description
This module defines an implemenation for representing constraints on a WQO;
in this case represented by a set of "extendable" WQOs each satisfying the constraints.
For more details see StrictOC
Synopsis
- strictOC :: Monad m => WQOConstraints StrictOC m
- strictOC' :: WQOConstraints StrictOC Identity
- difference :: (Eq a, Ord a, Hashable a) => StrictOC a -> StrictOC a -> StrictOC a
- isUnsatisfiable :: Eq a => StrictOC a -> Bool
- noConstraints :: forall a. (Eq a, Ord a, Hashable a) => StrictOC a
- permits :: (Eq a, Ord a, Hashable a) => StrictOC a -> WQO a -> Bool
- data StrictOC a
Documentation
strictOC :: Monad m => WQOConstraints StrictOC m Source #
An implementation of StrictOC; for any computational context
isUnsatisfiable :: Eq a => StrictOC a -> Bool Source #
Returns true iff strictOC ws does not permit any WQOs; i.e., if ws is empty.
noConstraints :: forall a. (Eq a, Ord a, Hashable a) => StrictOC a Source #
Constraints that permit any WQO. In this case implemented by
a singleton set containing an empty WQO.
permits :: (Eq a, Ord a, Hashable a) => StrictOC a -> WQO a -> Bool Source #
StrictOC ws permits a WQO w if there exists a w' in ws
that can be extended to equal w
StrictOC ws represents constraints on a WQO. Each element of ws is a WQO
that satisfies the constraints. StrictOC ws permits a WQO w if there exists
a w' in ws such that w' can be extended to yield w.
This implementation is similar to disjunctive normal form representation of
logical formulas; except in this case each "conjunction" is a valid WQO, and thus
"satisfiable". Therefore StrictOC ws satisfies some WQO iff ws is not empty.
Two potential downsides to this implementation are:
1. The size of ws can grow quickly; an inherent issue of DNF
2. Related, calculating the entire set ws is computationally expensive,
and often unnecessary for RESTs use-case, where continuing the path only
requires knowing if any WQO is permitted.
Instances
| Eq a => Eq (StrictOC a) Source # | |
| Ord a => Ord (StrictOC a) Source # | |
Defined in Language.REST.WQOConstraints.Strict | |
| (Show a, Eq a, Ord a, Hashable a) => Show (StrictOC a) Source # | |
| Generic (StrictOC a) Source # | |
| Hashable a => Hashable (StrictOC a) Source # | |
Defined in Language.REST.WQOConstraints.Strict | |
| type Rep (StrictOC a) Source # | |
Defined in Language.REST.WQOConstraints.Strict | |