
9 Feb
2016
9 Feb
'16
8:26 a.m.
On 02/09/2016 06:27 AM, Kosyrev Serge wrote:
Case in point (only slightly contrived) -- which one is easier to visually parse to you:
foo (thInt $ fromIntegral $ c2hsValueInt cexp) (thInt $ fromIntegral $ c2hsValueInt cexp)
foo (thInt (fromIntegral (c2hsValueInt cexp))) (thInt (fromIntegral (c2hsValueInt cexp)))
Me, I get a blood pressure spike roughy here ---^
let th_exp = (thInt . fromIntegral . c2hsValueInt) cexp foo th_exp th_exp The parentheses are a warning sign, and using "$" above only lets you make it look cleaner without fixing the problem. It has hidden the fact that you're computing f(g(h(x))) twice, and there's a better way to do that.