#959: Debugging info(?) leaks out: "Urk! Inventing strangely-kinded void TyCon"
-------------------------------------+--------------------------------------
Reporter: igloo | Owner:
Type: bug | Status: new
Priority: normal | Milestone: _|_
Component: Compiler (Type checker) | Version: 6.6
Severity: minor | Resolution:
Keywords: | Difficulty: Unknown
Testcase: tcfail188 | Architecture: Unknown
Os: Unknown |
-------------------------------------+--------------------------------------
Comment (by magnushiie):
A real-world example of the same error:
{{{
-- Specifying -fno-monomorphism-restriction removes the error
--{-# OPTIONS_GHC -fno-monomorphism-restriction #-}
module ParsecWrap where
import Control.Monad.Trans
import qualified Text.ParserCombinators.Parsec as P
-- these work without type signature
many1 f = lift $ P.many1 f
oneOf cs = lift $ P.oneOf cs
{-
:t many1
many1 :: (MonadTrans t) =>
P.GenParser tok st a -> t (P.GenParser tok st) [a]
:t oneOf
oneOf :: (MonadTrans t) => [Char] -> t (P.GenParser Char st) Char
-}
--anyChar :: MonadTrans t => t (P.GenParser Char st) Char
anyChar = lift $ P.anyChar
{-
Without type signature on anyChar, gives:
Urk! Inventing strangely-kinded void TyCon:
:t{tc a1vc}
(* -> *) -> * -> *
D:\Dev\Test\ParseCpp\src\ParsecWrap.hs:30:10:
Ambiguous type variable `t' in the constraint:
`MonadTrans t'
arising from use of `lift'
at D:\Dev\Test\ParseCpp\src\ParsecWrap.hs:30:10-13
Possible cause: the monomorphism restriction applied to the following:
anyChar :: forall st. t (P.GenParser Char st) Char
(bound at D:\Dev\Test\ParseCpp\src\ParsecWrap.hs:30:0)
Probable fix: give these definition(s) an explicit type signature
or use -fno-monomorphism-restriction
Failed, modules loaded: none.
-}
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/959#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs