I am trying to get my head around the list monad when there is no function specified:
func::[(Int,String)]
func =do
a <- [1,2,3]
b <- ["a","b"]
return (a,b)
I understood that (>>=) ml f=concat (map f ml)
.Well in our case what is the value of f
?
When i say :
a<-[1,2,3]
does this get translated to [1,2,3]>>=(\x->return x)
.
If not why does it not crash since i am not providing any function for the bind operator?
Later Edit
Thanks for your responses , and while i understood what happens with multiple >>=
i am more concerned in this simple scenario:
mym =do
a<-[1,2,3]
return a
What is the equivalent ? [1,2,3] >>= (\x -> return x)