@@ -33,14 +33,20 @@ exampleData = ReprObject objectData
34spec :: Spec
34spec :: Spec
37+ newFooVal = FieldRepr $ ReprArray [ReprNumber 15]
38+ fooProxy = Proxy @"foo"
36 it "gets the field from an object" $ do
39 it "gets the field from an object" $ do
37− fget (Proxy :: Proxy "foo") objectData == arrayField
40+ fget fooProxy objectData == arrayField
38− -- it "sets the object field" $ do
41+ it "sets the object field" $ do
39− -- fset (FieldRepr :: FieldRepr '("foo", ArrayField))
42+ fget fooProxy (fput newFooVal objectData) == newFooVal
41 describe "(using lens library) " $ do
44 describe "(using lens library) " $ do
42 it "get the field from an object" $ do
45 it "get the field from an object" $ do
43− objectData ^. (flens (Proxy :: Proxy "foo")) == arrayField
46+ objectData ^. flens (Proxy @"foo") == arrayField
47+ it "sets the object field" $ do
48+ set (flens (Proxy @"foo")) newFooVal objectData ^. flens (Proxy @"foo")
45main :: IO ()
51main :: IO ()
46main = hspec spec
52main = hspec spec