|
[ ghc-Bugs-1186853 ] Kind error cccasionally reported: msg#00109lang.haskell.glasgow.bugs
Bugs item #1186853, was opened at 2005-04-20 18:10 Message generated for change (Comment added) made by simonpj You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1186853&group_id=8032 Category: Compiler Group: 6.4 >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: daniel (jcpetruzza) Assigned to: Nobody/Anonymous (nobody) Summary: Kind error cccasionally reported Initial Comment: Consider an example made of the following two files: 1) TypeDefinition.hs: module TypeDefinition (PublicType) where import Control.Monad.State type PublicType a b = a String b -- type PrivateType = PublicType StateT IO 2) Main.hs module Main where import Control.Monad.State import TypeDefinition(PublicType) type MyType = PublicType StateT IO main :: IO () main = putStrLn "Hello, world" If I try to build Main, I get the following error: bash-2.05b$ ghc --make Main.hs Chasing modules from: Main.hs Compiling TypeDefinition ( ./TypeDefinition.hs, ./TypeDefinition.o ) Compiling Main ( Main.hs, Main.o ) Main.hs:7:37: Kind error: `StateT' is not applied to enough type arguments In the type synonym declaration for `MyType' However, if one uncomments the commented line in TypeDefinition.hs, everything builds ok (even when PrivateType is not visible from Main) I'm using GHC 6.4 on Mandrake 10.1 ---------------------------------------------------------------------- >Comment By: Simon Peyton Jones (simonpj) Date: 2005-04-25 08:20 Message: Logged In: YES user_id=50165 Simon M is exactly right. It's not a bug. Simon PJ ---------------------------------------------------------------------- Comment By: Simon Marlow (simonmar) Date: 2005-04-21 10:14 Message: Logged In: YES user_id=48280 This looks strange, but I think it's the right behaviour. In the absence of any other information about the type variable 'b' in your definition of PublicType, it defaults to kind *. When you uncomment the PrivateType definition, it is instantiated with kind (*->*), so the compiler infers that as the kind for b. I'll leave the bug open until Simon gets back, just in case I'm wrong! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1186853&group_id=8032
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [ ghc-Bugs-485184 ] Manual title pages on the wrong side, SourceForge.net |
|---|---|
| Next by Date: | TH bug reported (GHC 6.4), kyra |
| Previous by Thread: | [ ghc-Bugs-1186853 ] Kind error cccasionally reported, SourceForge.net |
| Next by Thread: | [ ghc-Bugs-1186911 ] Prologue junk?, SourceForge.net |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |