Now there might be something in the Haskell Libraries to do what I want. I'm enough of a noob to not know any better and I'm trying to write a custom map function using the tools that I know. The type signature needs to be
myMap :: (Monad m) => (a -> b) -> [m a] -> [m b]
where myMap f as returns a list after applying f to each of the value in each Monad in as.
My first attempt was
myMap f = map (\x x >>= f)
However, this has a type signature of
myMap :: (Monad m) => (a -> m b) -> [m a] -> [m b]
This is so close to what I need, I can scream. Now I need some tips of how to continue from here. I really hope it is as easy as a library function, but I'm willing to write my own short function to do this instead.
Related Question: