Records that have a field at a given position.
Methods
position :: Lens s t a bA lens that focuses on a field at a given position. Compatible with the lens package's
Control.Lens.Lenstype.Example2 expressions human ^. position @1"Tunyasz"human & position @3 .~ "Berlin"Human {name = "Tunyasz", age = 50, address = "Berlin"}
Type errors
Example1 expression human & position @4 .~ "Berlin"...... The type Human does not contain a field at position 4...
Instances2HasPosition
(Context i s t a b, HasPosition0 i s t a b) => HasPosition i s t a bDefined in generic-lens-2.2.2.0 · Data.Generics.Product.PositionsHasPosition f (Void1 a) (Void1 b) a bDefined in generic-lens-2.2.2.0 · Data.Generics.Product.PositionsUncluttering type signatures (see Void)
Example1 expression :t +d positionposition :: (HasPosition i s t a b, Functor f) => (a -> f b) -> s -> f t