Changes between Version 3 and Version 4 of Commentary/Compiler/UnusedImports


Ignore:
Timestamp:
Jul 1, 2009 12:23:01 PM (6 years ago)
Author:
igloo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/UnusedImports

    v3 v4  
    147147data ImportInfo = ImportInfo SrcSpan
    148148                             SDoc
     149                             (Maybe ModuleName) -- The effective module name
    149150                             [RdrName] -- The names the import provides
    150151                             Bool -- Has it been used yet?
    151152                             [ImportInfo] -- Child import infos
    152153}}}
    153 Here are how some example imports map to trees of `ImportInfo`, assuming `Foo` exports `a`, `b`, `D(c1, c2)`:
     154Here are how some example imports map to trees of `ImportInfo`, assuming `Foo` exports `a`, `b`, `D(c1, c2)`. Only the `SDoc` and `[RdrName]` fields are given, as that's the interesting bit.
    154155{{{
    155156import Foo
     
    164165->
    165166ImportInfo "Foo" []
    166     ImportInfo "Foo" ["Foo.a"]
    167     ImportInfo "Foo" ["Foo.D"]
     167    ImportInfo "a" ["Foo.a"]
     168    ImportInfo "D" ["Foo.D"]
    168169
    169170import qualified Foo hiding (a, D(..))
     
    174175->
    175176ImportInfo "Foo" []
    176     ImportInfo "Foo" ["D", "Foo.D"]
    177         ImportInfo "Foo" ["c1", "Foo.c1"]
    178         ImportInfo "Foo" ["c2", "Foo.c2"]
     177    ImportInfo "D" ["D", "Foo.D"]
     178        ImportInfo "c1" ["c1", "Foo.c1"]
     179        ImportInfo "c2" ["c2", "Foo.c2"]
    179180
    180181import qualified Foo (D(..))
    181182->
    182183ImportInfo "Foo" []
    183     ImportInfo "Foo" ["Foo.D", "Foo.c1", "Foo.c2"]
     184    ImportInfo "D(..)" ["Foo.D", "Foo.c1", "Foo.c2"]
    184185}}}
    185186
     
    187188{{{
    188189ImportInfo "Foo" []
    189     ImportInfo "Foo" ["D", "Foo.D"]
    190         ImportInfo "Foo" ["c1", "Foo.c1"]
    191         ImportInfo "Foo" ["c2", "Foo.c2"]
     190    ImportInfo "D" ["D", "Foo.D"]
     191        ImportInfo "c1" ["c1", "Foo.c1"]
     192        ImportInfo "c2" ["c2", "Foo.c2"]
    192193}}}
    193194a use of `"D"` marks both the first and second lines as used.