@@ -33,14 +33,20 @@ exampleData = ReprObject objectData
3333
3434spec :: Spec
3535spec = do
36+ let
37+ newFooVal = FieldRepr $ ReprArray [ReprNumber 15]
38+ fooProxy = Proxy @"foo"
3639 it "gets the field from an object" $ do
37− fget (Proxy :: Proxy "foo") objectData == arrayField
38− -- it "sets the object field" $ do
39− -- fset (FieldRepr :: FieldRepr '("foo", ArrayField))
40+ fget fooProxy objectData == arrayField
41+ it "sets the object field" $ do
42+ fget fooProxy (fput newFooVal objectData) == newFooVal
4043
4144 describe "(using lens library) " $ do
4245 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")
49+ == newFooVal
4450
4551main :: IO ()
4652main = hspec spec