-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Conversation
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. |
Build fails on lack of install lens lib. Anyone have objections to adding that to _test/bootstrap.sh? |
@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. |
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. |
Ok then, I'll add this tomorrow (don't have time / the right computer right now). |
👍 |
This is a relatively easy exercise to play around with basic lenses.
Build fixed, once the x-common PR is merged this one is ready to be merged here as well. |
Thanks! 👍 |
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.
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.