From 48f45676f7c6c79b249b51dde9a6791393860676 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Sat, 15 Mar 2014 15:15:44 +0100 Subject: 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. --- html-test/src/Minimal.hs | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 html-test/src/Minimal.hs (limited to 'html-test/src') 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 -- cgit v1.2.3