[Haskell-cafe] ghci module re exporting qualified as

Immanuel Litzroth immanuel.litzroth at gmail.com
Wed Nov 18 12:19:28 UTC 2020


I'm trying to make a test module to run tests.
I want to import the test functionality + imported functionality in
the scope of the test module under ghci.
I also want to have short names in the  Test module for reexported
modules. I am using Data.Map and Data.Set ... so lot's of conflicting
exports.
Is this possible?


#+BEGIN_SRC haskell :tangle T1.hs
module T1 (
   module Data.Map) where
import qualified Data.Map
#+END_SRC

works but no browsing info shows up
#+BEGIN_EXAMPLE
λ⊢ :show modules
T1  ....
λ⊢ :show imports
import T1 -- added automatically
import Prelude -- implicit
λ⊢ fromList []

<interactive>:114:1-8: error:
    Variable not in scope: fromList ∷ [a0] → t
λ⊢ Data.Map.fromList []
fromList []
λ⊢ :browse! T1

λ⊢
#+END_EXAMPLE


#+BEGIN_SRC haskell :tangle T2.hs
module T2 (
   module Map) where
import qualified Data.Map as Map
#+END_SRC

#+BEGIN_EXAMPLE
λ⊢ :show modules
T2
:show imports
import T2 -- added automatically
import Prelude -- implicit
λ⊢ fromList []

<interactive>:119:1-8: error:
    Variable not in scope: fromList ∷ [a0] → t
λ⊢ Map.fromList []

<interactive>:120:1-12: error:
    Not in scope: ‘Map.fromList’
    No module named ‘Map’ is imported.
λ⊢ Data.Map.fromList []
fromList []
λ⊢ :browse! T2

λ⊢
#+END_EXAMPLE


-- 
-- Researching the dual problem of finding the function that has a
given point as fixpoint.


More information about the Haskell-Cafe mailing list