Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Not quite. A lens comprises three operations:

  get : C -> A
  put : A x C -> C
  create : A -> C
And the GetPut, PutGet, CreateGet laws require of every lens that:

  put (get c) c = c
  get (put a c) = a
  get (create a) = a
In other words, if there are no edits, then it is a round trip. The real inequality you mean is bidirectional != bijective.

(EDIT: for typesetting equations.)



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: