Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/3aa59bbd21b50a44c324187f5215d9b1a12bb003

>---------------------------------------------------------------

commit 3aa59bbd21b50a44c324187f5215d9b1a12bb003
Author: Simon Peyton Jones <[email protected]>
Date:   Fri Dec 23 16:07:05 2011 +0000

    Test Trac #5719

>---------------------------------------------------------------

 tests/indexed-types/should_run/T5719.hs            |   28 ++++++++++++++++++++
 .../should_run/T5719.stdout}                       |    2 +-
 tests/indexed-types/should_run/all.T               |    1 +
 3 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/tests/indexed-types/should_run/T5719.hs 
b/tests/indexed-types/should_run/T5719.hs
new file mode 100644
index 0000000..91ec01a
--- /dev/null
+++ b/tests/indexed-types/should_run/T5719.hs
@@ -0,0 +1,28 @@
+{-# LANGUAGE ConstraintKinds, TypeFamilies, FlexibleInstances #-}
+module Main where
+
+import GHC.Prim (Constraint)
+
+import Prelude hiding (Functor, fmap)
+
+import           Data.Set (Set)
+import qualified Data.Set as S (map, fromList)
+
+class Functor f where
+    type C f a :: Constraint
+    type C f a = ()
+
+    fmap :: (C f a, C f b) => (a -> b) -> f a -> f b
+
+instance Functor Set where
+    type C Set a = Ord a
+    fmap = S.map
+
+instance Functor [] where
+    fmap = map
+--    type C [] a = ()
+
+testList = fmap (+1) [1,2,3]
+testSet  = fmap (+1) (S.fromList [1,2,3])
+
+main = do { print testList; print testSet }
diff --git a/tests/typecheck/should_run/tcrun044.stdout 
b/tests/indexed-types/should_run/T5719.stdout
similarity index 62%
copy from tests/typecheck/should_run/tcrun044.stdout
copy to tests/indexed-types/should_run/T5719.stdout
index 78dbe3d..a7cf4e8 100644
--- a/tests/typecheck/should_run/tcrun044.stdout
+++ b/tests/indexed-types/should_run/T5719.stdout
@@ -1,2 +1,2 @@
-[2,3,3,4]
+[2,3,4]
 fromList [2,3,4]
diff --git a/tests/indexed-types/should_run/all.T 
b/tests/indexed-types/should_run/all.T
index 454e702..c8f1f17 100644
--- a/tests/indexed-types/should_run/all.T
+++ b/tests/indexed-types/should_run/all.T
@@ -6,3 +6,4 @@ test('T4235', normal, compile_and_run, [''])
 
 test('GMapAssoc', normal, compile_and_run, ['-package containers'])
 test('GMapTop',   normal, compile_and_run, ['-package containers'])
+test('T5719', normal, compile_and_run, [''])



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to