July 2023
Intermediate to advanced
670 pages
17h 13m
English
Write a function that returns a value of type IO (IO String). What happens if you try to use >>= with that? What if you want to print the string?
Using your function from the previous example, create a function that has the type signature: IO (IO a) -> IO a.
Write a function that returns a value of type [IO a], and a second function with the type [IO a] -> IO [a]. When might you use a function like that?
Write a program that reads in numbers from the command line and prints the sum of the provided values.
Modify your previous program so that the first argument is an operation (+, -, or *) and performs the supplied operation on the list of numbers.