alex-tan/task-extra/1.1.0

Task.Extra

Task.Extra

Functions provided by this module execute Tasks in sequence one after another.

(a -> b -> c -> d -> e -> f -> result)
-> Task x a
-> Task x b
-> Task x c
-> Task x d
-> Task x e
-> Task x f
-> Task x result

Put the results of six tasks together.

(a -> b -> c -> d -> e -> f -> g -> result)
-> Task x a
-> Task x b
-> Task x c
-> Task x d
-> Task x e
-> Task x f
-> Task x g
-> Task x result

Put the results of seven tasks together.

(a -> b -> c -> d -> e -> f -> g -> h -> result)
-> Task x a
-> Task x b
-> Task x c
-> Task x d
-> Task x e
-> Task x f
-> Task x g
-> Task x h
-> Task x result

Put the results of eight tasks together.

(a -> b -> c -> d -> e -> f -> g -> h -> i -> result)
-> Task x a
-> Task x b
-> Task x c
-> Task x d
-> Task x e
-> Task x f
-> Task x g
-> Task x h
-> Task x i
-> Task x result

Put the results of nine tasks together.

(a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> result)
-> Task x a
-> Task x b
-> Task x c
-> Task x d
-> Task x e
-> Task x f
-> Task x g
-> Task x h
-> Task x i
-> Task x j
-> Task x result

Put the results of 10 tasks together.

(a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k -> result)
-> Task x a
-> Task x b
-> Task x c
-> Task x d
-> Task x e
-> Task x f
-> Task x g
-> Task x h
-> Task x i
-> Task x j
-> Task x k
-> Task x result

Put the results of 11 tasks together.

(a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k -> l -> result)
-> Task x a
-> Task x b
-> Task x c
-> Task x d
-> Task x e
-> Task x f
-> Task x g
-> Task x h
-> Task x i
-> Task x j
-> Task x k
-> Task x l
-> Task x result

Put the results of 12 tasks together.

(a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k -> l -> m -> result)
-> Task x a
-> Task x b
-> Task x c
-> Task x d
-> Task x e
-> Task x f
-> Task x g
-> Task x h
-> Task x i
-> Task x j
-> Task x k
-> Task x l
-> Task x m
-> Task x result

Put the results of 13 tasks together.

(a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k -> l -> m -> n -> result)
-> Task x a
-> Task x b
-> Task x c
-> Task x d
-> Task x e
-> Task x f
-> Task x g
-> Task x h
-> Task x i
-> Task x j
-> Task x k
-> Task x l
-> Task x m
-> Task x n
-> Task x result

Put the results of 14 tasks together.

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

Combine any number of tasks.

type alias User =
    { name : String
    , age : Int
    , bio : String
    }


Task.succeed User
    |> andMap (Task.succeed "Jane Doe")
    |> andMap (Task.succeed 34)
    |> andMap (Task.succeed "Lorem Ipsum")