Paola’s Prestigious Pizza is supposed to be a learning exercise for beginners, but it requires concepts that have not been introduced so far in the elm learning track. I see no way to solve this without using Parser modules beyond the core module which is all that is explained in the introduction, or it requires loops or recursion or something, topics that haven’t even been unlocked yet at this point in the curriculum. Is there any way for the Introduction of this exercise to include what is needed to do the exercise or have this exercise come after recursion? It’s the only way it makes sense to me.
I find the concept really hard to understand. I admit that I cheated by reading the exemplar solution to get my solution working, and even then I don’t understand it.
Note that the tasks do not require looping or recursion at all.
There are no concepts that require Parsers, so you could leave it for later.
Hi There, I’m one of the maintainers of the Elm track.
It’s true that the way Parsing is done in functional languages is usually very different to the way it is done in other languages, and it definitely does take some time to get your head around it. Most people (at least most functional programmers :)) would say that it easier once you’ve learnt it though.
Anyway, this concept exercise is specifically designed to help teach / learn the Parser module in Elm. No recursion or loops are required, and it does already come after all the concepts that are required in order to solve it.
It is quite complicated though. The intention is to showcase as many functions in the Parser module as possible, but this necessarily leads to some complication.
In the practice exercises on Exercism, it is possible to specify how difficult the exercise is, so students can decide whether they want to do it or not.
The concept exercises (like Paola’s prestigious pizza) don’t have this option, and instead solely rely on the prerequisites, so there isn’t a valid way to move this exercise later in the syllabus (after recursion).
It does already come late in the syllabus though, even if you take the fastest path to it, there are 7 exercises to do first.
We can take a look at the introduction, instructions and hints though to see if we can explain things better and make it easier.
Also you could ask for a mentoring session for the exercise, and then a human could help out.
When using the website editor, your solution must pass the tests before you can request mentoring.
hmmmm, interesting, I didn’t know that. Seems like a shame (in this case at least), do you know what the thinking is behind it?
I think it was along these lines: mentoring is not for “how do I solve this”, it’s more for “is this idiomatic” or “what’s a better way to do xyzzy”. In the editor there are lots of help links, including a button to launch chatgpt. As was emphasized a lot in the bootcamp: there’s lots of value in the struggle to understand a concept.
In this case, I think there just needs more documentation/examples, and perhaps more references to external resources that can explain the concept (if there are any)
Yeah I get that. It’s a shame to spend hours bashing your head against a wall as well though. We’ll take a look at the documentation and see if we can improve anything.
We can help if you have proposals / someone has ideas!
I don’t know, but I do know this “learning” exercise is way too hard for beginners. I have been on it for 3 full days now. It’s making me want to just give up. Why was this newline whitespace complexity added? Trying to learn the core concepts of Parser and I have to spend a day messing with whitespace-newline differences? REALLY?!
Ugh I had to use other people’s code just to finish it. Had to use google AI just to understand the other people’s code. I barely do. There’s no way I could write this on my own. I wouldn’t even know where to begin. I’m just whining now, so I am going to go reevaluate my life and career, because this is a nightmare for me.
Look on the bright side: once you get past this exercise, you may not ever need to do parsing in Elm ever again. ![]()
You could just ignore the Parser concept. Nothing else relies on it, so you don’t need to complete it to continue with the syllabus.
You could also cheat and look at the example solution on GitHub
It doesn’t sound like there is much ‘value in the struggle to understand a concept’ for you at the moment :)
I’m sorry I’m kind of late here, but I feel if I could master the elm/parser package I’d have some serious power!
Would it be possible to add some simpler exercises for this to introduce each aspect more easily? For example, an exercise that just requires you to parse a keyword, then one that requires a keyword plus a number, etc? That would at least give beginners a nice ramp up to the more complex parsers.
Even the official package documentation (parser 1.1.0) doesn’t say much. I managed to get to the page Parser - parser 1.1.0 which thankfully has the details, e.g. the type of Parser.succeed. Could this link be mentioned in the instructions for this problem? It’d save a lot of headscratching.
Just to follow up to my own comment, I think the GitHup exercise is good precursor because it teaches how to parse JSON. Maybe that exercise and Paola’s Prestigious Pizza could be switched in the exercise list so students will first encounter the JSON exercise and then can apply their skills to the Pizza one.