Commit 6a70b5ac authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Test Trac #5719

parent fd9bfbd5
{-# 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 }
......@@ -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, [''])
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment