obiloud / task-extra-concurrent / Task.Extra

Applicative

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

Applicative task

Utils

toCmd : msg -> Platform.Cmd.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

concurrent : (Join e a -> msg) -> (Result (List e) (List a) -> msg) -> List (Task e a) -> ( Concurrent e a msg, Platform.Cmd.Cmd msg )

Start execution of concurrent tasks and return inital state

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

Accumulate returned results and produce Cmd