Skip to content

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

Merged
merged 1 commit into from
Jan 19, 2017
Merged

lens: mark as immutable-data-specific, not Haskell specific #503

merged 1 commit into from
Jan 19, 2017

Conversation

petertseng
Copy link
Member

@petertseng petertseng commented Jan 17, 2017

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.

@petertseng
Copy link
Member Author

We could be more specific and say "(Immutable data language specific)", but I'm not sure that makes as much sense.

Or, be more verbose? "(Specific to languages with immutable data)"

@ErikSchierboom
Copy link
Member

@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.

@petertseng
Copy link
Member Author

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.

@petertseng petertseng changed the title lens: mark as FP-specific, not Haskell specific lens: mark as immutable-data-specific, not Haskell specific Jan 19, 2017
@ErikSchierboom
Copy link
Member

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.
@petertseng
Copy link
Member Author

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.

@ErikSchierboom ErikSchierboom merged commit c798017 into exercism:master Jan 19, 2017
@ErikSchierboom
Copy link
Member

LGTM! 🎉

@petertseng petertseng deleted the lens branch January 19, 2017 07:50
emcoding pushed a commit that referenced this pull request Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants