| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Menshen
Synopsis
- class Monad m => HasValid m where
- type Validator a = forall m. HasValid m => m a -> m a
- class HasValidSize a
- size :: HasValidSize a => (Word64, Word64) -> Validator a
- notEmpty :: HasValidSize a => Validator a
- notBlank :: HasValidSize a => Validator a
- notNull :: Validator (Maybe a)
- assertNull :: Validator (Maybe a)
- assertTrue :: Validator Bool
- assertFalse :: Validator Bool
- positive :: (Eq a, Num a) => Validator a
- positiveOrZero :: (Eq a, Num a) => Validator a
- negative :: (Eq a, Num a) => Validator a
- negativeOrZero :: (Eq a, Num a) => Validator a
- minInt :: (Ord a, Integral a) => a -> Validator a
- maxInt :: (Ord a, Integral a) => a -> Validator a
- minDecimal :: (Ord a, RealFloat a) => a -> Validator a
- maxDecimal :: (Ord a, RealFloat a) => a -> Validator a
- pattern :: RegexLike Regex a => String -> Validator a
- email :: RegexLike Regex a => Validator a
- (&) :: a -> (a -> b) -> b
- (=~) :: (RegexMaker Regex CompOption ExecOption source, RegexContext Regex source1 target) => source1 -> source -> target
- data ValidationException
- = ShouldBeFalse
- | ShouldBeTrue
- | ShouldNull
- | ShouldNotNull
- | InvalidSize Word64 Word64
- | InvalidPositive
- | InvalidPositiveOrZero
- | InvalidNegative
- | InvalidNegativeOrZero
- | InvalidMax Integer
- | InvalidMin Integer
- | InvalidEmail
- | InvalidNotBlank
- | InvalidNotEmpty
- | InvalidPast
- | InvalidFuture
- | InvalidPastOrPresent
- | InvalidFutureOrPresent
- | InvalidDecimalMax Scientific
- | InvalidDecimalMin Scientific
- | InvalidDigits Word8 Word8
- | InvalidPattern String
- class HasI18n a where
Documentation
class HasValidSize a Source #
Minimal complete definition
getLength
Instances
| HasValidSize Text Source # | |
| HasValidSize Text Source # | |
| HasValidSize [a] Source # | |
notEmpty :: HasValidSize a => Validator a Source #
notBlank :: HasValidSize a => Validator a Source #
assertNull :: Validator (Maybe a) Source #
(=~) :: (RegexMaker Regex CompOption ExecOption source, RegexContext Regex source1 target) => source1 -> source -> target #
This is the pure functional matching operator. If the target
cannot be produced then some empty result will be returned. If
there is an error in processing, then error will be called.
data ValidationException Source #
Constructors
Instances
| Show ValidationException Source # | |
Defined in Data.Menshen Methods showsPrec :: Int -> ValidationException -> ShowS # show :: ValidationException -> String # showList :: [ValidationException] -> ShowS # | |
| HasI18n ValidationException Source # | |
Defined in Data.Menshen Methods toI18n :: ValidationException -> String Source # | |