Open sebastian-philipp opened 10 years ago
Then we can make StringMap an instance of Monad with
return v = singleton "" v
I don't think using an empty string as default is a good idea. Anyway, I don't think it's worth the effort
ghci Data.Functor.Bind Data.Map> fromList [("foo",5), ("bar",1)] >>- (\x -> fromList [("foo", x + 1), ("bar", x - 1), ("baz", x * 2)])
fromList [("bar",0),("foo",6)]
Bind
(Bindable Functor) is a Monad withoutreturn