Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Documentation
module Rerefined.Refine
Types which define refinements on other types.
Instances
class Predicate p => Refine p a Source #
Refine a
with predicate p
.
Instances
Refine Fail a Source # | |
Defined in Rerefined.Predicate.Fail | |
Refine Succeed a Source # | |
Defined in Rerefined.Predicate.Succeed | |
Refine p a => Refine (Not p :: Type) a Source # | |
Defined in Rerefined.Predicate.Logical | |
(KnownNat n, MonoFoldable a, ReifyRelOp op) => Refine (CompareLength op n :: Type) a Source # | Compare the length of a |
Defined in Rerefined.Predicate.Relational.Length validate :: Proxy# (CompareLength op n) -> a -> Maybe (RefineFailure String) Source # | |
(KnownNat n, Num a, Ord a, ReifyRelOp op, ReifySignedNat sign n, ReifySign sign) => Refine (CompareValue op sign n :: Type) a Source # | |
Defined in Rerefined.Predicate.Relational.Value validate :: Proxy# (CompareValue op sign n) -> a -> Maybe (RefineFailure String) Source # | |
(Refine l a, Refine r a, ReifyLogicOp op) => Refine (Logical op l r :: Type) a Source # | |
Defined in Rerefined.Predicate.Logical |
class Predicate p => Refine1 p f Source #
Refine functor type f
with functor predicate p
.
By not making the contained type accessible, we ensure refinements apply
forall a. f a
. That is, refinements here apply only to the functor
structure, and not the stored elements.
Instances
(KnownNat n, Foldable f, ReifyRelOp op) => Refine1 (CompareLength op n :: Type) (f :: Type -> Type) Source # | Compare the length of a |
Defined in Rerefined.Predicate.Relational.Length validate1 :: forall (a :: k1). Proxy# (CompareLength op n) -> f a -> Maybe (RefineFailure String) Source # |