[GHC] #5719: Empty tuple doesn't have kind Constraint
GHC
cvs-ghc at haskell.org
Fri Dec 23 10:44:40 CET 2011
#5719: Empty tuple doesn't have kind Constraint
---------------------------------+------------------------------------------
Reporter: simonpj | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.3
Keywords: | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: None/Unknown
Difficulty: Unknown | Testcase:
Blockedby: | Blocking:
Related: |
---------------------------------+------------------------------------------
Bas reports that this program does not work:
{{{
{-# 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
testList = fmap (+1) [1,2,3]
testSet = fmap (+1) (S.fromList [1,2,3])
main = do { print testList; print testSet }
}}}
There's a complaint like
{{{
Foo.hs:13:16:
Kind mis-match
Expected kind `* -> Constraint', but `!()' has kind `*'
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5719>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list