In short, yes. To prove this:
You wrote:
xss >>= (\xs -> xs >>= \x -> return x) xss >>= (\xs -> xs >>= return) -- eta
in the first and
xss >>= (\xs -> xs) xss >>= id
according to the laws of the monad , return is the correct identity, so that
m >>= return === m
so we can do
xss >>= (\ xs -> xs >>= return ) xss >>= (\ xs -> xs ) xss >>= id
source share