keuringsdienst-0.1.1.0: Data validation in Haskell made easy.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Keuringsdienst.Helpers

Synopsis

Documentation

filterFailedValidations :: Map Text (Validation err) -> Map Text (Validation err) Source #

Filter a Map of Validation err and keep only the failures.

isEqualTo :: (Show a, Eq a) => a -> ValidationRule a Source #

Validate that a value is equal to another.

isLesserThan :: (Show a, Ord a) => a -> ValidationRule a Source #

Validate that a value is lesser than another.

isNegative :: ValidationRule Int Source #

Validate that a value is lesser than 0.

isNegativeOrZero :: ValidationRule Int Source #

Validate that a value is negative or zero.

isNonEmptyText :: ValidationRule Text Source #

Validate that a value is a non empty Text.

isPositive :: ValidationRule Int Source #

Validate that a value is greater than 0.

isPositiveOrZero :: ValidationRule Int Source #

Validate that a value is positive or zero.

isTextOfLength :: Int -> ValidationRule Text Source #

Validate that a value is a Text of certain length.

isTextSmallerThan :: Int -> ValidationRule Text Source #

Validate that a value is a Text of length smaller than n.

isTextSmallerThanOrEqual :: Int -> ValidationRule Text Source #

Validate that a value is a Text of length smaller or equal to n.

isNotEqualTo :: (Show a, Eq a) => a -> ValidationRule a Source #

Validate that a value is different to another.