There are a bunch of fussy little problems that Haskell solves nicely. One example is looking up a value in a map map.get("foo") // returns null
is the value of the key null, or was there no key? Different languages have different approaches. Haskell let's you build up deep structures, a list of maps of list of maps ... and you'll have an indication of what path you took down the data structure to get a result. You can do this in any language, but it relies on programmer discipline, and everybody doing it the same way every time. In Haskell, it's the easy thing to do, and often the only way to do it. You'll wind up with something like[Just ["foo"], Just ["bar"], Nothing] The first two maps had once answer each, the final map had nothing. Laziness means you have control of the order of evaluation. in practice you can make your own control structures without macros. bracket is a good example, bracket open_socket do_stuff close_socket
the socket always gets cleaned up, with an ordinary function. No try/catch.One of the biggest hassles in programing is leaky abstractions. The type system means you can steal abstractions from mathematicians that just don't leak. There's some good stuff here [1] about the kinds of things you can say. Purity means values can't change behind your back. there's no function to call that'll change the state of some object you're working with. All together, it's nice for languages. You can build up parse trees any way you wish, and traverse those trees to execute the semantics. So if you can think of a dsl for your problem, you can whip up an interpreter pretty quick. If you change your mind, and want to turn it into a compiler, it's relatively painless. It's a fun language. [1] https://wiki.haskell.org/Typeclassopedia |