Module
Morello.Morello
- Package
- purescript-morello
- Repository
- sigma-andex/purescript-morello
Re-exports from Morello.Morello.Core
#dual Source
dual :: forall input err from to' to. Union from to' to => (input -> ValidatedE err (Record to')) -> Tuple input (ValidatedE err (Record from)) -> Tuple input (ValidatedE err (Record to))
#core Source
core :: forall f s a err b. Traversable f => AGetter' s (f a) -> ValidateE a err b -> PickE s err (f b)
#cherry Source
cherry :: forall input err from to rin rinRL rthru rthruRL rout routRL. RowToList rin rinRL => RowToList rthru rthruRL => RowToList rout routRL => FoldlRecord (HMapKRec (PickE input err) (V (NonEmptyArray err))) (Builder (Record ()) (Record ())) rinRL rin (Builder (Record ()) (Record rthru)) => FoldlRecord (HSequenceRec (V (NonEmptyArray err))) (V (NonEmptyArray err) (Builder (Record ()) (Record ()))) rthruRL rthru (V (NonEmptyArray err) (Builder (Record ()) (Record rout))) => Union from rout to => Record rin -> Tuple input (ValidatedE err (Record from)) -> Tuple input (ValidatedE err (Record to))
#blossom Source
blossom :: forall input err output. Tuple input (ValidatedE err output) -> ValidatedE err output
#applyTemplate Source
applyTemplate :: forall input err rin rinRL rthru rthruRL rout routRL. RowToList rin rinRL => RowToList rthru rthruRL => RowToList rout routRL => FoldlRecord (HMapKRec (PickE input err) (V (NonEmptyArray err))) (Builder (Record ()) (Record ())) rinRL rin (Builder (Record ()) (Record rthru)) => FoldlRecord (HSequenceRec (V (NonEmptyArray err))) (V (NonEmptyArray err) (Builder (Record ()) (Record ()))) rthruRL rthru (V (NonEmptyArray err) (Builder (Record ()) (Record rout))) => ((PickE input err) ~> (ValidatedE err)) -> Record rin -> ValidatedE err (Record rout)
Re-exports from Morello.Morello.Record
#HSequenceRec Source
data HSequenceRec (f :: Type -> Type)
Constructors
Instances
(Applicative f, IsSymbol sym, Lacks sym rb, Cons sym a rb rc) => FoldingWithIndex (HSequenceRec f) (Proxy sym) (f (Builder (Record ra) (Record rb))) (f a) (f (Builder (Record ra) (Record rc)))
(Applicative f, IsSymbol sym, Lacks sym rb, RowToList x xRL, Cons sym (Record y) rb rc, FoldlRecord (HSequenceRec f) (f (Builder (Record ()) (Record ()))) xRL x (f (Builder (Record ()) (Record y)))) => FoldingWithIndex (HSequenceRec f) (Proxy sym) (f (Builder (Record ra) (Record rb))) (Record x) (f (Builder (Record ra) (Record rc)))
(Applicative f, IsSymbol sym, Lacks sym rb, Cons sym x rb rc) => FoldingWithIndex (HSequenceRec f) (Proxy sym) (f (Builder (Record ra) (Record rb))) x (f (Builder (Record ra) (Record rc)))
#HMapRec Source
data HMapRec a b
Constructors
HMapRec (a -> b)
Instances
(IsSymbol sym, Lacks sym rb, Cons sym b rb rc) => FoldingWithIndex (HMapRec a b) (Proxy sym) (Builder (Record ra) (Record rb)) a (Builder (Record ra) (Record rc))
(IsSymbol sym, Lacks sym rb, RowToList x xRL, Cons sym (Record y) rb rc, FoldlRecord (HMapRec a b) (Builder (Record ()) (Record ())) xRL x (Builder (Record ()) (Record y))) => FoldingWithIndex (HMapRec a b) (Proxy sym) (Builder (Record ra) (Record rb)) (Record x) (Builder (Record ra) (Record rc))
(IsSymbol sym, Lacks sym rb, Cons sym x rb rc) => FoldingWithIndex (HMapRec a b) (Proxy sym) (Builder (Record ra) (Record rb)) x (Builder (Record ra) (Record rc))
#HMapKRec Source
data HMapKRec f g
Constructors
Instances
(IsSymbol sym, Lacks sym rb, Cons sym (g a) rb rc) => FoldingWithIndex (HMapKRec f g) (Proxy sym) (Builder (Record ra) (Record rb)) (f a) (Builder (Record ra) (Record rc))
(IsSymbol sym, Lacks sym rb, RowToList x xRL, Cons sym (Record y) rb rc, FoldlRecord (HMapKRec f g) (Builder (Record ()) (Record ())) xRL x (Builder (Record ()) (Record y))) => FoldingWithIndex (HMapKRec f g) (Proxy sym) (Builder (Record ra) (Record rb)) (Record x) (Builder (Record ra) (Record rc))
(IsSymbol sym, Lacks sym rb, Cons sym x rb rc) => FoldingWithIndex (HMapKRec f g) (Proxy sym) (Builder (Record ra) (Record rb)) x (Builder (Record ra) (Record rc))
#hsequenceRec Source
hsequenceRec :: forall f rin rout. Applicative f => HFoldlWithIndex (HSequenceRec f) (f (Builder (Record ()) (Record ()))) (Record rin) (f (Builder (Record ()) (Record rout))) => Record rin -> f (Record rout)
Recursively sequence a record. E.g. hsequenceRec { a : { b : { c : { d: Just 10, e : Just "hello" }, f : Just true } == Just { a : { b : { c : { d: 10, e : "hello" }, f : true }
#hmapRec Source
hmapRec :: forall a b rin rout. HFoldlWithIndex (HMapRec a b) (Builder (Record ()) (Record ())) (Record rin) (Builder (Record ()) (Record rout)) => (a -> b) -> Record rin -> Record rout
Recursively maps a record using a function f. E.g. let f :: Int -> String f i = show (i + 1) hmapRec f { a : { b : 10, c : { d: 20, e : Just "hello" }}, f : 30 } == { a : { b : "11", c : { d: "21", e : Just "hello" }, f : "31" }
#hmapKRec Source
hmapKRec :: forall f g rin rout. HFoldlWithIndex (HMapKRec f g) (Builder (Record ()) (Record ())) (Record rin) (Builder (Record ()) (Record rout)) => (f ~> g) -> Record rin -> Record rout
Recursively mapK a record using a natural transformation. E.g. let nt :: Either String ~> Maybe nt = hush hmapKRec { a : { b : { c : { d: Right 10, e : Left "hello" }, f : Right true } == Just { a : { b : { c : { d: Just 10, e : Nothing }, f : Just true }
Re-exports from Morello.Morello.Simple
#ValidationError Source
#Validated Source
type Validated r = ValidatedE ValidationError r
#Validate Source
type Validate a b = ValidateE a ValidationError b
#Pick Source
type Pick input a = PickE input ValidationError a
Re-exports from Morello.Morello.Validated
#ValidatedE Source
type ValidatedE err r = V (NonEmptyArray err) r
#ValidateE Source
type ValidateE a err b = a -> ValidatedE err b
#valid Source
valid :: forall err r. r -> ValidatedE err r
#invalid Source
invalid :: forall err r. err -> ValidatedE err r
#asIs Source
asIs :: forall input err. ValidateE' input err