
16 Jan
2009
16 Jan
'09
3:14 a.m.
On 16 Jan 2009, at 02:30, eyal.lotem@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