menshen-0.0.0: Data Validation

Safe HaskellNone
LanguageHaskell2010

Data.Menshen

Synopsis

Documentation

class Monad m => HasValid m where Source #

Minimal complete definition

Nothing

Methods

invalid :: HasI18n a => a -> m b Source #

Instances
HasValid IO Source # 
Instance details

Defined in Data.Menshen

Methods

invalid :: HasI18n a => a -> IO b Source #

HasValid (Either String) Source # 
Instance details

Defined in Data.Menshen

Methods

invalid :: HasI18n a => a -> Either String b Source #

type Validator a = forall m. HasValid m => m a -> m a Source #

class HasValidSize a Source #

Minimal complete definition

getLength

positive :: (Eq a, Num a) => Validator a Source #

negative :: (Eq a, Num a) => Validator a Source #

minInt :: (Ord a, Integral a) => a -> Validator a Source #

maxInt :: (Ord a, Integral a) => a -> Validator a Source #

(&) :: a -> (a -> b) -> b infixl 1 #

& is a reverse application operator. This provides notational convenience. Its precedence is one higher than that of the forward application operator $, which allows & to be nested in $.

>>> 5 & (+1) & show
"6"

Since: base-4.8.0.0

(=~) :: (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.

class HasI18n a where Source #

Methods

toI18n :: a -> String Source #

Instances
HasI18n ValidationException Source # 
Instance details

Defined in Data.Menshen