Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- data CompareLength op (n :: Natural)
- validateCompareLength :: forall op n. (KnownNat n, ReifyRelOp op, KnownPredicateName (CompareLength op n)) => Proxy# (CompareLength op n) -> Int -> Maybe RefineFailure
- widenCompareLength :: forall m op n a. WROE op n m => Refined (CompareLength op n) a -> Refined (CompareLength op m) a
- widenCompareLength1 :: forall m op n f a. WROE op n m => Refined1 (CompareLength op n) f a -> Refined1 (CompareLength op m) f a
- type WROE op n m = WROE' op n m (WidenRelOp op n m)
- type family WROE' op n m b where ...
Documentation
data CompareLength op (n :: Natural) Source #
Compare length to a type-level Natural
using the given RelOp
.
Instances
validateCompareLength :: forall op n. (KnownNat n, ReifyRelOp op, KnownPredicateName (CompareLength op n)) => Proxy# (CompareLength op n) -> Int -> Maybe RefineFailure Source #
widenCompareLength :: forall m op n a. WROE op n m => Refined (CompareLength op n) a -> Refined (CompareLength op m) a Source #
Widen a length comparison predicate.
Only valid widenings are permitted, checked at compile time.
Example: Given a >= 1, we know also that a >= 0. Thus, this function allows
you to turn a Refined (CompareLength GTE 1) a
into a Refined
(CompareLength GTE 0) a
.
TODO improve type error here
widenCompareLength1 :: forall m op n f a. WROE op n m => Refined1 (CompareLength op n) f a -> Refined1 (CompareLength op m) f a Source #
Widen a length comparison predicate.
Only valid widenings are permitted, checked at compile time.
Example: Given a >= 1, we know also that a >= 0. Thus, this function allows
you to turn a Refined1 (CompareLength GTE 1) f a
into a Refined1
(CompareLength GTE 0) f a
.
TODO improve type error here
type WROE op n m = WROE' op n m (WidenRelOp op n m) Source #