#5619: Shorter qualified import statements
---------------------------------+------------------------------------------
Reporter: YvesPares | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: 7.6.1
Component: Compiler | Version: 7.2.1
Keywords: | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
Changes (by igloo):
* milestone: => 7.6.1
Comment:
I dislike this concrete example, as it looks like `(!)` is only available
as `(Data.Vector.!)`, not `(!)`.
How about
{{{
import M (a)
qualified (b)
qualified as X (c)
as X (d)
}}}
to bring `a`, `M.a`, `M.b`, `X.c`, `d`, `X.d` into scope?
For the common Data.Set sort of case we would have:
{{{
import Data.Set (Set)
qualified as Set (..)
}}}
BNF for the new syntax would be something like:
{{{
decl -> "import" modname imptype -- explicit import list not
needed in degenerate single-import case
| "import" modname { imptype implist } -- could restrict length of
the list of imports >= 2
imptype -> "qualified" "as" modname
| "qualified"
| "as" modname
|
implist -> implist'
| "hiding" implist'
implist' -> "(" ".." ")" -- import everything
| "(" { import } ")"
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5619#comment:1>
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