Optic Module
Gets and sets the value a Lens or a Prism focuses on. The Optic, Lens and Prism modules replace the parts of the Aether library this codebase used, because the inline dispatch of Aether across assemblies broke under .NET SDK 10.0.400. A Lens and a Prism here have the same tuple shape of a getter and a setter as in Aether, so the lens and prism values defined elsewhere need no change. A value whose name ends in an underscore, such as min_ or fst_, is a lens or a prism, a pair of a getter and a setter, not a plain accessor. Use a plain get or set function to reach a single field, and an optic only where it composes over several levels.
Functions and values
| Function or value |
Description
|
Full Usage:
Optic.get (arg1, arg1) a
Parameters:
'a -> 'b
arg1 : 'b -> 'a -> 'a
a : 'a
Returns: 'b
Type parameters: 'a, 'b |
Get the value a Lens focuses on.
|
Full Usage:
Optic.getOpt (arg1, arg1) a
Parameters:
'a -> 'b option
arg1 : 'b -> 'a -> 'a
a : 'a
Returns: 'b option
Type parameters: 'a, 'b |
Get the value a Prism focuses on, if present.
|
Full Usage:
Optic.set (arg1, arg1) v a
Parameters:
'get
arg1 : 'b -> 'a -> 'a
v : 'b
a : 'a
Returns: 'a
Type parameters: 'get, 'b, 'a |
Set the value a Lens or Prism focuses on. The setter shape ('b -> 'a -> 'a) is identical for both, so one function covers either without needing SRTP/inline dispatch to pick between them.
|
GenPRES