4 ms·
Not knowing a lick of Haskell, these sorts of articles always make me wonder whether it makes Lisp look like Blub.
by sayrer 18y ago
Not knowing a lick of Haskell, these sorts of articles always make me wonder whether it makes Lisp look like Blub.
- jrockway 18y agoIt depends on how important you find purity and strict typing. They are both useful, but the mistakes that experienced programmers make are not usually related to types. Having recently started writing "real" software with Haskell, I've noticed that the type system doesn't save me a lot of time. I still have to debug stupid errors, like calling a function with the right type signature but with the wrong effect. By the time I've debugged and written tests, I haven't gained a whole lot over Lisp or Perl. The advantage of Haskell is that it's as expressive as either of those, but executes a lot faster. (One concurrent app we ported was very quick to use 100% CPU on Perl with just a few outstanding operations. In Haskell, it gets to 10% CPU and runs out of file descriptors. Wow!) As for monadic computation in Haskell, it is very comfortable. You can create an environment where you only have exactly what you need, which makes your program easier to read and reason about. (No "IO a" signature? This function doesn't do IO.) It is not something I can't live without in other languages, but it does solve the intended problem very cleanly. (Similar abstractions like monoids and functors are also nice ways of looking at their respective problems.) The author of this article is right, though -- in a language with mutable state and without type inference (for return), monads are just not worth the bother. They won't give you anything you don't already have.
- andreyf 18y agoI still have to debug stupid errors, like calling a function with the right type signature but with the wrong effect I wonder if a way of writing tests which is significantly easier (taking one or two magnitudes less time) would help here? Say for example, something like Python's doctests which run inside your IDE... it seems my standard way of development anyway - to write a piece of code, test it in the REPL, repeat.
- jrockway 18y agoHaskell's quickcheck is really nice for this case.