Skip to content
Speros Kokenes edited this page Mar 7, 2019 · 11 revisions

Below are some sample answers to the exercises at https://calmm-js.github.io/partial.lenses/exercises.html

Getter and Setter

const lens = "part";

Nested Objects

const lens = [L.removable("inside"), "inside", L.removable("part"), "part"];

Association List

const valOf = key => [
  L.normalize(R.sortBy(L.get("key"))), 
  L.find(d => d.key === key), 
  L.valueOr({ key }), 
  L.removable("val"), 
  "val"
];

Clone this wiki locally