data-validation-0.1.2.5: A library for creating type safe validations.

Safe HaskellSafe
LanguageHaskell2010

Data.Validation.Internal

Synopsis

Documentation

data VCtx f a Source #

A type that holds aggregated validation failures.

Constructors

ValidCtx a

A value that is assumed to be valid.

DisputedCtx [f] (Map [Name] [f]) a

A value that has failures but can continue to be validated.

RefutedCtx [f] (Map [Name] [f])

A value that has failures and cannot be validated further.

Instances
Monad (VCtx f) Source # 
Instance details

Defined in Data.Validation.Internal

Methods

(>>=) :: VCtx f a -> (a -> VCtx f b) -> VCtx f b #

(>>) :: VCtx f a -> VCtx f b -> VCtx f b #

return :: a -> VCtx f a #

fail :: String -> VCtx f a #

Functor (VCtx f) Source # 
Instance details

Defined in Data.Validation.Internal

Methods

fmap :: (a -> b) -> VCtx f a -> VCtx f b #

(<$) :: a -> VCtx f b -> VCtx f a #

Applicative (VCtx f) Source # 
Instance details

Defined in Data.Validation.Internal

Methods

pure :: a -> VCtx f a #

(<*>) :: VCtx f (a -> b) -> VCtx f a -> VCtx f b #

liftA2 :: (a -> b -> c) -> VCtx f a -> VCtx f b -> VCtx f c #

(*>) :: VCtx f a -> VCtx f b -> VCtx f b #

(<*) :: VCtx f a -> VCtx f b -> VCtx f a #

(Eq a, Eq f) => Eq (VCtx f a) Source # 
Instance details

Defined in Data.Validation.Internal

Methods

(==) :: VCtx f a -> VCtx f a -> Bool #

(/=) :: VCtx f a -> VCtx f a -> Bool #

(Show a, Show f) => Show (VCtx f a) Source # 
Instance details

Defined in Data.Validation.Internal

Methods

showsPrec :: Int -> VCtx f a -> ShowS #

show :: VCtx f a -> String #

showList :: [VCtx f a] -> ShowS #

Semigroup a => Semigroup (VCtx f a) Source # 
Instance details

Defined in Data.Validation.Internal

Methods

(<>) :: VCtx f a -> VCtx f a -> VCtx f a #

sconcat :: NonEmpty (VCtx f a) -> VCtx f a #

stimes :: Integral b => b -> VCtx f a -> VCtx f a #

Monoid a => Monoid (VCtx f a) Source # 
Instance details

Defined in Data.Validation.Internal

Methods

mempty :: VCtx f a #

mappend :: VCtx f a -> VCtx f a -> VCtx f a #

mconcat :: [VCtx f a] -> VCtx f a #

aggregateFailures :: VCtx f a -> VCtx f b -> VCtx f a Source #

Takes the failures from the second parameter and adds them to the first.

(<!) :: VCtx f a -> VCtx f b -> VCtx f a Source #

Takes the failures from the right-hand-side, if any, and adds them to the left-hand-side.

testMatch :: Eq a => f -> a -> a -> Maybe f Source #