-
-
Notifications
You must be signed in to change notification settings - Fork 555
lens: mark as immutable-data-specific, not Haskell specific #503
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
Conversation
Or, be more verbose? "(Specific to languages with immutable data)" |
@petertseng I quite like the more specific "Specific to languages with immutable data" option. There's nothing stopping a non-functional language from having immutable data structures, in which case a lenses library would also make sense. |
Indeed, I have decided to use "Specific to languages with immutable data". As I have updated the commit message to say (and will update the PR description), functional programming is quite a broad term, whereas if the message is more specific it's easier for track maintainers to decide whether the exercise makes sense for a given track. |
One last thing. Wouldn't it make sense to change the description from "(Specific to languages with immutable data) use lenses to update nested records." to "Use lenses to update nested records (specific to languages with immutable data)." That would first focus on what the exercise is about, and then add the restriction. Makes more sense I think. |
At the time it was added (#97), indeed [Haskell][haskell] was the only implementing track, and it was marked Haskell-specific. However, the [Scala][scala] track has also implemented this exercise. I predict it is confusing for Scala students to see "Haskell specific" in the list of the Scala exercises. The proposal is to change it to "specific to languages with immutable data". [haskell]: exercism/haskell#84 [scala]: exercism/scala#157 Lenses can be a fit for any language that has immutable data and data structures that can be nested. In such a language, updating a deeply-nested field can be a lot of work, but made easier with lenses. This exercise demonstrates the use of lenses and is applicable to **any** language with immutable data, not just Haskell. The alternative considered was to use "functional programming" specific, but the term "functional programming" is a little too broad. It's altogether possible that a functional programming language could have mutable data and a non-functional programming language could have immutable data, so let's be precise about where lenses are helpful. As of this writing, I do not believe any other exercise is language-specific. Questions to this effect have been asked in: * #352 * exercism/exercism#3113 If you are curious about having language-specific exercises, you may be interested in exercism/DEPRECATED.trackler#22.
I could honestly go either way on that, but I'll lean slightly in favour of your proposal since it seems more consistent with other descriptions. |
LGTM! 🎉 |
Start unit testing lib/generator
At the time it was added (#97), indeed Haskell was the only
implementing track, and it was marked Haskell-specific.
However, the Scala track has also implemented this exercise.
I predict it is confusing for Scala students to see "Haskell specific"
in the list of the Scala exercises. The proposal is to change it to
"specific to languages with immutable data".
Lenses can be a fit for any language that has immutable data and data
structures that can be nested.
In such a language, updating a deeply-nested field can be a lot of work,
but made easier with lenses. This exercise demonstrates the use of
lenses and is applicable to any language with immutable data, not
just Haskell.
The alternative considered was to use "functional programming" specific,
but the term "functional programming" is a little too broad. It's
altogether possible that a functional programming language could have
mutable data and a non-functional programming language could have
immutable data, so let's be precise about where lenses are helpful.
As of this writing, I do not believe any other exercise is
language-specific. Questions to this effect have been asked in:
If you are curious about having language-specific exercises, you may be
interested in exercism/DEPRECATED.trackler#22.