I have the following sample code
let x = [return 1::IO(Int), return 2::IO(Int)]
So x is a list of IO(Int)s.
maximum is a function which returns the maximum of a list, if the things in the list are Ords.
How do I “map” maximum to run on this list of IO(Int)s?
First
sequencethe array intoIO [Int]and then runmaximumon it usingliftM: