Module

Morello.Morello

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

Re-exports from Data.Lens.Barlow

#Barlow Source

class Barlow :: Symbol -> (Type -> Type -> Type) -> Type -> Type -> Type -> Type -> Constraintclass Barlow (string :: Symbol) p s t a b | string -> s t a b where

Members

  • barlow :: Proxy string -> Optic p s t a b

    Type-safe lens for zooming into a deeply nested record

    sky = { zodiac: { virgo: { alpha: "Spica" } } }
    view (barlow (key :: _ "zodiac.virgo.alpha")) sky
    -- Spica 
    over (barlow (key :: _ "zodiac.virgo.alpha")) toUpper sky
    -- { zodiac: { virgo: { alpha: "SPICA" } } }
    

Instances

#key Source

key :: forall k. Proxy k

Just an alias for Proxy to make selection a bit nicer

Re-exports from Morello.Morello.Core

#pick' Source

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

#pick Source

pick :: forall (input :: Type) (err :: Type) (output :: Type) (chosen :: Type) (sym :: Symbol) (tlist :: TList). ParseSymbol sym tlist => ConstructBarlow tlist (Forget chosen) input input chosen chosen => Proxy sym -> (chosen -> V (NonEmptyArray err) output) -> PickE input err output

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

#core Source

core :: forall (f :: Type -> Type) (chosen :: Type) (input :: Type) (err :: Type) (output :: Type) (sym :: Symbol) (tlist :: TList). Traversable f => ParseSymbol sym tlist => ConstructBarlow tlist (Forget (f input)) chosen chosen (f input) (f input) => Proxy sym -> (input -> V (NonEmptyArray err) output) -> PickE chosen err (f output)

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