
27 Sep
2010
27 Sep
'10
11:18 p.m.
On Mon, Sep 27, 2010 at 7:47 PM, Thomas DuBuisson
translating this to Functor:
adjustF f k m == case lookup k m of Just x -> fmap (\new -> insert k new m) (f x) Nothing -> ??? -- perhaps "pure m" thus adding another
Hmmm, true. With the currenty hierachy, we could have adjustA using Applicative constraint, although a pointed functor is enough.
constraint, but how would that be better than Monad for most people?
Having the most general type allows the function to be used in more places. For example, in an Applicative parser. All Monads are Applicative, so adjustA is at least as good as adjustM. Cheers, =) -- Felipe.