Skip to content

Add lens-person exercise #84

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
Jun 29, 2015
Merged

Add lens-person exercise #84

merged 1 commit into from
Jun 29, 2015

Conversation

pminten
Copy link
Contributor

@pminten pminten commented Jun 28, 2015

This is a relatively easy exercise to play around with basic lenses. It's designed in such a way that lenses aren't actually required, so you can play around with different approaches and see what works best.

@etrepum I haven't made an x-common part for this yet since I wanted to get your opinion on this first. Do you think this is a good exercise for the Haskell track? It does kinda deviate from standard exercism practice by a) (strongly) suggesting the use of non-standard-library libraries and b) being clearly applicable only to Haskell.

@kytrinyx
Copy link
Member

I think language-specific exercises are fine (they should still have an entry in the x-common, though perhaps with something in the config yml that says that it was conceived specifically for the haskell track.

I'm going to be working with some students this summer who will hopefully start using the metadata in x-common to start showing a bit of information about exercises on the site itself.

@pminten
Copy link
Contributor Author

pminten commented Jun 28, 2015

Build fails on lack of install lens lib. Anyone have objections to adding that to _test/bootstrap.sh?

@pminten
Copy link
Contributor Author

pminten commented Jun 28, 2015

@kytrinyx That's great. My experience is that the exercises which are most useful are often the more language (or at least paradigm) specific ones. The "translate the exercise" approach, practical as it may be, does tend to result in shoehorning.

@etrepum
Copy link
Contributor

etrepum commented Jun 28, 2015

No objection to adding it to the bootstrap. I think having exercises designed for third party libraries is a good thing, particularly if they're de facto standards like lens. The Haskell world has changed in the past few years with cabal sandboxes, stackage and stack in a way that makes Haskell Platform much less relevant. We already depend on a number of packages that don't ship with GHC itself, so I think it's fine as long as what the exercise needs is clearly documented.

@pminten
Copy link
Contributor Author

pminten commented Jun 28, 2015

Ok then, I'll add this tomorrow (don't have time / the right computer right now).

@etrepum
Copy link
Contributor

etrepum commented Jun 28, 2015

👍

This is a relatively easy exercise to play around with basic lenses.
@pminten
Copy link
Contributor Author

pminten commented Jun 29, 2015

Build fixed, once the x-common PR is merged this one is ready to be merged here as well.

@etrepum
Copy link
Contributor

etrepum commented Jun 29, 2015

Thanks! 👍

etrepum added a commit that referenced this pull request Jun 29, 2015
@etrepum etrepum merged commit 941a80a into exercism:master Jun 29, 2015
ErikSchierboom pushed a commit to exercism/problem-specifications that referenced this pull request Jan 19, 2017
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.
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.

3 participants