Skip to content

Instantly share code, notes, and snippets.

@chris-martin
Last active August 26, 2015 10:07
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save chris-martin/a77c57b282b946272053 to your computer and use it in GitHub Desktop.

LensFamily:

A Lens Family, offering a purely functional means to access and retrieve a field transitioning from type B1 to type B2 in a record simultaneously transitioning from type A1 to type A2. scalaz.Lens is a convenient alias for when A1 =:= A2, and B1 =:= B2.

The term "field" should not be interpreted restrictively to mean a member of a class. For example, a lens family can address membership of a Set.

PLensFamily:

Partial Lens Families, offering a purely functional means to access and retrieve an optional field transitioning from type B1 to type B2 in a record that is simultaneously transitioning from type A1 to type A2. scalaz.PLens is a convenient alias for when A1 =:= A2, and B1 =:= B2.

The term "field" should not be interpreted restrictively to mean a member of a class. For example, a partial lens family can address the nth element of a List.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment