[GHC] #13251: Must perform family consistency check on non-imported identifiers

GHC ghc-devs at haskell.org
Sun Feb 19 19:16:12 UTC 2017


#13251: Must perform family consistency check on non-imported identifiers
-------------------------------------+-------------------------------------
        Reporter:  ezyang            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.1
  checker)                           |
      Resolution:                    |             Keywords:  TypeFamilies
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC accepts       |  Unknown/Multiple
  invalid program                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by rwbarton):

 GHCi lets you use a fully-qualified name to refer to an identifier without
 importing it (similar to TH), so I suppose we ought to treat a module used
 in this way as an instance provider, as well. Example from slyfox,
 involving an orphan instance.
 {{{
 ghci -ignore-package=regex-tdfa-rc
 GHCi, version 8.0.2: http://www.haskell.org/ghc/  :? for help
 Loaded GHCi configuration from /home/slyfox/.ghci
 Prelude C TP CM> "a" Text.Regex.TDFA.=~ "^(a)|(a)$" ::[[ String ]]

 <interactive>:1:1: error:
     • No instance for (Text.Regex.Base.RegexLike.RegexMaker
                          Text.Regex.TDFA.Common.Regex
                          Text.Regex.TDFA.Common.CompOption
                          Text.Regex.TDFA.Common.ExecOption
                          [Char])
         arising from a use of ‘Text.Regex.TDFA.=~’
     • In the expression:
           "a" Text.Regex.TDFA.=~ "^(a)|(a)$" :: [[String]]
       In an equation for ‘it’:
           it = "a" Text.Regex.TDFA.=~ "^(a)|(a)$" :: [[String]]
 Prelude C TP CM> :m Text.Regex.TDFA
 Prelude Text.Regex.TDFA> "a" Text.Regex.TDFA.=~ "^(a)|(a)$" ::[[ String ]]
 [["a","a",""]]
 }}}

 (Actually, we could in principle decide freely whether or not to provide
 the instances here in the sense of making them visible; but we definitely
 have to do the family instance consistency checks.)

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13251#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list