aboutsummaryrefslogtreecommitdiff
path: root/html-test/src
diff options
context:
space:
mode:
authorNiklas Haas <git@nand.wakku.to>2014-03-15 15:17:18 +0100
committerMateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>2014-03-15 18:20:26 +0000
commit82ab2c09c19641e0ea89965c9af291043798486d (patch)
treea00a780248c46867d5a6f1483501874521377241 /html-test/src
parent48f45676f7c6c79b249b51dde9a6791393860676 (diff)
Fix issue #281
This is a regression from the data family instances change. Data instances are now distinguished from regular lists by usage of the new class "inst", and the style has been updated to only apply to those. I've also updated the appropriate test case to test this a bit better, including GADT instances with GADT-style records.
Diffstat (limited to 'html-test/src')
-rw-r--r--html-test/src/TypeFamilies.hs16
1 files changed, 11 insertions, 5 deletions
diff --git a/html-test/src/TypeFamilies.hs b/html-test/src/TypeFamilies.hs
index 5cd4480e..a79d503e 100644
--- a/html-test/src/TypeFamilies.hs
+++ b/html-test/src/TypeFamilies.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE TypeFamilies, UndecidableInstances, PolyKinds, TypeOperators, DataKinds, MultiParamTypeClasses #-}
+{-# LANGUAGE TypeFamilies, UndecidableInstances, PolyKinds, TypeOperators, DataKinds, MultiParamTypeClasses, GADTs #-}
-- | Doc for: module TypeFamilies
module TypeFamilies where
@@ -14,6 +14,9 @@ data X
-- | Doc for: data Y
data Y
+-- | Doc for: data Z
+data Z = ZA | ZB
+
-- | Doc for: class Test a
class Test a
@@ -31,7 +34,7 @@ type instance Foo X = Y
type instance Foo Y = X
-- | Doc for: data family Bat a
-data family Bat a :: *
+data family Bat (a :: k) :: *
-- | Doc for: data instance Bat X
data instance Bat X
@@ -39,9 +42,12 @@ data instance Bat X
| BatXX { aaa :: X , bbb :: Y } -- ^ Doc for: BatXX { ... }
-- | Doc for: data instance Bat Y
-data instance Bat Y
- = BatY Y -- ^ Doc for: BatY Y
- | X :+ X -- X :+ X
+data instance Bat Y = BatY Y -- ^ Doc for: BatY Y
+
+-- | Doc for: data instance Bat Z
+data instance Bat (z :: Z) where
+ BatZ1 :: Z -> Bat ZA
+ BatZ2 :: { batx :: X, baty :: Y } -> Bat ZB
-- | Doc for: class Assoc a
class Assoc a where