←back to thread

193 points ingve | 1 comments | | HN request time: 0.207s | source
Show context
mikojan ◴[] No.43712753[source]
In another life I will be a Haskell programmer
replies(6): >>43712991 #>>43713006 #>>43713074 #>>43714014 #>>43714156 #>>43716535 #
revskill ◴[] No.43713006[source]
Why not python ?
replies(3): >>43713045 #>>43713108 #>>43714465 #
linguae ◴[] No.43713045[source]
I’m not the OP, but static types, Hindley-Milner type inference, algebraic data types, and pattern matching can be quite ergonomic. I have also come to appreciate functional programming and how it makes reasoning about and testing code easier.
replies(2): >>43713201 #>>43713342 #
1. kqr ◴[] No.43713342[source]
Yeah, just last week I updated the numeric precision of a value across an entire user journey in a big enterprise application, spanning many functions and data types. Thanks to Haskell, I could do it in a day.

In any other language I've used (barring maybe Ada) that is a refactoring that would take at least days, if not weeks, to manually track down all the places it interacts with the system directly or indirectly, because mixing e.g. int with long long is not a type error.

In Haskell, I change the type and the compiler spits out a list of locations that needs to change. This is repeated for a few iterations until all transitive interactions are worked out. Done!