3 ms·
What do you mean "syntax doesn't syntactically scale" ?
by dons 14y ago
What do you mean "syntax doesn't syntactically scale" ?
- hp50g 14y agoA single function/expression tends to drag over too much space for my liking. It's hard to break down some of them into functional units that fit in my head properly. Perhaps I'm just thick :) Look at List.hs (sort/sortBy) for what I mean: http://hackage.haskell.org/packages/archive/base/latest/doc/html/src/Data-List.html http://hackage.haskell.org/packages/archive/base/latest/doc/...
- pilgrim689 14y agoThat sortBy is split into 6 sub-functions, all 2 to 4 lines each. You want it more broken down?
- hp50g 14y agoFair point. I will do the tutorial again! :) I might get it if I keep trying. (ironically I did an engineering degree which was rather maths heavy so I should get this).
- tinco 14y agoThat looks like a very tidy implementation to me.. I think the problem is that because its split into so many helper functions you don't really know where the code is going, but if you follow through I think this code eventually fits in your mind better than an imperative version would.
- nilkn 14y agoThat is actually really clean code. Haskell can just take some time to get used to. The code is laid out differently and the use of curried functions and point-free styles can throw you off coming from imperative code.