obiloud/task-extra-concurrent/1.0.0

Task.Extra

Applicative

andMap : Task x a -> Task x (a -> b) -> Task x b

Applicative task

Utils

toCmd : msg -> Cmd msg

Convert message to Cmd

Concurrent

definitions

type Concurrent e a msg
= Concurrent
(Result (List e) (List a) -> msg)
(List (Maybe (Result e a)))

Opaque type to hold state of running tasks

type Join e a

Opaque type to hold idividual result for joining

Concurrent utilities

(Join e a -> msg)
-> (Result (List e) (List a) -> msg)
-> List (Task e a)
-> ( Concurrent e a msg, Cmd msg )

Start execution of concurrent tasks and return inital state

join : Join e a -> Concurrent e a msg -> ( Concurrent e a msg, Cmd msg )

Accumulate returned results and produce Cmd