Question
Redefine adder using the function sequence :: [IO a] $\rightarrow$ IO (a) that performs a list of actions and returns a list of the resulting values.
Step 1
The adder function takes a list of numbers and returns their sum. ```haskell adder :: [Int] -> IO Int adder nums = do let actions = map printNum nums result <- sequence actions return (sum result) printNum :: Int -> IO Int printNum num = do putStrLn Show more…
Show all steps
Your feedback will help us improve your experience
Watch the video solution with this free unlock.
EMAIL
PASSWORD