@@ -0,0 +1,14 @@
1+{-# LANGUAGE DataKinds, DeriveGeneric, TypeApplications #-}
2+module Test62 (example) where
3+import Data.Generics.Product (field)
4+import Data.Generics.Internal.VL.Lens (set)
5+import GHC.Generics (Generic)
6+
7+data Foo a = Foo { bar :: Bar a } deriving Generic
8+data Bar a = Bar { x :: a, y :: a } deriving Generic
9+
10+example :: Foo ()
11+example =
12+ set (field @"bar" . field @"x") ()
13+ . set (field @"bar" . field @"y") ()
14+ $ Foo{ bar = Bar{ x = (), y = () } }