Module
Data.Generic.Rep.Optic
- Package
- purescript-generics-rep-optics
- Repository
- LiamGoodacre/purescript-generics-rep-optics
#genericCtor' Source
genericCtor' :: forall p arg ct rep dt. Profunctor p => Generic dt rep => Ctor ct rep (Argument arg) p => SProxy ct -> p arg arg -> p dt dtProfunctor optic into a single argument constructor of a data type with a generic representation.
Due to limitations of generics-rep, record arguments do not count as single arguments.
If there is only one constructor then the optic is an Iso', otherwise
we get a Prism'.
#genericArg' Source
genericArg' :: forall p arg fd ct rep dt. Profunctor p => Generic dt rep => CtorArg ct fd rep arg p => SProxy ct -> SProxy fd -> p arg arg -> p dt dtProfunctor optic into a named argument of a named constructor of a data type with a generic representation.
If there are multiple constructors in the data type then
we will require Choice p. If there are multiple fields
in the selected constructor, then we require Strong p.
Depending on these constraints you will get either a
Prism', a Lens', or a Traversal'.