-
-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Learning Mode] Discussion: How do we best introduce case-expressions? #1102
Comments
It might surprise you how easy it is to explain (essentially) everything about For reference, this is the most recent concensus on Slack (original):
@pwadsworth has already worked on this PM1: the corresponding exercise is Guessing Game. I'd like to call dibs on the explainers of PM2, as I have already been composing in my head for days. These explainers should make it obvious even to the non-Haskellers what appropriate exercises look like. |
For names, how about:
The Type part would benefit of a qualifier. Simple? Basic? So is not confusing if we later want to go into PM: Lists, PM: Tuples, etc.
What do you mean by 'explainers'? The concept? instructions? both? Do you want me to tackle the exercise? If so, Valentine's Day? |
I'm not entirely sure I follow the discussion.
The |
Way I understand it, the concept graph will look something like this.
with
@pwadsworth The explainers are the
@ErikSchierboom in the above-laid-out design, |
@MatthijsBlom I really like that concept graph, and I'd like to open a new issue with the graph as a starting point. We have a solid exercise for the first node in the graph with the Guessing Game PR that @pwadsworth has opened (#1094), and I'd like to get that merged. We can always come back and tweak it once we have more exercises and start seeing how the bigger picture is shaping up. I'll leave this issue on hold until we've figured out the exercises for the nodes in the graph. As you say, |
The goal of this issue is to come up with a code example that can be used as the basis for an exercise that introduces
case-expressions
in Haskell.A few thoughts:
Int
andFloat
). But if the example code is easier to do using something other than numbers, then we can introduce another exercise first, beforecase-expressions
.case
in Haskell, but students will quickly move beyond this into code that uses more of the language, and uses the language in ways that are more typical.Elixir introduces case expressions with this exercise:
https://exercism.org/tracks/elixir/exercises/german-sysadmin
The example solution looks like this:
https://github.com/exercism/elixir/blob/main/exercises/concept/german-sysadmin/.meta/exemplar.ex
Is this a bit of code that would translate well into Haskell? (Would it feel like decent Haskell, or would it feel weird and foreign?)
What are some other sample bits of code that use
case
in a way that is potentially easy to understand for people who are new to Haskell?The text was updated successfully, but these errors were encountered: