#2362: allow full import syntax in GHCi
---------------------------------+------------------------------------------
Reporter: Isaac Dupree | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: 6.10 branch
Component: Compiler | Version: 6.8.2
Severity: normal | Resolution:
Keywords: ghci, import | Difficulty: Unknown
Testcase: | Os: Unknown/Multiple
Architecture: Unknown/Multiple |
---------------------------------+------------------------------------------
Comment (by thoughtpolice):
Given the example that `:load` can load up qualified names as seen above,
I don't think this would be too hard to add; if this is to be done, the
GHC API seems like the best place to make the change, so ghc-api clients
can use it too (like lambdabot.)
Since everything is basically wrapped in a do block, should we just extend
that to allow full haskell98-style imports? e.g.
{{{
*Prelude> import Data.ByteString.Char8 (pack)
*Prelude Data.ByteString.Char8> import qualified Data.ByteString.Char8 as
B
*Prelude Data.ByteString.Char8 B> let x = pack "hi"
*Prelude Data.ByteString.Char8 B> B.length x
2
*Prelude Data.ByteString.Char8 B>
}}}
Or, should we only allow GHCi to import things this way? Perhaps by just
making an `:import` command or extending `:module` to allow full import
syntax? Something like,
{{{
*Prelude>:m +qualified Data.Text as T
*Prelude T>:t T.null
T.Text
*Prelude T>:m-T
*Prelude>
}}}
Trac #1895 seems to indicate that several people want this feature, so I'm
wondering if anybody has any objections/sees any problems, or has a better
idea? I'd be willing to try and work on this for 6.12 if we can get an
idea of what we want.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2362#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs