3 ms·
Java : lots of syntax to fuzz, all have to be right. Haskell : few tokens, stronger checking (i.e no corecions), though Rosetta code is not as type-heavy as re
by dons 14y ago
Java : lots of syntax to fuzz, all have to be right.
Haskell : few tokens, stronger checking (i.e no corecions), though Rosetta code is not as type-heavy as real Haskell code.
I have a conjecture that Haskell examples designed by experts - with types in mind as we do in production systems - would have lower compile rates than the Rosetta examples, that are written mostly by non-experts without regard to maintainability.
In production Haskell code, I will usually wrap Double values with newtypes, to e.g distinguish currency amounts, percent data and ratios from each other, specifically to guard against typos where I accidentally pass doubles parameters in the wrong order. Designing code with an intent to make it less vulnerable to fat fingers is certainly possible.