From a427f597e081ce37a881e6612efeab7ef0bb0dac Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Mon, 8 Feb 2016 14:37:49 +0100 Subject: hypsrc-test: Accept test output And fix impredicative Polymorphism testcase. --- hypsrc-test/ref/src/Classes.html | 161 ++- hypsrc-test/ref/src/Constructors.html | 77 +- hypsrc-test/ref/src/Identifiers.html | 127 +- hypsrc-test/ref/src/Literals.html | 13 +- hypsrc-test/ref/src/Operators.html | 129 ++- hypsrc-test/ref/src/Polymorphism.html | 2036 +++++++++++++++++++++++++++++++++ hypsrc-test/ref/src/Records.html | 185 ++- hypsrc-test/ref/src/Types.html | 19 +- hypsrc-test/src/Polymorphism.hs | 8 +- 9 files changed, 2374 insertions(+), 381 deletions(-) create mode 100644 hypsrc-test/ref/src/Polymorphism.html (limited to 'hypsrc-test') diff --git a/hypsrc-test/ref/src/Classes.html b/hypsrc-test/ref/src/Classes.html index 74a7a427..abff8877 100644 --- a/hypsrc-test/ref/src/Classes.html +++ b/hypsrc-test/ref/src/Classes.html @@ -1,4 +1,3 @@ - a barbar :: a bazbaz (a, a bar baz x (x, x [a bar baz a a quuxquux (a, a-> a quux (x, y [x, y norfnorf [a-> a norf norf [a quux p plughplugh :: p a a-> p b b-> p (a-> b (b-> a plughLeft aconst aRight aconst aLeft bconst bRight bconst b +> \ No newline at end of file diff --git a/hypsrc-test/ref/src/Constructors.html b/hypsrc-test/ref/src/Constructors.html index 86a482f6..e35ca0b1 100644 --- a/hypsrc-test/ref/src/Constructors.html +++ b/hypsrc-test/ref/src/Constructors.html @@ -1,4 +1,3 @@ - foo n* n foo, xs= xs, xsreverse xs x (f1_ n, f2 f3 x'+ n f1+ aux f3 aux fx f2 fx f3 x'$ x +> \ No newline at end of file diff --git a/hypsrc-test/ref/src/Identifiers.html b/hypsrc-test/ref/src/Identifiers.html index 7680b3ef..f52db4ab 100644 --- a/hypsrc-test/ref/src/Identifiers.html +++ b/hypsrc-test/ref/src/Identifiers.html @@ -1,4 +1,3 @@ - x y= x+ x y x* y+ y x y= y+ x x y- x+ y x y= x* y* y* y* x x x x x x x y z| x x| y y| z z(-x(-y(-z x y z x y z x y z +> \ No newline at end of file diff --git a/hypsrc-test/ref/src/Literals.html b/hypsrc-test/ref/src/Literals.html index a009a502..dfcefc97 100644 --- a/hypsrc-test/ref/src/Literals.html +++ b/hypsrc-test/ref/src/Literals.html @@ -1,4 +1,3 @@ - Num a=> aFractional a=> a[[a +> \ No newline at end of file diff --git a/hypsrc-test/ref/src/Operators.html b/hypsrc-test/ref/src/Operators.html index fe690db2..8ce0b9ce 100644 --- a/hypsrc-test/ref/src/Operators.html +++ b/hypsrc-test/ref/src/Operators.html @@ -1,4 +1,3 @@ - [a [a [aa b= a++ b++ a [a [a [aa b= b a [a [a [a) a= a) a_:b= a (a b[[a [a [aa b b) a[[a[[a[[aa b [a b (a b:: a-> b (c (a, ba b (a, b +> \ No newline at end of file diff --git a/hypsrc-test/ref/src/Polymorphism.html b/hypsrc-test/ref/src/Polymorphism.html new file mode 100644 index 00000000..602246e0 --- /dev/null +++ b/hypsrc-test/ref/src/Polymorphism.html @@ -0,0 +1,2036 @@ +
{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+
+
+module Polymorphism where
+
+
+foo :: a -> a -> a
+foo = undefined
+
+foo' :: forall a. a -> a -> a
+foo' = undefined
+
+bar :: a -> b -> (a, b)
+bar = undefined
+
+bar' :: forall a b. a -> b -> (a, b)
+bar' = undefined
+
+baz :: a -> (a -> [a -> a] -> b) -> b
+baz = undefined
+
+baz' :: forall a b. a -> (a -> [a -> a] -> b) -> b
+baz' = undefined
+
+quux :: a -> (forall a. a -> a) -> a
+quux x f = f x
+
+quux' :: forall a. a -> (forall a. a -> a) -> a
+quux' x f = f x
+
+
+num :: Num a => a -> a -> a
+num = undefined
+
+num' :: forall a. Num a => a -> a -> a
+num' = undefined
+
+eq :: (Eq a, Eq b) => [a] -> [b] -> (a, b)
+eq = undefined
+
+eq' :: forall a b. (Eq a, Eq b) => [a] -> [b] -> (a, b)
+eq' = undefined
+
+mon :: Monad m => (a -> m a) -> m a
+mon = undefined
+
+mon' :: forall m a. Monad m => (a -> m a) -> m a
+mon' = undefined
+
+
+norf :: a -> (forall a. Ord a => a -> a) -> a
+norf x f = x
+
+norf' :: forall a. a -> (forall a. Ord a => a -> a) -> a
+norf' x f = x
+
+
+plugh :: forall a. a -> a
+plugh x = x :: a
+
+thud :: forall a b. (a -> b) -> a -> (a, b)
+thud f x =
+    (x :: a, y) :: (a, b)
+  where
+    y = (f :: a -> b) x :: b
+
\ No newline at end of file diff --git a/hypsrc-test/ref/src/Records.html b/hypsrc-test/ref/src/Records.html index eb4e0fbb..7d23d114 100644 --- a/hypsrc-test/ref/src/Records.html +++ b/hypsrc-test/ref/src/Records.html @@ -1,4 +1,3 @@ - x y{ xx = x, yy = y{ xx = x, yy = y= x* x+ y* y{ xx, yy = y* y+ x* x p d= p{ xx = xx p+ d p d= p{ yy = yy p+ d x y p aux p (dx, dy (x, y aux= p{ xx = x+ dx, yy = y+ dy +> \ No newline at end of file diff --git a/hypsrc-test/ref/src/Types.html b/hypsrc-test/ref/src/Types.html index d59f61f8..a8be9e78 100644 --- a/hypsrc-test/ref/src/Types.html +++ b/hypsrc-test/ref/src/Types.html @@ -1,4 +1,3 @@ - a b a b +> \ No newline at end of file diff --git a/hypsrc-test/src/Polymorphism.hs b/hypsrc-test/src/Polymorphism.hs index a74ac492..3f0103bf 100644 --- a/hypsrc-test/src/Polymorphism.hs +++ b/hypsrc-test/src/Polymorphism.hs @@ -24,10 +24,10 @@ baz' :: forall a b. a -> (a -> [a -> a] -> b) -> b baz' = undefined quux :: a -> (forall a. a -> a) -> a -quux = undefined +quux x f = f x quux' :: forall a. a -> (forall a. a -> a) -> a -quux' = undefined +quux' x f = f x num :: Num a => a -> a -> a @@ -50,10 +50,10 @@ mon' = undefined norf :: a -> (forall a. Ord a => a -> a) -> a -norf = undefined +norf x f = x norf' :: forall a. a -> (forall a. Ord a => a -> a) -> a -norf' = undefined +norf' x f = x plugh :: forall a. a -> a -- cgit v1.2.3