[GHC] #7102: Type family instance overlap accepted in ghci
GHC
cvs-ghc at haskell.org
Tue Oct 16 15:33:32 CEST 2012
#7102: Type family instance overlap accepted in ghci
------------------------------------------+---------------------------------
Reporter: exbb2 | Owner:
Type: bug | Status: closed
Priority: normal | Milestone:
Component: GHCi | Version: 7.4.1
Resolution: wontfix | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: GHC accepts invalid program | Difficulty: Unknown
Testcase: | Blockedby:
Blocking: | Related:
------------------------------------------+---------------------------------
Changes (by igloo):
* status: new => closed
* difficulty: => Unknown
* resolution: => wontfix
Comment:
I'm inclined to say that this is not a bug. In a similar way to how ghci
lets you shadow variables:
{{{
Prelude> let f = 'a'
Prelude> let f = True
Prelude> f
True
}}}
it is letting you shadow type family instances:
{{{
Prelude> :set -XTypeFamilies
Prelude> type family F x :: *
Prelude> type instance F Int = Bool
Prelude> type instance F Int = Char
Prelude> :t undefined :: F Int
undefined :: F Int :: Char
}}}
I think that this makes sense: If you imagine that `F` is defined in some
other package, and you are developing the type on the RHS, then if this
were not possible then you'd have to restart ghci each time you alter the
type.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7102#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list