
16 Apr
2008
16 Apr
'08
8:56 a.m.
When I load the State module in Hugs, then I can define the function f below, but I do not immediately see exactly what function "return" returns. Explanation welcome. For example:
f [2..4] [6..9] [6,7,8,9,6,7,8,9,6,7,8,9] That is, it just repeats the second argument as many times as the length of the second argument.
Hans Aberg -------- import Control.Monad.State f :: Monad a => a b -> a c -> a c f x y = x >>= (return y) --------