렌즈 사용자

렌즈 사용자

렌즈를 사용해 중첩된 레코드를 갱신해요(불변 데이터를 사용하는 언어에 해당).
지시 사항

Use lenses to update nested records (specific to languages with immutable data).

Updating fields of nested, immutable records is kind of annoying. The code for such cases is as cumbersome as the structure is deep. If you have, say, a Person, that contains an Address, which has a Street, that has a Number, updating the Number requires creating a new Street with the new Number, then a new Address with the new Street and, finally, a new Person with the new Address. Confused already?

One solution to this problem is to use lenses.

Implement several record accessing functions using lenses. The test suite also allows you to avoid lenses altogether so you can experiment with different approaches.

렌즈 사용자 문제를 5개의 다른 언어로 풀어봐요…

아직 어떤 언어로도 완료하지 않았어요.

F#
Haskell
Idris
JavaScript
Scala