Module
Data.Validation.Jaws.Product
- Package
- purescript-jaws
- Repository
- paluh/purescript-jaws
#Builder Source
newtype Builder m tok a b
This is really general type which is specialized below.
I'm thinking of it here as a builder which extracts/validates
product elements from given tok
, "attaching" them to
results from previous validation steps a
.
It is really close to categorical view of product - if we want to
treat input data tok
as product we have to be able to provide
morphisms which extract elements of this product from it.
Constructors
Builder (tok -> a -> m b)
Instances
(Functor m) => Functor (Builder m tok a)
(Monad m) => Apply (Builder m tok a)
(Monad m) => Applicative (Builder m tok a)
(Monad m) => Bind (Builder m tok a)
(Monad m) => Category (Builder m tok)
(Bind m) => Semigroupoid (Builder m tok)
(Monad m) => Profunctor (Builder m tok)
(Monad m) => Choice (Builder m tok)
(Monad m) => Strong (Builder m a)
#ProductValidation Source
type ProductValidation m tok i i' v v' = Builder m tok (Result i v) (Result i' v')
#tupleValidation Source
tupleValidation :: forall v tok m i e b. Monad m => (tok -> m (Either e b)) -> ProductValidation m tok i (Tuple (Either e b) i) v (Tuple b v)
#pureTupleValidation Source
pureTupleValidation :: forall v tok m i e b. Monad m => (tok -> Either e b) -> ProductValidation m tok i (Tuple (Either e b) i) v (Tuple b v)
#runTupleValidation Source
runTupleValidation :: forall v tok m i. Monad m => ProductValidation m tok Unit i Unit v -> (tok -> m (Either i v))
This is just a Reader over
Tuple tok a