From fd6701973f4f638967f50cdb7e13c901eed28216 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 11 Aug 2016 12:25:30 -0400 Subject: [PATCH] Replace termA/termB with functions. --- test/InterpreterSpec.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/InterpreterSpec.hs b/test/InterpreterSpec.hs index 6d4ce2d36..8d1cb487b 100644 --- a/test/InterpreterSpec.hs +++ b/test/InterpreterSpec.hs @@ -35,6 +35,6 @@ spec = parallel $ do prop "produces unbiased deletions" $ \ a b -> let (a', b') = (decorate (toTerm a), decorate (toTerm (b :: ArbitraryTerm Text (Record '[Category])))) - termA = cofree $ (pure 0 .: Program .: RNil) :< Indexed [ a', b' ] - termB = cofree $ (pure 0 .: Program .: RNil) :< Indexed [ a' ] in - diffTerms wrap ((==) `on` extract) diffCost termA termB `shouldBe` free (Free (pure (pure 0 .: Program .: RNil) :< Indexed [ cata wrap (fmap pure a'), deleting b' ])) + two a b = cofree $ (pure 0 .: Program .: RNil) :< Indexed [ a, b ] + one a = cofree $ (pure 0 .: Program .: RNil) :< Indexed [ a ] in + diffTerms wrap ((==) `on` extract) diffCost (two a' b') (one a') `shouldBe` free (Free (pure (pure 0 .: Program .: RNil) :< Indexed [ cata wrap (fmap pure a'), deleting b' ]))