I picked up Purescript just over a month ago. The most functional-type of programming I’d ever done before was RxJS in Angular. The most expressive type-system I’d ever used belongs to Java.
How long it will take to be productive with it?
I’ve gone from nearly zero understanding to being able to solve most of the problems I could solve in other languages. I wouldn’t say I’m productive with it yet, but I can solve some real problems so I’m not too far away.
I also think the “you’re productive with this technology” bar is way lower than is typically insinuated. Each new abstraction you learn and master increases your productivity, but the baseline that gets you moving isn’t bad at all. A purely functional language like Purescript complicates that story a little bit, but I’ve been pleasantly surprised with how a very little gets you a long way.
Of course, mileage will differ for everybody.
I think your background with Rescript and NextJS will give you a running start compared with my path. For example: it took me an embarrassingly long time before it finally clicked just how absurdly useful currying is.
You should have an easy enough time understanding Maybe (Rescript’s optional) and abstract data types (Kinda like Rescript’s varient).
My number one recommendation is to pick and solve an exercise problem. Something just complex enough that the process of prototyping/solving it will run you into the standard roadblocks. Since it’s just a small exercise problem you can avoid being bogged down too much with design and such. That way you can focus on the language.
For front-end stuff, the canonical exercise problem is the “todo” list. I would avoid that one. I would start with something that focuses more on purescript than on web. You can always build a minimal Web-UI for just about anything.
Write an algorithm that guides a robot through a room. Or an algorithm that guides an elevator up and down floors (see if it can maximize efficiency by some metric like distance moved, average time spent in the elevator, or average time spent waiting for the elevator). Or a traffic simulator. All easy algorithms that have all been solved elsewhere but that can easily add a bit of extra complexity where needed to help you learn.
I built a Sudoku Solver. Peter Norvig wrote a python solution in about 100 lines of code, but it’s also easy to see how such a solution can be expanded to use more involved constraints to make fewer guesses. Or how this could be expanded with a UI. Or altered so that the steps of the algorithm can be animated.
Here’s a link to what I slowly built with my spare time over the past month or so. The thing itself, well, it’s … okay. The learning it represents is awesome though
Do something fun and energizing while you’re learning. Save the tedious stuff for later