Browse Source

Refactioring

Nicolas Lenz 2 months ago
parent
commit
01c662de00
2 changed files with 5 additions and 6 deletions
  1. 0
    1
      src/Katrin.hs
  2. 5
    5
      test/Main.hs

+ 0
- 1
src/Katrin.hs View File

@@ -28,7 +28,6 @@ foldListExample :: Int
28 28
 foldListExample = foldList (ListAlg 0 (+)) (Cons 1 $ Cons 2 $ Cons 42 Nil)  -- = 1 + 2 + 42 = 45
29 29
 
30 30
 
31
-
32 31
 -- | An example type definition for natural numbers.
33 32
 -- Corresponds to "data Nat = One | Succ Nat".
34 33
 typeExampleNat :: TypeDef

+ 5
- 5
test/Main.hs View File

@@ -18,7 +18,7 @@ prop_foldTermKatrinIdentic :: Katrin -> Bool
18 18
 prop_foldTermKatrinIdentic k = foldKatrin katrinAlgTerm k == k
19 19
 
20 20
 instance Arbitrary Katrin where
21
-    arbitrary = sized $ \n -> Katrin <$> (resize (n`div`2) arbitrary) <*> (resize (n`div`2) arbitrary)
21
+    arbitrary = sized $ \n -> Katrin <$> resize (n`div`2) arbitrary <*> resize (n`div`2) arbitrary
22 22
 
23 23
 instance Arbitrary ValueId where
24 24
     arbitrary = ValueId <$> resize 5 arbitrary
@@ -34,16 +34,16 @@ instance Arbitrary TypeExp where
34 34
     arbitrary = sized $ \n ->
35 35
         frequency [
36 36
             (1, ProductType <$> arbitrary <*> arbitrary),
37
-            (n, SumType <$> (resize (n`div`2) arbitrary) <*> (resize (n`div`2) arbitrary))]
37
+            (n, SumType <$> resize (n`div`2) arbitrary <*> resize (n`div`2) arbitrary)]
38 38
 
39 39
 instance Arbitrary Def where
40 40
     arbitrary = sized $ \n ->
41
-        Def <$> arbitrary <*> (resize (n`div`2) arbitrary) <*> (resize (n`div`2) arbitrary)
41
+        Def <$> arbitrary <*> resize (n`div`2) arbitrary <*> resize (n`div`2) arbitrary
42 42
 
43 43
 instance Arbitrary Exp where
44 44
     arbitrary = sized $ \n ->
45 45
         frequency [
46 46
             (1, Literal <$> arbitrary),
47
-            (n, Application <$> (resize (n`div`2) arbitrary) <*> (resize (n`div`2) arbitrary)),
47
+            (n, Application <$> resize (n`div`2) arbitrary <*> resize (n`div`2) arbitrary),
48 48
             (1, Variable <$> arbitrary),
49
-            (n, Lambda <$> (resize (n`div`2) arbitrary) <*> (resize (n`div`2) arbitrary))]
49
+            (n, Lambda <$> resize (n`div`2) arbitrary <*> resize (n`div`2) arbitrary)]

Loading…
Cancel
Save