|
|
|
|
|
by silentbicycle
6483 days ago
|
|
For one thing, the pattern matching used in Erlang, ML, and Haskell can be quite easy to read. For example, something like let days_in_month m = match m with
| Jan | Mar | May | Jul | Aug | Oct | Dec -> 31
| Apr | Jun | Sept | Nov -> 30
| Feb -> if leap_year () then 29 else 28
It takes a small amount of context (all "| Val" sections without a -> ... side match together), but it's a pretty direct correspondence. |
|
http://www.docjar.com/html/api/java/util/TreeMap.java.html
vs. those written in Haskell:
http://www.cse.unsw.edu.au/~dons/data/RedBlackTree.html
The rebalancing code in Java is 80 lines long. The rebalancing code in Haskell is 6.