[{"name":"Task.Parallel","comment":" This library helps you run tasks in parallel when you only need the results\nif every task finishes successfully, similar to `Promise.all()` in Javascript. A\ngood use case is handling the result of multiple HTTP requests.\n\n\n## Task Helpers\n\n@docs attempt2, attempt3, attempt4, attempt5, attemptList\n\n\n## Less Common Helpers\n\n@docs attempt\n\n\n## Update\n\nYou will have to pass internal messages and commands along in your update\nfunction in order to eventually get your results.\n\n@docs update2, update3, update4, update5, updateList\n\n\n## Types\n\n@docs State2, State3, State4, State5, Msg2, Msg3, Msg4, Msg5, ListState, ListMsg\n\n","unions":[{"name":"ListMsg","comment":" Opaque type for updating state of task lists.\n","args":["x","a"],"cases":[]},{"name":"ListState","comment":" Opaque type for storing state of task lists.\n","args":["a"],"cases":[]},{"name":"Msg2","comment":" Opaque type for updating state of tasks.\n","args":["x","a","b"],"cases":[]},{"name":"Msg3","comment":" ","args":["x","a","b","c"],"cases":[]},{"name":"Msg4","comment":" ","args":["x","a","b","c","d"],"cases":[]},{"name":"Msg5","comment":" ","args":["x","a","b","c","d","e"],"cases":[]},{"name":"State2","comment":" Opaque type for storing state of tasks.\n","args":["a","b"],"cases":[]},{"name":"State3","comment":" ","args":["a","b","c"],"cases":[]},{"name":"State4","comment":" ","args":["a","b","c","d"],"cases":[]},{"name":"State5","comment":" ","args":["a","b","c","d","e"],"cases":[]}],"aliases":[],"values":[{"name":"attempt","comment":" Attempt a single task. The benefit of this over Task.attempt is that it\nhandles routing the result to the provided success and failure messages. You can\nreuse those error messages for different tasks if they're handled the same way.\nSince there are no other tasks, you don't need to manage any additional updates.\n\n    type Msg\n        = ErrorOcurred Http.Error\n        | FetchCompleted MyData\n\n    doTask : Cmd Msg\n    doTask =\n        attempt FetchCompleted ErrorOcurred fetchMyData\n\n","type":"(a -> msg) -> (x -> msg) -> Task.Task x a -> Platform.Cmd.Cmd msg"},{"name":"attempt2","comment":" Attempt two tasks which will send an update when either all tasks finish\nsuccessfully or one fails. The returned `State` will be used in your main\nupdate function to call [`update`](#update) and pass internal messages.\n\n    type Msg\n        = TaskStateUpdated (Task.Parallel.Msg2 Http.Error String Int)\n        | OneTaskFailed Http.Error\n        | AllTasksCompleted String Int\n\n    doTask : ( Task.Parallel.State2 String Int, Cmd Msg )\n    doTask =\n        attempt2\n            TaskStateUpdated\n            fetchString\n            fetchInt\n\n","type":"(Task.Parallel.Msg2 x a b -> msg) -> Task.Task x a -> Task.Task x b -> ( Task.Parallel.State2 a b, Platform.Cmd.Cmd msg )"},{"name":"attempt3","comment":" ","type":"(Task.Parallel.Msg3 x a b c -> msg) -> Task.Task x a -> Task.Task x b -> Task.Task x c -> ( Task.Parallel.State3 a b c, Platform.Cmd.Cmd msg )"},{"name":"attempt4","comment":" ","type":"(Task.Parallel.Msg4 x a b c d -> msg) -> Task.Task x a -> Task.Task x b -> Task.Task x c -> Task.Task x d -> ( Task.Parallel.State4 a b c d, Platform.Cmd.Cmd msg )"},{"name":"attempt5","comment":" ","type":"(Task.Parallel.Msg5 x a b c d e -> msg) -> Task.Task x a -> Task.Task x b -> Task.Task x c -> Task.Task x d -> Task.Task x e -> ( Task.Parallel.State5 a b c d e, Platform.Cmd.Cmd msg )"},{"name":"attemptList","comment":" Attempt a list of tasks which will update when all the tasks have finished\nor when one fails. Similar to a `Task.sequence` except in parallel.\n\n    type Msg\n        = DownloadUpdated (ListMsg Http.Error String)\n        | DownloadFailed Http.Error\n        | DownloadCompleted (List String)\n\n    fetchNames : ( ListState String, nextCmd )\n    fetchNames =\n        attemptList DownloadUpdated [ fetchFirstName, fetchSecondName, fetchThirdName ]\n\n","type":"(Task.Parallel.ListMsg x a -> msg) -> List.List (Task.Task x a) -> ( Task.Parallel.ListState a, Platform.Cmd.Cmd msg )"},{"name":"update2","comment":" Handle updates for two tasks by calling `update2` inside of your main update\nfunction to keep this library's internal state updated. If they have either all\nfinished successfully or one has failed, the corresponding message you provided\nwill be sent to your main `update` function. Maintain a copy of the returned\nstate to pass in on each subsequent `update`. This step is required with\n`attempt[n]` functions.\n\n    type Msg\n        = DownloadUpdated (Task.Parallel.Msg2 Http.Error Actor Film)\n        | DownloadFailed Http.Error\n        | DownloadCompleted Actor Film\n\n    update : Msg -> Model -> ( Model, Cmd Msg )\n    update msg model =\n        case msg of\n            DownloadUpdated taskMsg ->\n                let\n                    ( nextTaskState, nextCmd ) =\n                        Task.Parallel.update2 model.taskState taskMsg DownloadCompleted DownloadFailed\n                in\n                ( { model | taskState = nextTaskState }, nextCmd )\n\n            DownloadCompleted actor film ->\n                ( { model | actor = actor, film = film, Cmd.none )\n\n            DownloadFailed err ->\n                ( { model | loadingError = Just err }, Cmd.none )\n\n","type":"Task.Parallel.State2 a b -> Task.Parallel.Msg2 x a b -> (a -> b -> msg) -> (x -> msg) -> ( Task.Parallel.State2 a b, Platform.Cmd.Cmd msg )"},{"name":"update3","comment":" ","type":"Task.Parallel.State3 a b c -> Task.Parallel.Msg3 x a b c -> (a -> b -> c -> msg) -> (x -> msg) -> ( Task.Parallel.State3 a b c, Platform.Cmd.Cmd msg )"},{"name":"update4","comment":" ","type":"Task.Parallel.State4 a b c d -> Task.Parallel.Msg4 x a b c d -> (a -> b -> c -> d -> msg) -> (x -> msg) -> ( Task.Parallel.State4 a b c d, Platform.Cmd.Cmd msg )"},{"name":"update5","comment":" ","type":"Task.Parallel.State5 a b c d e -> Task.Parallel.Msg5 x a b c d e -> (a -> b -> c -> d -> e -> msg) -> (x -> msg) -> ( Task.Parallel.State5 a b c d e, Platform.Cmd.Cmd msg )"},{"name":"updateList","comment":" Call `updateList` inside of your main update function to check if the\ntasks have failed or finished. Maintain a copy of the returned state to pass in\non each subsequent `updateList`. This step is required with\n[`attemptList`](#attemptList).\n\n    type Msg\n        = DownloadUpdated (Task.Parallel.ListMsg Actor Http.Error)\n        | DownloadFailed Http.Error\n        | DownloadCompleted (List Actor)\n\n    update : Msg -> Model -> ( Model, Cmd Msg )\n    update msg model =\n        case msg of\n            DownloadUpdated taskMsg ->\n                let\n                    ( nextTaskState, nextCmd ) =\n                        Task.Parallel.updateList model.taskState taskMsg DownloadCompleted DownloadFailed\n                in\n                ( { model | taskState = nextTaskState }, nextCmd )\n\n            DownloadCompleted actors ->\n                ( { model | actorList = actors, Cmd.none )\n\n            DownloadFailed err ->\n                ( { model | loadingError = Just err }, Cmd.none )\n\n","type":"Task.Parallel.ListState a -> Task.Parallel.ListMsg x a -> (List.List a -> msg) -> (x -> msg) -> ( Task.Parallel.ListState a, Platform.Cmd.Cmd msg )"}],"binops":[]}]