5 ms·
It's funny to see Haskell and TDD mentioned without QuickCheck http://www.haskell.org/haskellwiki/Introduction_to_QuickCheck http://www.haskell.org/haskellwiki/
by mgreenbe 17y ago
It's funny to see Haskell and TDD mentioned without QuickCheck http://www.haskell.org/haskellwiki/Introduction_to_QuickCheck http://www.haskell.org/haskellwiki/Introduction_to_QuickChec....
But, yes: referential transparency and functional (rather than sequential) composition make for a different refactoring model, one where eta expansion/contraction is the norm.
He does leave out the opportunity for more fluid refactorings: the lenPreviousLines function could be refactored in a more conventional way (changing the foldr of ((+).length) to a sum---which is a foldl---of a map, for example).
- michaelfeathers 17y agoI use QuickCheck, but it wasn't germane the point I was making so I didn't mention it. Actually, I did think of using sum when I was computing the length differently, but I made another change and never got back to it. I agree, sum would be better.
- mgreenbe 17y agoI didn't mean to snipe: the "funny" I'm using is in a "cite original sources" mode, which has little/nothing to do with the non-academic world. :)