On 16 Jan 2009, at 02:30, eyal.lo...@gmail.com wrote:

Very nice series of refactorings!

I'd like to add that it might be a better argument order to replace:

JSON a => MyData -> String -> a -> MyData

with:

JSON a => String -> a -> MyData -> MyData

Just so you can get a (MyData -> MyData) transformer, which is often
useful.

Following up on this idea:
add m k v = fromJust . fmap (setJSON m . showJSON . toJSObject . ((k, showJSON v):) . fromJSObject) . jsObj . json $ m

can now become:
add k v = fromJust . fmap (setJSON m . showJSON . toJSObject . ((k, showJSON v):) . fromJSObject) . jsObj . json

if you switch the type around like that, and then it truely does become obvious that this is a (MyData -> MyData) transformer.

Bob
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to