aboutsummaryrefslogtreecommitdiff
path: root/hoogle-test
diff options
context:
space:
mode:
authorŁukasz Hanuszczak <lukasz.hanuszczak@gmail.com>2015-08-19 17:07:25 +0200
committerŁukasz Hanuszczak <lukasz.hanuszczak@gmail.com>2015-08-22 23:40:28 +0200
commit3378ef409170ae1f319c934876d2b9e1a14bb9a8 (patch)
tree8750a9412a1f2ba91a7e248149480354d8e0e6e3 /hoogle-test
parent7d0317a9210ddbb4f00976318910018fa9abea99 (diff)
Create simple test cases for Hoogle backend.
Diffstat (limited to 'hoogle-test')
-rw-r--r--hoogle-test/src/assoc-types/AssocTypes.hs23
-rw-r--r--hoogle-test/src/classes/Classes.hs16
-rw-r--r--hoogle-test/src/fixity/Fixity.hs12
-rw-r--r--hoogle-test/src/modules/Bar.hs12
-rw-r--r--hoogle-test/src/modules/Foo.hs9
5 files changed, 72 insertions, 0 deletions
diff --git a/hoogle-test/src/assoc-types/AssocTypes.hs b/hoogle-test/src/assoc-types/AssocTypes.hs
new file mode 100644
index 00000000..a9bdc6d8
--- /dev/null
+++ b/hoogle-test/src/assoc-types/AssocTypes.hs
@@ -0,0 +1,23 @@
+{-# LANGUAGE TypeFamilies #-}
+
+
+module AssocTypes where
+
+
+class Foo a where
+
+ type Bar a b
+ type Baz a
+
+ type Baz a = [(a, a)]
+
+ bar :: Bar a a
+ bar = undefined
+
+
+instance Foo [a] where
+
+ type Bar [a] Int = [(a, Bool)]
+ type Bar [a] Bool = [(Int, a)]
+
+ type Baz [a] = (a, a, a)
diff --git a/hoogle-test/src/classes/Classes.hs b/hoogle-test/src/classes/Classes.hs
new file mode 100644
index 00000000..23f68499
--- /dev/null
+++ b/hoogle-test/src/classes/Classes.hs
@@ -0,0 +1,16 @@
+module Classes where
+
+
+class Foo f where
+
+ bar :: f a -> f b -> f (a, b)
+ baz :: f ()
+
+ baz = undefined
+
+
+class Quux q where
+
+ (+++), (///) :: q -> q -> q
+ (***), logBase :: q -> q -> q
+ foo, quux :: q -> q -> q
diff --git a/hoogle-test/src/fixity/Fixity.hs b/hoogle-test/src/fixity/Fixity.hs
new file mode 100644
index 00000000..3af38117
--- /dev/null
+++ b/hoogle-test/src/fixity/Fixity.hs
@@ -0,0 +1,12 @@
+module Fixity where
+
+
+(+++), (***), (///) :: a -> a -> a
+(+++) = undefined
+(***) = undefined
+(///) = undefined
+
+
+infix 6 +++
+infixl 7 ***
+infixr 8 ///
diff --git a/hoogle-test/src/modules/Bar.hs b/hoogle-test/src/modules/Bar.hs
new file mode 100644
index 00000000..156a835f
--- /dev/null
+++ b/hoogle-test/src/modules/Bar.hs
@@ -0,0 +1,12 @@
+module Bar where
+
+
+import Foo
+
+
+bar :: Int -> Int
+bar x = foo' x x
+
+
+bar' :: Int -> Int -> Int
+bar' x y = foo' (bar (foo x)) (bar (foo y))
diff --git a/hoogle-test/src/modules/Foo.hs b/hoogle-test/src/modules/Foo.hs
new file mode 100644
index 00000000..6581fe4c
--- /dev/null
+++ b/hoogle-test/src/modules/Foo.hs
@@ -0,0 +1,9 @@
+module Foo where
+
+
+foo :: Int -> Int
+foo = (* 2)
+
+
+foo' :: Int -> Int -> Int
+foo' x y = foo x + foo y