Module

Polyform.Reporter

Package
purescript-polyform
Repository
purescript-polyform/polyform

#Reporter Source

newtype Reporter m r i o

Constructors

Instances

#bimapReporter Source

bimapReporter :: forall i m o o' r r'. Monad m => (r -> r') -> (o -> o') -> Reporter m r i o -> Reporter m r' i o'

#hoist Source

hoist :: forall e i m m'. Functor m => (m ~> m') -> (Reporter m e i) ~> (Reporter m' e i)

#liftFn Source

liftFn :: forall e i m. Monad m => Monoid e => (Function i) ~> (Reporter m e i)

#liftFnEither Source

liftFnEither :: forall e i m o. Monad m => Monoid e => (i -> Either e o) -> Reporter m e i o

#liftFnMR Source

liftFnMR :: forall e i m o. (i -> m (R e o)) -> Reporter m e i o

#liftFnR Source

liftFnR :: forall e i m o. Monad m => Semigroup e => (i -> R e o) -> Reporter m e i o

#liftValidator Source

liftValidator :: forall e i m. Functor m => Monoid e => (Validator m e i) ~> (Reporter m e i)

Building Reporter from Validator with possibly empty failure report.

#liftValidatorWith Source

liftValidatorWith :: forall e i m o r. Functor m => (Tuple i e -> r) -> (Tuple i o -> r) -> Validator m e i o -> Reporter m r i o

Building Reporter from Validator by creating report from error and from value using also an input. We need only Functor m in this case.

#liftValidatorWithM Source

liftValidatorWithM :: forall e i m o r. Monad m => (Tuple i e -> m r) -> (Tuple i o -> m r) -> Validator m e i o -> Reporter m r i o

The same as above but in monadic context.

#lmapM Source

lmapM :: forall i m r r'. Monad m => (r -> m r') -> (Reporter m r i) ~> (Reporter m r' i)

#lmapReporter Source

lmapReporter :: forall i m o r r'. Monad m => (r -> r') -> Reporter m r i o -> Reporter m r' i o

#runReporter Source

runReporter :: forall i o m r. Reporter m r i o -> (i -> m (Tuple (Maybe o) r))

#R Source

type R r a = Tuple (Maybe a) r

#toValidator Source

toValidator :: forall e i m. Functor m => Monoid e => (Reporter m e i) ~> (Validator m e i)