@@ -1,19 +1,19 @@
1module JRecSpec (spec) where
1module JRecSpec (spec) where
4−import Control.Lens ((&), (^.), (.~))
3+import Control.Lens ((&), (.~), (^.))
7spec :: Spec
7spec :: Spec
9 it "polymorphic" $ do
9 it "polymorphic" $ do
10 (ExactRecord (#u := True, #a := 5, #b := 6) & #u .~ 5)
10 (ExactRecord (#u := True, #a := 5, #b := 6) & #u .~ 5)
11− `shouldBe` ExactRecord (#u := 5, #a := 5, #b := 6)
11+ `shouldBe` ExactRecord (#u := 5, #a := 5, #b := 6)
12 it "show" $ do
12 it "show" $ do
13 show (ExactRecord ()) `shouldBe` "{}"
13 show (ExactRecord ()) `shouldBe` "{}"
14 show (ExactRecord (#foo := True)) `shouldBe` "{foo = True}"
14 show (ExactRecord (#foo := True)) `shouldBe` "{foo = True}"
15 show (ExactRecord (#foo := True, #bar := 0)) `shouldBe` "{foo = True, bar = 0}"
15 show (ExactRecord (#foo := True, #bar := 0)) `shouldBe` "{foo = True, bar = 0}"
16− it "get" $ do
16+ it "get" $ do
17 let getA1 :: Record ("a" := Int ': rest) -> Int
17 let getA1 :: Record ("a" := Int ': rest) -> Int
18 getA1 = (^. #a)
18 getA1 = (^. #a)
19 let getA2 :: Record ("u" := Bool ': "a" := Int ': rest) -> Int
19 let getA2 :: Record ("u" := Bool ': "a" := Int ': rest) -> Int
@@ -39,5 +39,3 @@ spec = do
39 `shouldBe` (ExactRecord (#u := True, #a := 8))
39 `shouldBe` (ExactRecord (#u := True, #a := 8))
40 setA2 (ExactRecord (#u := True, #a := 5, #b := 6))
40 setA2 (ExactRecord (#u := True, #a := 5, #b := 6))
41 `shouldBe` (ExactRecord (#u := True, #a := 8, #b := 6))
41 `shouldBe` (ExactRecord (#u := True, #a := 8, #b := 6))