If these are functions, ie pure, then you can use ($)
or "apply":
execute functions argument = map ($argument) functions
-- execute [id,(1+),(1-)] 12 => [12,13,-11]
There's no guarantee that this happens sequentially of course, but you'll get a list of the return values.
If these are actions, ie impure, then what you want is called sequence_
:
sequence_ [putStr "Hello", putStr " world", putStrLn "!"]
sequence_
is pretty easy to write yourself:
sequence_ [] = return ()
sequence_ (action:actions) = action >> sequence_ actions
There is also a sequence
(without the underscore) that runs a bunch of actions and returns their results:
main = do
ss <- sequence [readFile "foo.txt", readFile "bar.txt", readFile "baz.txt"]
-- or ss <- mapM readFile ["foo.txt", "bar.txt", "baz.txt"]