My experience with learning Haskell was: When it works, it's magical. Finally realising that monads allow little bubbles of cause-and-effect. STM, which is utterly magical. Realising that not having side effects is freeing, not restricting. Collapsing huge chunks of code into little bits of pattern matching. Finding myself casually using a higher-order type because it was the easiest way to solve a problem. When it's…
The Haskell user experience
41–50 of 50 posts
Re: The Haskell user experience
#42My experience with learning Haskell was: When it works, it's magical. Finally realising that monads allow little bubbles of cause-and-effect. STM, which is utterly magical. Realising that not having side effects is freeing, not restricting. Collapsing huge chunks of code into little bits of pattern matching. Finding myself casually using a higher-order type because it was the easiest way to solve a problem. When it's…
> A billion little unmemorable functions with symbolic names Pretty much. If you though Common Lisp was bad, this is much worse. And that makes for a major (re-)learning curve every time you stop programming in Haskell for a couple of months.
Re: The Haskell user experience
#43Earlier quoted context omitted.
Personally, I've been spending a lot of my recent time trying to debug a Parsec parser (it seems to be going into loops of backtracking, but I can't figure out where and why ), and it's been a clusterfuck. * `trace` and `traceM` don't actually get evaluated, so I can't use printing to find my bugs. * Even putting `trace "..." True` as a guard to my parser combinators doesn't seem to actually print anything. * `seq` a…
Note that trace is implemented in terms of unsafePerformIO (which is fine for debugging). To get a trace message, you need to attach the trace to something that does get evaluated. I mostly define a somewhat simpler helper like this: tt :: Show a => a -> a tt x = trace (show x) x So you surround your expressions with it and see there values, when those values get evaluated of course. Eg: myParser = (\_ code -> tt cod…
Re: The Haskell user experience
#44I don't know how one would tell Google to prefer the latest docs, but it would certainly help if the Hackage documentation page header warned you if you were not looking at the latest version of the docs.
Re: The Haskell user experience
#45There is... certainly a learning curve. The Haskell community is still tiny. Per capita, it's one of the best language communities out there. It just hasn't had the thousands or millions of person-hours necessary to make everything pretty and intuitive. I generally say that, all else equal, and if I were to use a GC'd language-- obviously, there are projects that mandate C or other low-level languages-- then I would…
IME, this seems to be roughly, "What are the odds you'll need to refactor significantly because the world changed around you?"
Re: The Haskell user experience
#46My experience with learning Haskell was: When it works, it's magical. Finally realising that monads allow little bubbles of cause-and-effect. STM, which is utterly magical. Realising that not having side effects is freeing, not restricting. Collapsing huge chunks of code into little bits of pattern matching. Finding myself casually using a higher-order type because it was the easiest way to solve a problem. When it's…
> A billion little unmemorable functions with symbolic names Pretty much. If you though Common Lisp was bad, this is much worse. And that makes for a major (re-)learning curve every time you stop programming in Haskell for a couple of months.
Re: The Haskell user experience
#47Earlier quoted context omitted.
It'd be nice to be able to search by type declaration
Hoogle lets you do exactly that, with fuzzy matching: https://www.haskell.org/hoogle/?hoogle=a+-%3E+[b] It's as useful as you might hope!
Re: The Haskell user experience
#48Earlier quoted context omitted.
Hoogle lets you do exactly that, with fuzzy matching: https://www.haskell.org/hoogle/?hoogle=a+-%3E+[b] It's as useful as you might hope!
I am not a Haskeller, but you can use "!h searchterm" on Duck Duck Go.
Re: The Haskell user experience
#49Haskell has all the features of languages that become mainstream and mandated top-down on workplaces. I wouldn't be much surprised if in a decade people start complaining about Haskell-shops they way we complain about Java-shops now. (But then, no language could get there without a marketing budget...) Haskell lets big teams collaborate very well, makes it hard to bad coders to destroy an entire project, consist in a…
Re: The Haskell user experience
#50My experience with learning Haskell was: When it works, it's magical. Finally realising that monads allow little bubbles of cause-and-effect. STM, which is utterly magical. Realising that not having side effects is freeing, not restricting. Collapsing huge chunks of code into little bits of pattern matching. Finding myself casually using a higher-order type because it was the easiest way to solve a problem. When it's…
> Even BASIC would at least give me a line number! You can get line numbers and even stack traces if you compile your program (assuming you use GHC) with `-prof` and execute it with `+RTS -xc`. But most libraries try their best to avoid using exceptions altogether and it's generally discouraged to use the non-total functions from Prelude like `head` or `!!` and use safer alternatives instead.
I did also try the ghci interactive debugger, and couldn't make that work either. Now, I like command line debuggers, but I found the ghci one utterly opaque. I did eventually get it to catch the exception... but then it wouldn't tell me where it happened.
In general, trying to track down the exception was an utterly miserable experience. I do understand that Haskell has special needs when it comes to order of evaluation, due to the way that thunks are unwound, which means that traditional stepping and stack frames are of little use; but this desperately needs to be better. And work out of the box.
Regarding avoiding exceptions... yeah, I'd love to, but it wasn't my code which was throwing the exception.