Module
Record.Studio.Sequence
- Package
- purescript-record-studio
- Repository
- rowtype-yoga/purescript-record-studio
#SequenceRecord Source
data SequenceRecord :: (Type -> Type) -> Type
data SequenceRecord (f :: Type -> Type)
Constructors
Instances
(Applicative f, IsSymbol sym, Lacks sym rb, Cons sym a rb rc) => FoldingWithIndex (SequenceRecord 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 (SequenceRecord f) (f (Builder (Record ()) (Record ()))) xRL x (f (Builder (Record ()) (Record y)))) => FoldingWithIndex (SequenceRecord 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 (SequenceRecord f) (Proxy sym) (f (Builder (Record ra) (Record rb))) x (f (Builder (Record ra) (Record rc)))
#sequenceRecord Source
sequenceRecord :: forall f rin rout. Applicative f => HFoldlWithIndex (SequenceRecord f) (f (Builder (Record ()) (Record ()))) (Record rin) (f (Builder (Record ()) (Record rout))) => Record rin -> f (Record rout)
Recursively sequence a record. E.g.
sequenceRecord { a : { b : { c : { d: Just 10, e : Just "hello" }, f : Just true }
-- Just { a : { b : { c : { d: 10, e : "hello" }, f : true }