I wrote some monadic code using a reader monad and I wonder if there is any way to write using the do-notation:
m = Map.fromList [("This","is"), ("is","the"), ("the","secret")]
f x m = fromMaybe "default" $ Map.lookup x m
r :: String -> Reader (Map String String) String)
r x = reader $ \m1 -> f x m1
runReader ((r "This") >>= r >>= r) m
-- "secret"
Now how would you write the last statement in do notation.
I have a feeling all the "expanded monads" using runX
functions don't really lend to do-notation.