From 484ed765f0830679808dc15bb21c023c10e334e5 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Tue, 31 May 2016 20:17:49 -0400 Subject: [PATCH] Use the field accessor to define unTerm. --- test/ArbitraryTerm.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/ArbitraryTerm.hs b/test/ArbitraryTerm.hs index 8a2134daf..b27592163 100644 --- a/test/ArbitraryTerm.hs +++ b/test/ArbitraryTerm.hs @@ -24,8 +24,7 @@ newtype ArbitraryTerm a annotation = ArbitraryTerm { unArbitraryTerm :: TermF a deriving (Show, Eq, Generic) unTerm :: ArbitraryTerm a annotation -> Term a annotation -unTerm = unfold unpack - where unpack (ArbitraryTerm (annotation :< syntax)) = annotation :< syntax +unTerm = unfold unArbitraryTerm instance (Eq a, Eq annotation, Arbitrary a, Arbitrary annotation) => Arbitrary (ArbitraryTerm a annotation) where arbitrary = scale (`div` 2) $ sized (\ x -> boundedTerm x x) -- first indicates the cube of the max length of lists, second indicates the cube of the max depth of the tree