Closed glocq closed 1 year ago
The Raylib.Types modules contains many nested record types, which may need to be accessed deep inside.
Raylib.Types
This pull request implements lenses for those record types, which allow compositionally getting, setting, modifying the insides of data types.
P.S.: Note that the abstract "lenses" here obviously have nothing to do with camera lenses, even though there are camera data types in this library. For more information about lenses, see e.g. https://hackage.haskell.org/package/lens-tutorial-1.0.4/docs/Control-Lens-Tutorial.html
P.P.S.: If for some reason the dependency on the lens package is an issue, it can be removed without too much effort; see https://github.com/ekmett/lens/wiki/How-can-I-write-lenses-without-depending-on-lens%3F
lens
Published in version 4.6.0.3
4.6.0.3
The
Raylib.Types
modules contains many nested record types, which may need to be accessed deep inside.This pull request implements lenses for those record types, which allow compositionally getting, setting, modifying the insides of data types.
P.S.: Note that the abstract "lenses" here obviously have nothing to do with camera lenses, even though there are camera data types in this library. For more information about lenses, see e.g. https://hackage.haskell.org/package/lens-tutorial-1.0.4/docs/Control-Lens-Tutorial.html
P.P.S.: If for some reason the dependency on the
lens
package is an issue, it can be removed without too much effort; see https://github.com/ekmett/lens/wiki/How-can-I-write-lenses-without-depending-on-lens%3F