[GHC] #9146: GHC.TypeLits import don't quite work

#9146: GHC.TypeLits import don't quite work ------------------------------------+------------------------------------- Reporter: yuriyt | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- If you explicitly import any of the things that are Compiler Magic from `GHC.TypeLits` you get an error: {{{ import GHC.TypeLits ((+), (-)) ... }}} {{{ [1 of 1] Compiling Main ( typelit_export_bug.hs, interpreted ) typelit_export_bug.hs:1:22: Module `GHC.TypeLits' does not export `(+)' typelit_export_bug.hs:1:27: Module `GHC.TypeLits' does not export `(-)' Failed, modules loaded: none. }}} If you do the opposite, it also doesn't work {{{ import GHC.TypeLits hiding ((+), (-)) ... }}} {{{ [1 of 1] Compiling Main ( typelit_export_bug.hs, interpreted ) typelit_export_bug.hs:3:1: Warning: Module `GHC.TypeLits' does not export `(+)' typelit_export_bug.hs:3:1: Warning: Module `GHC.TypeLits' does not export `(-)' }}} The use case is that I would like to define my own `+` and have one instance for `Nat` and others for other types of my choosing. It isn't more than a minor annoyance, however, there aren't many thing defined in `GHC.TypeLits` so I can write `import qualified GHC.TypeLits; import GHC.TypeLits (Nat, natVal, Symbol, symbolVal ...` -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9146 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9146: GHC.TypeLits import don't quite work -------------------------------------+------------------------------------ Reporter: yuriyt | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by rwbarton): * status: new => closed * resolution: => invalid Comment: Your import statement tries to import (ordinary value-level) ''functions'' `(+)`, `(-)` from `GHC.TypeLits`. Instead, use the `ExplicitNamespaces` language extension and write {{{ import GHC.TypeLits (type (+), type (-)) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9146#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC