|
|
|
|
|
by evincarofautumn
4194 days ago
|
|
As long as we’re picking nits… > I wrote this code putting brevity over readability Overall, this is not particularly terse, for Haskell code. With all the lambdas, it looks like OCaml! For example, these are equivalent, and I find the latter clearer: (sortBy (\(_,c1)(_,c2) -> c2 `compare` c1))
sortBy (flip (comparing snd))
Now, it’s not necessarily a bad thing to be explicit, but in cases such as these, it’s less repetitious to just use the standard library functions. |
|