From 82ab2c09c19641e0ea89965c9af291043798486d Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Sat, 15 Mar 2014 15:17:18 +0100 Subject: 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. --- html-test/src/TypeFamilies.hs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'html-test/src/TypeFamilies.hs') 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 -- cgit v1.2.3