Module
Morello.Morello.Record
- Package
- purescript-morello
- Repository
- sigma-andex/purescript-morello
#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)))
#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
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))
#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
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))
#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 }