Skip to content

Drop lens-person's unused scalaz solution, and move the exercise to Scala 3 syntax - #912

Merged
rabestro merged 1 commit into
mainfrom
lens-person-without-scalaz
Nov 10, 2026
Merged

rabestro merged 1 commit into
mainfrom
lens-person-without-scalaz

Conversation

@rabestro

Copy link
Copy Markdown
Member

bin/verify-exercises-in-docker lens-person always failed: the example imported scalaz.Lens, which the test runner does not ship (#891).

The scalaz code was never used. The example defined two solutions, and LensPerson only mixed in the Monocle one — the scalaz one sat behind a comment, /* with ScalazSolution */. It still had to compile, which is all that broke.

Changes

  • Example: remove the scalaz solution and fold the Monocle one into the object, dropping the ToBeImplemented trait that only existed so both solutions shared an interface. Unused lenses (name, foreNames, year, …) go too.
  • Monocle 3 API: andThen, replace, modify and Iso instead of the deprecated ^|->, ^<-> and postfix get/set, so the scala.language.postfixOps import goes as well.
  • build.sbt: remove the scalaz-core dependency.
  • Stub and tests: optional braces and LensPerson.*, as .scalafmt.conf asks; the obsolete @version created manually header is removed. No test or signature changes.

All four files pass scalafmt --list with the track's config.

[no important files changed] — the test cases, the stub's signatures and the runner's dependencies are unchanged, so existing solutions behave exactly as before.

Verification

  • bin/test lens-person: 5 of 5 pass, no compiler warnings.
  • bin/verify-exercises-in-docker lens-person against exercism/scala-test-runner:latest: exit 0.
  • The untouched stub run through the same image still compiles against the reformatted tests (status fail, as expected for ???).

Only lens-person was verified in Docker, not the whole track.

Closes #891

🤖 Generated with Claude Code

The example carried two solutions, but `LensPerson` only mixed in the
Monocle one; the scalaz one sat behind a comment. It still had to
compile, though, and the test runner does not ship scalaz, so
`bin/verify-exercises-in-docker lens-person` always failed.

Remove the scalaz solution and its build dependency, and fold the
Monocle solution into the object. Move it to Monocle 3's API
(`andThen`, `replace`, `Iso`) instead of the deprecated symbolic
operators and postfix calls.

Reformat the stub and the test suite with optional braces, as
`.scalafmt.conf` asks. Behaviour is unchanged, so existing solutions
are not affected.

[no important files changed]

Closes #891

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

This PR touches files which potentially affect the outcome of the tests of an exercise. This will cause all students' solutions to affected exercises to be re-tested.

If this PR does not affect the result of the test (or, for example, adds an edge case that is not worth rerunning all tests for), please add the following to the merge-commit message which will stops student's tests from re-running. Please copy-paste to avoid typos.

[no important files changed]

For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping @exercism/maintainers-admin in a comment. Thank you!

@github-actions

Copy link
Copy Markdown

Hello 👋 Thanks for your PR.

This repo does not currently have dedicated maintainers. Our cross-track maintainers team will attempt to review and merge your PR, but it will likely take longer for your PR to be reviewed.

If you enjoy contributing to Exercism and have a track-record of doing so successfully, you might like to become an Exercism maintainer for this track.

Please feel free to ask any questions, or chat to us about anything to do with this PR or the reviewing process on the Exercism forum.

(cc @exercism/cross-track-maintainers)

@rabestro rabestro self-assigned this Nov 10, 2026
@rabestro
rabestro requested review from a team and IsaacG November 10, 2026 17:39
@rabestro rabestro added the bug label Nov 10, 2026
@rabestro
rabestro merged commit 843a0eb into main Nov 10, 2026
11 checks passed
@rabestro
rabestro deleted the lens-person-without-scalaz branch November 10, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bin/verify-exercises-in-docker can never pass: lens-person's example needs scalaz, which the test runner does not ship

2 participants