[GHC] #11164: No way to import a data instance

GHC ghc-devs at haskell.org
Fri Dec 4 14:29:26 UTC 2015


#11164: No way to import a data instance
-------------------------------------+-------------------------------------
           Reporter:  Feuerbach      |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  7.10.2
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 {{{#!hs
 import Foreign.R.Type as R (SComplex)
 }}}

 results in

 {{{
     In module ‘Foreign.R.Type’:
       ‘SComplex’ is a data constructor of ‘Sing’
     To import it use
       ‘import’ Foreign.R.Type( Sing( SComplex ) )
     or
       ‘import’ Foreign.R.Type( Sing(..) )
 }}}

 But if I try the suggested

 {{{#!hs
 import Foreign.R.Type as R (Sing(SComplex))
 }}}

 I get

 {{{
     Module ‘Foreign.R.Type’ does not export ‘Sing(SComplex)’
 }}}

 So, when a module defines a data instance but does not export the family,
 there appears to be no way to bring that instance in scope (short of
 importing the whole module).

 Here's the module itself
 http://haddock.stackage.org/nightly-2015-10-19/inline-r-0.7.1.2/Foreign-R-Type.html.
 It doesn't have an explicit export list; that's how it manages to export
 instances without the family itself.

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


More information about the ghc-tickets mailing list