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 dt

Profunctor 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 dt

Profunctor 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'.

#_0 Source

_0 :: SProxy "value0"

#_1 Source

_1 :: SProxy "value1"

#_2 Source

_2 :: SProxy "value2"

#_3 Source

_3 :: SProxy "value3"

#_4 Source

_4 :: SProxy "value4"

#_5 Source

_5 :: SProxy "value5"

#_6 Source

_6 :: SProxy "value6"

#_7 Source

_7 :: SProxy "value7"

#_8 Source

_8 :: SProxy "value8"

#_9 Source

_9 :: SProxy "value9"