valid-0.1.1.0: Type isomorphic to `Either` with `Applicative` instance which combines errors

Safe HaskellNone
LanguageHaskell2010

Data.Valid

Documentation

data Valid e a Source #

Constructors

Failure e 
Valid a 
Instances
Bitraversable Valid Source # 
Instance details

Defined in Data.Valid

Methods

bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Valid a b -> f (Valid c d) #

Bifoldable Valid Source # 
Instance details

Defined in Data.Valid

Methods

bifold :: Monoid m => Valid m m -> m #

bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> Valid a b -> m #

bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> Valid a b -> c #

bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> Valid a b -> c #

Bifunctor Valid Source # 
Instance details

Defined in Data.Valid

Methods

bimap :: (a -> b) -> (c -> d) -> Valid a c -> Valid b d #

first :: (a -> b) -> Valid a c -> Valid b c #

second :: (b -> c) -> Valid a b -> Valid a c #

Eq2 Valid Source # 
Instance details

Defined in Data.Valid

Methods

liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> Valid a c -> Valid b d -> Bool #

Functor (Valid e) Source # 
Instance details

Defined in Data.Valid

Methods

fmap :: (a -> b) -> Valid e a -> Valid e b #

(<$) :: a -> Valid e b -> Valid e a #

Semigroup e => Applicative (Valid e) Source # 
Instance details

Defined in Data.Valid

Methods

pure :: a -> Valid e a #

(<*>) :: Valid e (a -> b) -> Valid e a -> Valid e b #

liftA2 :: (a -> b -> c) -> Valid e a -> Valid e b -> Valid e c #

(*>) :: Valid e a -> Valid e b -> Valid e b #

(<*) :: Valid e a -> Valid e b -> Valid e a #

Foldable (Valid e) Source # 
Instance details

Defined in Data.Valid

Methods

fold :: Monoid m => Valid e m -> m #

foldMap :: Monoid m => (a -> m) -> Valid e a -> m #

foldr :: (a -> b -> b) -> b -> Valid e a -> b #

foldr' :: (a -> b -> b) -> b -> Valid e a -> b #

foldl :: (b -> a -> b) -> b -> Valid e a -> b #

foldl' :: (b -> a -> b) -> b -> Valid e a -> b #

foldr1 :: (a -> a -> a) -> Valid e a -> a #

foldl1 :: (a -> a -> a) -> Valid e a -> a #

toList :: Valid e a -> [a] #

null :: Valid e a -> Bool #

length :: Valid e a -> Int #

elem :: Eq a => a -> Valid e a -> Bool #

maximum :: Ord a => Valid e a -> a #

minimum :: Ord a => Valid e a -> a #

sum :: Num a => Valid e a -> a #

product :: Num a => Valid e a -> a #

Traversable (Valid e) Source # 
Instance details

Defined in Data.Valid

Methods

traverse :: Applicative f => (a -> f b) -> Valid e a -> f (Valid e b) #

sequenceA :: Applicative f => Valid e (f a) -> f (Valid e a) #

mapM :: Monad m => (a -> m b) -> Valid e a -> m (Valid e b) #

sequence :: Monad m => Valid e (m a) -> m (Valid e a) #

(Eq e, Eq a) => Eq (Valid e a) Source # 
Instance details

Defined in Data.Valid

Methods

(==) :: Valid e a -> Valid e a -> Bool #

(/=) :: Valid e a -> Valid e a -> Bool #

(Read e, Read a) => Read (Valid e a) Source # 
Instance details

Defined in Data.Valid

(Show e, Show a) => Show (Valid e a) Source # 
Instance details

Defined in Data.Valid

Methods

showsPrec :: Int -> Valid e a -> ShowS #

show :: Valid e a -> String #

showList :: [Valid e a] -> ShowS #

toEither :: Valid e a -> Either e a Source #