#2418: desugaring type function application to constraint makes bug disappear
-------------------------------------+--------------------------------------
Reporter: claus | Owner:
Type: bug | Status: closed
Priority: normal | Milestone: 6.10.1
Component: Compiler (Type checker) | Version: 6.9
Severity: normal | Resolution: duplicate
Keywords: type families | Difficulty: Unknown
Testcase: | Architecture: Unknown
Os: Unknown |
-------------------------------------+--------------------------------------
Comment (by claus):
Replying to [comment:3 chak]:
> This is actually a duplicate of #2146 (which more accurately pinpoints
the underlying problem).
How so? I had some trouble reconstructing the intended example in #2146,
but given the implicit constraints (higher-kinded & ignores first
parameter), I assume it is something like:
{{{
{-# LANGUAGE TypeFamilies #-}
type family F a :: * -> *
type instance F a = (,) String
foo :: (F Int a ~ F Int [a]) => a -> [a]
foo = undefined
foo' :: (F Int a ~ F Bool [a]) => a -> [a]
foo' = undefined
}}}
for which `GHCi, version 6.9.20080514` (a version that fails the
desugaring test) gives the expected errors
{{{
C:\Documents and Settings\cr3\Desktop\F.hs:6:0:
Occurs check: cannot construct the infinite type: a = [a]
When generalising the type(s) for `foo'
C:\Documents and Settings\cr3\Desktop\F.hs:9:0:
Occurs check: cannot construct the infinite type: a = [a]
When generalising the type(s) for `foo''
Failed, modules loaded: none.
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2418#comment:4>
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