Module

Morello.Morello

Re-exports from Morello.Morello.Core

#Key

type Key r = Proxy r

#pick'

pick' :: forall s a err b. Proxy s -> AGetter' s a -> ValidateE a err b -> PickE s err b

#pick

pick :: forall s a err b. AGetter' s a -> ValidateE a err b -> PickE s err b

#key

key :: forall r. Key r

#dual

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

core :: forall f s a err b. Traversable f => AGetter' s (f a) -> ValidateE a err b -> PickE s err (f b)

#cherry

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))

#branch

branch :: forall input err. input -> Tuple input (ValidatedE err (Record ()))

#blossom

blossom :: forall input err output. Tuple input (ValidatedE err output) -> ValidatedE err output

#applyTemplate

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)

#(🍒)

Operator alias for Morello.Morello.Core.cherry (right-associative / precedence 8)

#(🌸)

Operator alias for Morello.Morello.Core.blossom (right-associative / precedence 8)

#(🌱)

Operator alias for Morello.Morello.Core.branch (right-associative / precedence 8)

#(|>)

Operator alias for Control.Semigroupoid.compose (right-associative / precedence 9)

Re-exports from Morello.Morello.Record

#HSequenceRec

data HSequenceRec (f :: Type -> Type)

Constructors

Instances

#HMapRec

data HMapRec a b

Constructors

Instances

#HMapKRec

data HMapKRec f g

Constructors

Instances

#hsequenceRec

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

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

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

#Validate

#Pick

type Pick input a = PickE input ValidationError a

Re-exports from Morello.Morello.Validated

#ValidatedE

type ValidatedE err r = V (NonEmptyArray err) r

#ValidateE

type ValidateE a err b = a -> ValidatedE err b

#valid

valid :: forall err r. r -> ValidatedE err r

#invalid

invalid :: forall err r. err -> ValidatedE err r

#asIs

asIs :: forall input err. ValidateE' input err

#as

as :: forall input err a. Newtype a input => (input -> a) -> ValidateE input err a

Modules