rerefined-0.2.0: Refinement types, again
Safe HaskellSafe-Inferred
LanguageGHC2021

Rerefined

Synopsis

Documentation

class Predicate p Source #

Types which define refinements on other types.

Minimal complete definition

predicateName

Instances

Instances details
Predicate Fail Source # 
Instance details

Defined in Rerefined.Predicate.Fail

Predicate Succeed Source # 
Instance details

Defined in Rerefined.Predicate.Succeed

Typeable a => Predicate (Typeably a :: Type) Source #

Fill out predicate metadata using its Typeable instance.

Do not use this for combinator predicates. Doing so will incur insidious Typeable contexts for the wrapped predicate(s).

Instance details

Defined in Rerefined.Predicate

Predicate p => Predicate (Not p :: Type) Source # 
Instance details

Defined in Rerefined.Predicate.Logical

Methods

predicateName :: Proxy# (Not p) -> Int -> ShowS Source #

(Typeable op, KnownNat n) => Predicate (CompareLength op n :: Type) Source # 
Instance details

Defined in Rerefined.Predicate.Relational.Length

(Typeable op, Typeable sign, KnownNat n) => Predicate (CompareValue op sign n :: Type) Source # 
Instance details

Defined in Rerefined.Predicate.Relational.Value

Methods

predicateName :: Proxy# (CompareValue op sign n) -> Int -> ShowS Source #

(Predicate l, Predicate r, ReifyLogicOp op) => Predicate (Logical op l r :: Type) Source # 
Instance details

Defined in Rerefined.Predicate.Logical

Methods

predicateName :: Proxy# (Logical op l r) -> Int -> ShowS Source #

class Predicate p => Refine p a Source #

Refine a with predicate p.

Minimal complete definition

validate

Instances

Instances details
Refine Fail a Source # 
Instance details

Defined in Rerefined.Predicate.Fail

Refine Succeed a Source # 
Instance details

Defined in Rerefined.Predicate.Succeed

Refine p a => Refine (Not p :: Type) a Source # 
Instance details

Defined in Rerefined.Predicate.Logical

(KnownNat n, MonoFoldable a, ReifyRelOp op) => Refine (CompareLength op n :: Type) a Source #

Compare the length of a MonoFoldable to a type-level Natural using the given RelOp.

Instance details

Defined in Rerefined.Predicate.Relational.Length

(KnownNat n, Num a, Ord a, ReifyRelOp op, ReifySignedNat sign n, ReifySign sign) => Refine (CompareValue op sign n :: Type) a Source # 
Instance details

Defined in Rerefined.Predicate.Relational.Value

Methods

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 # 
Instance details

Defined in Rerefined.Predicate.Logical

Methods

validate :: Proxy# (Logical op l r) -> a -> Maybe (RefineFailure String) Source #

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.

Minimal complete definition

validate1

Instances

Instances details
(KnownNat n, Foldable f, ReifyRelOp op) => Refine1 (CompareLength op n :: Type) (f :: Type -> Type) Source #

Compare the length of a Foldable to a type-level Natural using the given RelOp.

Instance details

Defined in Rerefined.Predicate.Relational.Length

Methods

validate1 :: forall (a :: k1). Proxy# (CompareLength op n) -> f a -> Maybe (RefineFailure String) Source #