diff options
author | Gabor Greif <ggreif@gmail.com> | 2014-08-28 19:14:39 +0200 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2014-08-29 18:40:08 +0200 |
commit | fa9dd0679ec6b75a22213433e860ccb39e89b975 (patch) | |
tree | b67582fbd2cc7280e61d1ac11e7c53e585c2547c | |
parent | 5da580beacb0da1f7bf8e300e074e5cad88b8bbc (diff) | |
download | haskell-fa9dd0679ec6b75a22213433e860ccb39e89b975.tar.gz |
Do not say we cannot when we clearly can
-rw-r--r-- | testsuite/tests/indexed-types/should_compile/red-black-delete.hs | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/testsuite/tests/indexed-types/should_compile/red-black-delete.hs b/testsuite/tests/indexed-types/should_compile/red-black-delete.hs index 9873463ec0..c1ce0fb71f 100644 --- a/testsuite/tests/indexed-types/should_compile/red-black-delete.hs +++ b/testsuite/tests/indexed-types/should_compile/red-black-delete.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE InstanceSigs,GADTs, DataKinds, KindSignatures, MultiParamTypeClasses, FlexibleInstances, TypeFamilies #-} +{-# LANGUAGE InstanceSigs, GADTs, StandaloneDeriving, DataKinds, KindSignatures, MultiParamTypeClasses, FlexibleInstances, TypeFamilies #-} -- Implementation of deletion for red black trees by Matt Might -- Editing to preserve the red/black tree invariants by Stephanie Weirich, @@ -12,7 +12,6 @@ module MightRedBlackGADT where import Prelude hiding (max) --- import Test.QuickCheck hiding (elements) import Data.List(nub,sort) import Control.Monad(liftM) import Data.Type.Equality @@ -61,19 +60,8 @@ type instance Incr NegativeBlack (S n) = n data RBSet a where Root :: (CT n Black a) -> RBSet a --- We can't automatically derive show and equality --- methods for GADTs. -instance Show (SColor c) where - show R = "R" - show B = "B" - show BB = "BB" - show NB = "NB" - -instance Show a => Show (CT n c a) where - show E = "E" - show (T c l x r) = - "(T " ++ show c ++ " " ++ show l ++ " " - ++ show x ++ " " ++ show r ++ ")" +deriving instance Show (SColor c) +deriving instance Show a => Show (CT n c a) instance Show a => Show (RBSet a) where show (Root x) = show x |