mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-01-26 00:18:26 +00:00
19 lines
408 B
Elm
19 lines
408 B
Elm
module Util.Update exposing (andThen1)
|
|
|
|
|
|
andThen1 : List (a -> ( a, Cmd b )) -> a -> ( a, Cmd b )
|
|
andThen1 fs a =
|
|
let
|
|
init =
|
|
( a, [] )
|
|
|
|
update el tuple =
|
|
let
|
|
( a2, c2 ) =
|
|
el (Tuple.first tuple)
|
|
in
|
|
( a2, c2 :: Tuple.second tuple )
|
|
in
|
|
List.foldl update init fs
|
|
|> Tuple.mapSecond Cmd.batch
|