haskell - Should lens generation be treated like instances -
I have a definition of data type in another library, I want to stop in that datatype with the lens generated by the control. Lens Library
Do I need my type of new type in my code or is the previously defined data type lens considered safe?
You do not need a new type. There are actually several packages on the package which are already available For example, or even lens
) define the lens.
The problem of defining examples is that there is no way to hide them. If you define a lens, you can hide them when importing like any other function:
import module Hiding the lens (some people made lenses, ...)
It is not possible with examples (see for reasons). Unlike the examples, the lens also does not have to be globally unique.
Comments
Post a Comment