I'm having trouble mixing up pure and monadic functions inside of do notation. I've got the feeling I am missing something obvious.
For example, say I got these functions
fa :: a -> IO b
fb :: b -> c
fc :: c -> IO d
z :: a -> IO c
z a = do x <- fa a
y <- fb x
z <- fc y
return z
This doesn't work because of the
y <- fb x
line in z, but what is an elegant way of combining the pure fb function, with the monadic fa and fc functions?