summaryrefslogtreecommitdiff
path: root/testsuite/tests/deriving/should_fail/T4846.hs
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2016-02-22 21:32:51 +0100
committerThomas Miedema <thomasmiedema@gmail.com>2016-02-23 12:27:57 +0100
commit6074c108b66ec9cd2230852addb60782a8b17e0a (patch)
treef63eca7bf384b63a70fa19888c4288ab1243ce12 /testsuite/tests/deriving/should_fail/T4846.hs
parent754a2f2bb7416bd7fe453ba7bcb7c089f5ef3b8f (diff)
downloadhaskell-6074c108b66ec9cd2230852addb60782a8b17e0a.tar.gz
Testsuite: delete Windows line endings [skip ci] (#11631)
Diffstat (limited to 'testsuite/tests/deriving/should_fail/T4846.hs')
-rwxr-xr-xtestsuite/tests/deriving/should_fail/T4846.hs74
1 files changed, 37 insertions, 37 deletions
diff --git a/testsuite/tests/deriving/should_fail/T4846.hs b/testsuite/tests/deriving/should_fail/T4846.hs
index 66621c04ee..e9cd180d4c 100755
--- a/testsuite/tests/deriving/should_fail/T4846.hs
+++ b/testsuite/tests/deriving/should_fail/T4846.hs
@@ -1,37 +1,37 @@
-{-# LANGUAGE RankNTypes, ScopedTypeVariables, StandaloneDeriving, GADTs, GeneralizedNewtypeDeriving, DeriveDataTypeable #-}
-
-module Main where
-
-import Data.Typeable
-
-data Expr a where
- Lit :: Typeable a => a -> Expr a
-
-class A a where
- mk :: a
-
-class (Typeable a, A a) => B a where
- mkExpr :: Expr a
- mkExpr = Lit mk
-
--- dfunAE
-instance B a => A (Expr a) where
- mk = mkExpr
-
--- dfunAB
-instance A Bool where
- mk = True
-
-newtype BOOL = BOOL Bool
- deriving (Typeable, A)
-
-instance B Bool
-deriving instance B BOOL --dfunBB
-
-showType :: forall a . Expr a -> String
-showType (Lit _) = show (typeOf (undefined :: a))
-
-test1 = showType (mk :: Expr BOOL) -- Prints "Bool" (wrong?)
-test2 = showType (Lit mk :: Expr BOOL) -- Prints "Main.BOOL" (correct)
-
-main = do { print test1; print test2 }
+{-# LANGUAGE RankNTypes, ScopedTypeVariables, StandaloneDeriving, GADTs, GeneralizedNewtypeDeriving, DeriveDataTypeable #-}
+
+module Main where
+
+import Data.Typeable
+
+data Expr a where
+ Lit :: Typeable a => a -> Expr a
+
+class A a where
+ mk :: a
+
+class (Typeable a, A a) => B a where
+ mkExpr :: Expr a
+ mkExpr = Lit mk
+
+-- dfunAE
+instance B a => A (Expr a) where
+ mk = mkExpr
+
+-- dfunAB
+instance A Bool where
+ mk = True
+
+newtype BOOL = BOOL Bool
+ deriving (Typeable, A)
+
+instance B Bool
+deriving instance B BOOL --dfunBB
+
+showType :: forall a . Expr a -> String
+showType (Lit _) = show (typeOf (undefined :: a))
+
+test1 = showType (mk :: Expr BOOL) -- Prints "Bool" (wrong?)
+test2 = showType (Lit mk :: Expr BOOL) -- Prints "Main.BOOL" (correct)
+
+main = do { print test1; print test2 }