Skip to content
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

exercise lense-person #157

Merged
merged 4 commits into from
Sep 27, 2016
Merged

Conversation

abo64
Copy link
Contributor

@abo64 abo64 commented Sep 23, 2016

I decided to use the Monocle library for the example. It seems to be the only lens library that also supports Iso (which is the intended way to implement setBirthMonth).

@abo64
Copy link
Contributor Author

abo64 commented Sep 23, 2016

Seems the Travis checks insist on Java 7? Why? Can we perhaps upgrade to Java 8?
Scala 2.12 will require Java 8 anyway.

@ricemery
Copy link
Member

I think we should be able to update to Java 1.8. I can't think of why we should stay on 1.7 - especially since Java 1.8 has been out for so long. We will need to make sure there are no readmes or any text that indicates that 1.7 is the minimum version.

@ricemery
Copy link
Member

I am working on updating .travis.yml to only include java 1.8.

@abo64
Copy link
Contributor Author

abo64 commented Sep 23, 2016

thx @ricemery

@ricemery
Copy link
Member

I have updated the .travis.yml.
But, the reason that travis is failing is because lens-person need to be added to config.json. It needs to be added in two places. lens-person should be added to the problems array. And, should be added to the exercises array. The exercises array is a bit tricky in that a difficulty and topics array should be included. You can just default difficulty to 1 and a blank topic array. Or, if you want the list of topics can be found at https://github.com/exercism/x-common/blob/master/TOPICS.txt . Difficultly is an int 1..10 with 10 being the most difficult.

Can you modify config.json and resubmit the pull request?

Thanks @abo64

@abo64
Copy link
Contributor Author

abo64 commented Sep 26, 2016

Thank you for the review and advice @ricemery
I have added the entry in config.json for lens-person. I just took over the respective entry from Haskell for that. But feel free to change it if you disagree or have a better idea.
I also added a solution for Scalaz in example.scala by splitting things up into traits. Not sure if this is a good idea in terms of readability, though. Again, feel free to change it or tell me if you have some better idea.
And I am unsure about build.sbt. I have included both Monocle and ScalaZ. Perhaps I should better omit them or comment them out? But then example.scala doesn't compile anymore?!

@ricemery
Copy link
Member

Thanks @abo64 ! Looks good.

On the build.sbt question. I have a bit of a mixed opinion on of Monocle and ScalaZ should be in the build.sbt. Lets leave them there since the example.scala needs the. And, since we are looking for a solution using lenses it makes sense to have Monocle at least in there.

As far as the config.json entry, that is fine for now. The config.json entries need to be updated to include the difficulty, and topics. The entry you put in there is basically a placeholder for now.

Thanks

@ricemery ricemery merged commit d8a8ac5 into exercism:master Sep 27, 2016
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.
@abo64 abo64 deleted the exercise-lense-person branch July 4, 2017 04:27
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