aboutsummaryrefslogtreecommitdiff
path: root/html-test/src
diff options
context:
space:
mode:
authorNiklas Haas <git@nand.wakku.to>2014-03-15 15:15:44 +0100
committerMateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>2014-03-15 18:20:24 +0000
commit48f45676f7c6c79b249b51dde9a6791393860676 (patch)
tree3dd1b9c92fac4f817b0c9158d5ee008098198b6a /html-test/src
parent76bafc9e873ea0a75c2ad40b74310cecad89e245 (diff)
Hide minimal definition for only-method classes
Previously this was not covered by the All xs check since here it is not actually an All, rather a single Var n. This also adds the previously missing html-test/src/Minimal.hs.
Diffstat (limited to 'html-test/src')
-rw-r--r--html-test/src/Minimal.hs40
1 files changed, 40 insertions, 0 deletions
diff --git a/html-test/src/Minimal.hs b/html-test/src/Minimal.hs
new file mode 100644
index 00000000..cd2df930
--- /dev/null
+++ b/html-test/src/Minimal.hs
@@ -0,0 +1,40 @@
+-- | This tests the new MINIMAL pragma present in GHC 7.8
+module Minimal
+ ( Foo(..)
+ , Weird(..)
+ , NoMins(..)
+ , FullMin(..)
+ , PartialMin(ccc)
+ , EmptyMin(..)
+ ) where
+
+class Foo a where
+ -- | Any two of these are required...
+ foo, bar, bat :: a
+
+ -- | .. or just this
+ fooBarBat :: (a,a,a)
+
+ {-# MINIMAL (foo, bar) | (bar, bat) | (foo, bat) | fooBarBat #-}
+
+class Weird a where
+ a,b,c,d,e,f,g :: a
+
+ {-# MINIMAL ((a, b), c | (d | (e, (f | g)))) #-}
+
+class NoMins a where
+ x,y,z :: a
+
+ -- | Has a default implementation!
+ z = x
+
+class FullMin a where
+ aaa,bbb :: a
+
+class PartialMin a where
+ ccc,ddd :: a
+
+class EmptyMin a where
+ eee,fff :: a
+ eee = fff
+ fff = undefined