Module
Data.Refined.Predicate
- Package
- purescript-refined
- Repository
- danieljharvey/purescript-refined
#Predicate Source
class Predicate p x where
Members
validate :: p -> x -> Either (RefinedError x) x
Instances
Predicate IdPred x
(Predicate l x, Predicate r x) => Predicate (And l r) x
(Predicate l x, Predicate r x) => Predicate (Or l r) x
(Predicate a x, Foldable t, Nat n) => Predicate (SizeEqualTo n) (t a)
(Predicate a x, Foldable t, Nat n) => Predicate (SizeGreaterThan n) (t a)
(Predicate a x, Foldable t, Nat n) => Predicate (SizeLessThan n) (t a)
(Predicate a x) => Predicate (Not a) x
(Nat n, Ord x, Ring x) => Predicate (LessThan n) x
(Nat n, Ord x, Ring x) => Predicate (GreaterThan n) x
(Nat n, Ord x, Ring x) => Predicate (From n) x
(Nat n, Ord x, Ring x) => Predicate (To n) x
(Nat n, Nat m, Ord x, Ring x) => Predicate (FromTo m n) x
(Nat n, Eq x, Ring x) => Predicate (EqualTo n) x
(Nat n, Eq x, Ring x) => Predicate (NotEqualTo n) x
#SizeEqualTo Source
data SizeEqualTo a
A 'Predicate' ensuring that the length of a foldable is equal to a given int
Instances
(Predicate a x, Foldable t, Nat n) => Predicate (SizeEqualTo n) (t a)
#SizeGreaterThan Source
data SizeGreaterThan a
A 'Predicate' ensuring that the length of a foldable is greater than a given int
Instances
(Predicate a x, Foldable t, Nat n) => Predicate (SizeGreaterThan n) (t a)
#SizeLessThan Source
data SizeLessThan a
A 'Predicate' ensuring that the length of a foldable is less than a given int
Instances
(Predicate a x, Foldable t, Nat n) => Predicate (SizeLessThan n) (t a)
#GreaterThan Source
data GreaterThan n
A 'Predicate' ensuring that the value is greater than a given int
Instances
(Nat n, Ord x, Ring x) => Predicate (GreaterThan n) x
#NotEqualTo Source
data NotEqualTo n
A 'Predicate' ensuring that the value is not equal to a given int
Instances
(Nat n, Eq x, Ring x) => Predicate (NotEqualTo n) x
#Positive Source
type Positive = GreaterThan D0
A 'Predicate' ensuring that the value is greater than zero.
#NonPositive Source
type NonPositive = To D0
A 'Predicate' ensuring that the value is less than or equal to zero.
#NonNegative Source
type NonNegative = From D0
A 'Predicate' ensuring that the value is greater than or equal to zero.
#NonZero Source
type NonZero = NotEqualTo D0
A 'Predicate' ensuring that the value is not equal to zero.
#NonEmpty Source
type NonEmpty = SizeGreaterThan D0
A 'Predicate' ensuring that the 'Foldable' is non-empty.