Module

Data.Lens.Record

Package
purescript-profunctor-lenses
Repository
purescript-contrib/purescript-profunctor-lenses

#propSource

prop :: forall l r1 r2 r a b. IsSymbol l => RowCons l a r r1 => RowCons l b r r2 => SProxy l -> Lens ({  | r1 }) ({  | r2 }) a b

Construct a (type-changing) lens for a record property, by providing a proxy for the Symbol which corresponds to the property label.

The lens is polymorphic in the rest of the row of property labels.

For example:

prop (SProxy :: SProxy "foo")
  :: forall a b r. Lens { foo :: a | r } { foo :: b | r } a b