Skip to content

No way to import a data instance

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

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.

Trac metadata
Trac field Value
Version 7.10.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information