Module

Morello.Morello

Package
purescript-morello
Repository
sigma-andex/purescript-morello

Re-exports from Morello.Morello.Core

#Key Source

type Key r = Proxy r

#pick' Source

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

#pick Source

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

#key Source

key :: forall r. Key r

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

#branch Source

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

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

#(🍒) Source

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

#(🌸) Source

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

#(🌱) Source

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

#(|>) Source

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

Re-exports from Morello.Morello.Record

#HSequenceRec Source

data HSequenceRec (f :: Type -> Type)

Constructors

Instances

#HMapRec Source

data HMapRec a b

Constructors

Instances

#HMapKRec Source

data HMapKRec f g

Constructors

Instances

#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

#Validate Source

#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

#as Source

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