Module
Record.ExtraSrghma.ParSequenceRecord
- Package
- purescript-record-extra-srghma
- Repository
- srghma/purescript-record-extra-srghma
#parSequenceRecord Source
parSequenceRecord :: forall inputRow outputRow rowList parM m. RowToList inputRow rowList => ParSequenceRecord rowList inputRow () outputRow parM m => Record inputRow -> m (Record outputRow)
Sequences a record of monadic values in parallel, returning a monadic record of values.
For example, turns { a: Aff Int, b: Aff String }
into Aff { a: Int, b: String }
by running all the monadic values in parallel.
#ParSequenceRecord Source
class ParSequenceRecord :: forall k. k -> Row Type -> Row Type -> Row Type -> (Type -> Type) -> (Type -> Type) -> Constraint
class (Parallel parM m) <= ParSequenceRecord rowList inputRow accRow resultRow parM m | rowList -> inputRow accRow resultRow parM m where
Class for sequencing a record of monadic values in parallel
Members
parSequenceRecordImpl :: Record inputRow -> parM (Builder (Record accRow) (Record resultRow))
Instances
(IsSymbol fieldName, Cons fieldName (m fieldType) remainingFields inputRow, Parallel parM m, Lacks fieldName (), Cons fieldName fieldType () resultRow) => ParSequenceRecord (Cons fieldName (m fieldType) Nil) inputRow () resultRow parM m
(IsSymbol fieldName, Cons fieldName (m fieldType) remainingFields inputRow, ParSequenceRecord tailList inputRow accRow intermediateRow parM m, Lacks fieldName intermediateRow, Cons fieldName fieldType intermediateRow resultRow) => ParSequenceRecord (Cons fieldName (m fieldType) tailList) inputRow accRow resultRow parM m
(Parallel parM m, Applicative parM) => ParSequenceRecord Nil inputRow () () parM m
Base case: Empty record
- Modules
- Record.
ExtraSrghma - Record.
ExtraSrghma. AppendRecord - Record.
ExtraSrghma. CompareRecord - Record.
ExtraSrghma. FoldlValues - Record.
ExtraSrghma. FoldlValuesWithIndex - Record.
ExtraSrghma. FoldrValues - Record.
ExtraSrghma. FoldrValuesLazy - Record.
ExtraSrghma. FoldrValuesWithIndex - Record.
ExtraSrghma. Keys. Array - Record.
ExtraSrghma. Keys. List - Record.
ExtraSrghma. Keys. NonEmptyArray - Record.
ExtraSrghma. Keys. NonEmptyList - Record.
ExtraSrghma. Keys. Pick - Record.
ExtraSrghma. MapIndex - Record.
ExtraSrghma. MapRecord - Record.
ExtraSrghma. MapValuesWithIndex - Record.
ExtraSrghma. ParSequenceRecord - Record.
ExtraSrghma. SList. Array - Record.
ExtraSrghma. SList. List - Record.
ExtraSrghma. SList. Types - Record.
ExtraSrghma. SequenceRecord - Record.
ExtraSrghma. TraverseRecord - Record.
ExtraSrghma. ValuesToUnfoldableLazy - Record.
ExtraSrghma. ZipRecord
Base case: When there's only one field left in the record