23 comments

[ 2.5 ms ] story [ 26.4 ms ] thread
> For the past few years I’ve been trying to learn haskell in various ways but have never been able to stick to the method, let alone actually “become productive” in Haskell.

Have you tried doing something beyond puzzles like AoC? There's a weird communal perception of Haskell being a near enough insurmountable challenge, so instead of people getting their hands dirty, they just flirt with it on and off for years on end.

In my experience, after I had written a web app or two in Haskell I wasn't sure what all the fuss was about. It's an excellent language to be productive in. The libraries and tooling are great. The water is warm; jump in.

Please don't take the above as criticism; it isn't intended that way. It's great that you're learning and sharing Haskell :) Also FYI your about page currently is a 404.

To be fair, it is comparatively more difficult to get started in Haskell then, say, Python, Go, or even Rust (the latter has a steep learning curve after getting started, but installing and configuring the development environment is easy). Also, it is difficult to find a central source of information in Haskell.

I tried to give the language a spin, and struggled with many a barrier to get to the point where I see significant progress (books, build tools)

I understand that you are invested in the Haskell ecosystem with your company, and I am happy that the language has more adoption in the business sector. The design space of Haskell is huge, however, and then on boarding process to make serious applications is not convenient at all.

I don’t disagree with that, though it’s much easier to get started today than it was five years ago. The point I’m trying to make is that I don’t think the solution to the problem of not making what feels like meaningful progress over the course of a few years is to only dabble with self-contained puzzle exercises. It’s certainly helpful, but there’s no substitute for just building a complete thing, provided you can get through initial on-boarding as you’ve highlighted.
> there’s no substitute for just building a complete thing, provided you can get through initial on-boarding as you’ve highlighted.

I think you are correct. Would you perhaps have some resources at hand that would combine on boarding with a simple Web project?

You need to check out IHP. It's a new truly batteries-included web framework for haskell. IHP allows you to get started in minutes. It takes care of all the infrastructure work so you can just build cool stuff and enjoy the type-safety.

https://ihp.digitallyinduced.com/

Disclaimer: Founder of digitally induced, the company that makes IHP :)

You are doing that a lot recently, so a disclaimer would be nice (that you built it and also run a dev business around it).

Not that IHP is bad (the batteries included approach for sure is a good idea), it just feels a little bit disingenuous otherwise.

Thanks for pointing out, added the disclaimer
Wonderful product. Looked at it a few weeks ago. I particularly like the video and how you are helping people understand the product. Congratulations!
The tooling certainly has the reputation of being hard to use. Go and Rust certainly have this nailed down better (having used Go on a daily basis for the past 5 years).

On the other hand, there's nothing magical about compiling a file with GHC, just like compiling with gcc. So a simple Makefile might suffice in a lot of cases (like doing AoC challenges).

Things start to get more complicated when you add Cabal (and Stack) into the mix, but even with just Cabal you get a lot of added benefits which not too much added complexity.

Things like IHP go one step further and go all-in on using nix. I've looked at using nix for a few hours and decided it is - right now - not worth the effort of actually learning it. Nothing to prevent me from using it to build something with IHP though.

> flirt with it on and off for years

> self contained puzzles

These hit pretty close to home. The thing is, at any given time I either don't have an actual project I'm eager / able to start, or if I am motivated to "get stuff done" then I don't want to complicate the effort with something new so I reach for more familiar tools.

I've considered building a simple CRUD REST API or small CLI script in haskell. Do you really suspect I'd learn much more than I would with Advent of Code (which I have done before)?

On the one hand, stuff like learning Hesod, database interaction, and I/O generally would be a real skill. On the other hand, one time I attempted to hack Postgrest to work for Redshift. It mostly worked (read only, no bells and whistles) and that was cool but I didn't really feel i learned much

I think it's different for everyone, though it seems to be a common theme that people need to throw themselves into the deep end and do something more meaningful like a CRUD app or CLI tool in order to be invested. I think people need to be invested if they want to learn, because otherwise there's always other day job or life stuff that's way too easy to be distracted by. In a way it's very similar to adding user stickiness to a product you're selling, except in this case you are your own user and you have to add your own stickiness.

If you're doing a CRUD thing, I'd suggest supporting both JSON and HTML representations of your responses (and Yesod works great for this). I think the art is in the details between the language parts you know and the libraries you end up interfacing with. Once you start doing this for real, that's when the details you learned in isolation in the beginning all begin to fit together.

Makes sense. Thank you, I think I'll give this a shot sometime!

My main candidate for this right now involves webscraping from a relatively small single source, structuring the data, and serving it in a different manner.

If I may tag on a semi related question: does https://hackage.haskell.org/package/tagsoup look like an OK html parsing library? Any general advice on choosing packages?

> I think people need to be invested if they want to learn, because otherwise there's always other day job or life stuff that's way too easy to be distracted by.

Thanks for this, I'm socially committed now ;-)

For what it's worth, I've dabbled with Go for about two years, doing the matasano crypto challenge and an AoC using it, before I actually started using it for "real work"TM.

My go-to project for fiddling around in a new language is to write a hex dump utility. The goal is to replicate the output of "xxd -p -c 16 <thefile>", and perhaps allow a few more options.

So yeah, self contained puzzles like AoC, Project Euler, Rosalind, etc is the migration path. It's hard to find something reasonably educational and medium level to work on; meanwhile I'm not exactly free to arbitrarily switch to langX at work.

I'm also a roguelike fan and every year I think about trying out a very simple 7DRL in some language I'd like to learn, but without libtcod bindings I'd spend all the time working on i/o and display and not any actual game logic. However, something along these lines is probably my best bet for a medium educational "fun" project for language learning so I should figure out how to use libtcod from langX!

The puzzle projects do let me get familiar with parsing command line args, reading/writing files, splitting input and strings, etc. So that's definitely valuable.

I have the same flirtatious relationship with Rust. I dabble, do the AoC puzzles ever year, and that's it.

Meanwhile, C# keeps getting better and faster every year, so I keep going back.

Author here: Thanks for the feedback. Will also setup the about page.

Regarding the trying part: I'm actually doing that "as we speak". I had an idea for a web-app on the shelve which I'm currently implementing with the help of IHP. Might do a write-up about that in the future.

Main idea here was to offer my notes for some of my co-workers who struggle with the same things I do/did.

Personally, I like to believe that haskell is - as you mentioned - not an insurmountable challenge to use. So I will probably not write about learning functors/applicatives/monads/etc., but will use them (at some point).

edit: added the word NOT.

That's awesome! Don't worry about writing about those typeclasses — we have plenty of that already. I'd much rather read about the thing you want to do with IHP. That sounds interesting!
I am currently going through https://www.seas.upenn.edu/~cis194/spring13/ to learn about Haskell (my goal is to use it for Nand2Tetris's compiler assignments). There are also other resources that I used before cis194:

- https://typeclasses.com/beginner-crash-course

- https://yannesposito.com/Scratch/en/blog/Haskell-the-Hard-Wa...

Brent’s class is a great place to start learning Haskell. I actually took the first iteration of the class many years ago and Brent was a great teacher.
Not trying to niptick: the web address for Advent of Code is https://adventofcode.com

Thanks for posting how you get everything set up for AoC! It's always neat to see how folks tackle the problems and set up their dev environments -- there's a good bit that can be automated between setting up each day's challenge.

The evolution of the setup is the thing I'm aiming for. Right now it's plain, simple stupid. But if the progression of challenges is the same this year when compared to 2019, then reusability will come in handy, and a more involved setup might be appropriate. ;-)

edit: thanks for pointing out the erred link, updated.