1. 04 Apr, 2008 1 commit
    • simonpj@microsoft.com's avatar
      Fix Trac #2188: scoping in TH declarations quotes · a27c5f77
      simonpj@microsoft.com authored
      This patch fixes a rather tiresome issue, namely the fact that
      a TH declaration quote *shadows* bindings in outer scopes:
      
        f g = [d| f :: Int
                  f = g
        	    g :: Int
                  g = 4 |]
      
      Here, the outer bindings for 'f' (top-level) and 'g' (local)
      are shadowed, and the inner bindings for f,g should not be
      reported as duplicates.  (Remember they are top-level bindings.)
      
      The actual bug was that we'd forgotten to delete 'g' from the
      LocalRdrEnv, so the type sig for 'g' was binding to the outer
      'g' not the inner one.
      a27c5f77
  2. 29 Mar, 2008 1 commit
  3. 07 Feb, 2008 1 commit
    • Ian Lynagh's avatar
      Convert more UniqFM's back to LazyUniqFM's · d51f42f6
      Ian Lynagh authored
      These fix these failures:
         break008(ghci)
         break009(ghci)
         break026(ghci)
         ghci.prog009(ghci)
         ghci025(ghci)
         print007(ghci)
         prog001(ghci)
         prog002(ghci)
         prog003(ghci)
      at least some of which have this symptom:
          Exception: expectJust prune
      d51f42f6
  4. 17 Jan, 2008 3 commits
  5. 24 Oct, 2007 1 commit
  6. 10 Oct, 2007 1 commit
    • Dan Licata's avatar
      View patterns, record wildcards, and record puns · 6a05ec5e
      Dan Licata authored
      This patch implements three new features:
      * view patterns (syntax: expression -> pat in a pattern)
      * working versions of record wildcards and record puns
      See the manual for detailed descriptions.
      
      Other minor observable changes:
      * There is a check prohibiting local fixity declarations
        when the variable being fixed is not defined in the same let
      * The warn-unused-binds option now reports warnings for do and mdo stmts
      
      Implementation notes: 
      
      * The pattern renamer is now in its own module, RnPat, and the
      implementation is now in a CPS style so that the correct context is
      delivered to pattern expressions.
      
      * These features required a fairly major upheaval to the renamer.
      Whereas the old version used to collect up all the bindings from a let
      (or top-level, or recursive do statement, ...) and put them into scope
      before renaming anything, the new version does the collection as it
      renames.  This allows us to do the right thing with record wildcard
      patterns (which need to be expanded to see what names should be
      collected), and it allows us to implement the desired semantics for view
      patterns in lets.  This change had a bunch of domino effects brought on
      by fiddling with the top-level renaming.
      
      * Prior to this patch, there was a tricky bug in mkRecordSelId in HEAD,
      which did not maintain the invariant necessary for loadDecl.  See note
      [Tricky iface loop] for details.
      6a05ec5e
  7. 06 Sep, 2007 1 commit
    • Simon Marlow's avatar
      FIX #1465, error messages could sometimes say things like "A.T doesn't match A.T" · 42181975
      Simon Marlow authored
      This turned out to be a black hole, however we believe we now have a
      plan that does the right thing and shouldn't need to change again.
      Error messages will only ever refer to a name in an unambiguous way,
      falling back to <package>:<module>.<name> if no unambiguous shorter
      variant can be found.  See HscTypes.mkPrintUnqualified for the
      details.
      
      Earlier hacks to work around this problem have been removed (TcSimplify).
      42181975
  8. 04 Sep, 2007 1 commit
  9. 03 Sep, 2007 1 commit
  10. 01 Sep, 2007 1 commit
  11. 26 Aug, 2007 1 commit
  12. 07 Aug, 2007 2 commits
    • rl@cse.unsw.edu.au's avatar
      Implicitly import NDP stuff when vectorising · 82661b7f
      rl@cse.unsw.edu.au authored
      We add the following declaration to all vectorised modules:
      
        import qualified <NDP interface module> as :NDP
      
      This allows us to refer to NDP stuff by RdrName later on but does not expose
      NDP names to the user's code.
      82661b7f
    • rl@cse.unsw.edu.au's avatar
      Implicitly import NDP stuff when vectorising · 5b2d1420
      rl@cse.unsw.edu.au authored
      We add the following declaration to all vectorised modules:
      
        import qualified <NDP interface module> as :NDP
      
      This allows us to refer to NDP stuff by RdrName later on but does not expose
      NDP names to the user's code.
      5b2d1420
  13. 17 Jul, 2007 1 commit
    • andy@galois.com's avatar
      Adding pushing of hpc translation status through hi files. · c1681a73
      andy@galois.com authored
      Now, if a single module *anywhere* on the module tree is built with
      -fhpc, the binary will enable reading/writing of <bin>.tix.
      
      Previously, you needed to compile Main to allow coverage to operate.
      
      This changes the file format for .hi files; you will need to recompile every library.
      c1681a73
  14. 19 Jun, 2007 1 commit
  15. 14 May, 2007 1 commit
  16. 11 May, 2007 1 commit
  17. 11 Apr, 2007 1 commit
    • Simon Marlow's avatar
      Rationalise GhcMode, HscTarget and GhcLink · 3c22606b
      Simon Marlow authored
      This patch cleans up the GHC API, and adds some functionality: we can
      now compile to object code inside GHCi.
      
      Previously we had:
      
        data GhcMode
          = BatchCompile
          | Interactive
          | OneShot
          | JustTypecheck
          | MkDepend
        
        data HscTarget
          = HscC
          | HscAsm
          | HscJava
          | HscInterpreted
          | HscNothing
      
      There was redundancy here; if GhcMode is Interactive, then only
      HscInterpreted makes sense, and JustTypecheck required HscNothing.
      Now we have:
      
        data GhcMode
          = CompManager       -- ^ --make, GHCi, etc.
          | OneShot           -- ^ ghc -c Foo.hs
          | MkDepend          -- ^ ghc -M, see Finder for why we need this
      
      and HscTarget remains as before.
      
      Previously GhcLink looked like this:
      
        data GhcLink = NoLink | StaticLink
      
      Now we have:
      
        data GhcLink = NoLink | LinkBinary | LinkInMemory
      
      The idea being that you can have an HscTarget of HscAsm (for example)
      and still link in memory.
      
      There are two new flags:
      
        -fobject-code selects object code as the target (selects
                      either -fasm or -fvia-C, whichever is the default)
                      This can be usd with ':set' in GHCi, or on the command line.
      
        -fbyte-code   sets byte-code as the target.  Only works in GHCi.
                      One day maybe this could save the byte code in a file
                      when used outside GHCi.
      
        (names chosen for consistency with -fno-code).
      
      Changes to the GHC API: newSession no longer takes the GhcMode
      argument.  The GhcMode defaults to CompManager, which is usually what
      you want.  To do JustTypecheck now, just set hscTarget to HscNothing.
      3c22606b
  18. 01 Apr, 2007 1 commit
  19. 16 Mar, 2007 1 commit
    • simonpj@microsoft.com's avatar
      Refactor TcRnDriver, and check exports on hi-boot files · ec0b8599
      simonpj@microsoft.com authored
      This patch refactors TcRnDriver to make the top-level structure
      easier to understand.  
      
      The change was driven by Trac #924, and this patch fixes that bug.
      When comparing a module against its hs-boot file, we must ensure that
      the module exports everything that the hs-boot file exports.
      ec0b8599
  20. 21 Feb, 2007 1 commit
    • simonpj@microsoft.com's avatar
      Deal more correctly with orphan instances · eb2bf7ad
      simonpj@microsoft.com authored
      Conal Eliott (Trac #1145) exposed a nasty flaw in the way in which
      orphan instances are computed, when there are functional dependencies
      in the class.  It took me some time to figure out what was going on,
      and led to more refactoring.
      
      Briefly:
      
      * Elaborate comments about orphan-hood and versioning added to IfaceSyn
      * The is_orph field vanishes from InstEnv.Instance
      * Similarly ru_orph vanishes from CoreSyn.CoreRule
      * Orphan-hood is computed in MkIface.instanceToIfaceInst, and
      	MkIface.coreRuleToIfaceRule
      
      Elsewhere just tidying up.
      eb2bf7ad
  21. 20 Feb, 2007 1 commit
    • simonpj@microsoft.com's avatar
      Fix obscure bug in reportDeprecations · 1e9a9216
      simonpj@microsoft.com authored
      Fixes Trac #1128
      Please merge to STABLE
      
      A rather obscure bug related to -fno-implicit-prelude.  
      See Note [Used names with interface not loaded] in RnNames.
      
      Easily fixed, however.  Test is rn051
      
      1e9a9216
  22. 07 Feb, 2007 1 commit
    • simonpj@microsoft.com's avatar
      Fix bug in -ddump-minimal imports Trac #1025 · 057b0446
      simonpj@microsoft.com authored
      The code for -ddump-minimal-imports was erroneously using loadSrcInterface,
      which looks only for *exposed* modules.  It should instead use loadSysInterface
      which looks for all interfaces.
      
      The fix is straightforward.  MERGE to 6.6 branch.
      057b0446
  23. 05 Jan, 2007 1 commit
  24. 06 Nov, 2006 1 commit
  25. 02 Nov, 2006 3 commits
  26. 01 Nov, 2006 1 commit
  27. 23 Oct, 2006 1 commit
  28. 21 Oct, 2006 2 commits
    • chak@cse.unsw.edu.au.'s avatar
      Fix parent position in RnNames.nubAvails · 9530e792
      chak@cse.unsw.edu.au. authored
      - `RnNames.nubAvails', which amalgamates AvailInfo items that belong to the 
        same parent, needs to be careful that the parent name occurs first if it is
        in the list of subnames at all.  (Otherwise, we can get funny export items
        in ifaces.)
      - I discovered this while debugging family import/exports, but I am pretty 
        sure the bug would also have shown up without using families under the 
        right circumstances.
      9530e792
    • chak@cse.unsw.edu.au.'s avatar
      Fix export of associated families with new name parent story · a00334cc
      chak@cse.unsw.edu.au. authored
      Given
      
        module Exp (T)
        where
      
        class C a where
          data T a :: *
      
      we need the AvailInfo for the export item to be C|{T}, not just T.
      This patch achieves that under the new name parent scheme.
      a00334cc
  29. 20 Oct, 2006 1 commit
    • chak@cse.unsw.edu.au.'s avatar
      Fix processing of imports involving ATs with the new name parent code · 4f55ec2c
      chak@cse.unsw.edu.au. authored
      Associated types in import lists require special care and the new name
      parent code broke that.  What's the problem?  in the presence of ATs
      the name parent relation can have a depth of two (not just one as in H98).
      Here is an example:
      
        class GMapKey a where
          data GMap a :: * -> *
        instance GMapKey Int where
          data GMap Int v = GMapInt ...
      
      The data constructor GMapInt's parent is GMap whose parent in turn is the 
      class GMapKey; ie, GMapKey is GMapInt's grand parent.  In H98, data types 
      have no parents (which is in some places in the code represented by making 
      them their own parent).
      
      I fixed this by extending the information in filterImport's occ_env and
      taking the case of associated types explicitly in consideration when 
      processing the various forms of IE items.
      4f55ec2c
  30. 13 Oct, 2006 2 commits
    • simonpj@microsoft.com's avatar
      More refactoring in RnNames · 5ad61e14
      simonpj@microsoft.com authored
      I rather self-indulgently spent a chunk of yesterday working on 
      refactoring RnNames further.  The result is significantly simpler:
      
      * A GlobalRdrElt gets an extra field, gre_par, which records
        the parent (if any) of the name
      
      * ImportAvails has two fields deleted: imp_env and imp_parent.
        The information provided by these fields was only used when
        processing the export list; and the same information is now readily
        generated from the GlobalRdrElts in the GlobalRdrEnv
      
      I also did some tidying up; notably moving AvailEnv stuff from
      TcRnTypes to RnNames.
      
      The result is tha the compiler is some 130 lines shorter than before
      5ad61e14
    • chak@cse.unsw.edu.au.'s avatar
      Keep track of family instance modules · 311b1cdf
      chak@cse.unsw.edu.au. authored
      - Now each modules carries
        (1) a flag saying whether it contains family instance declarations and
        (2) a list of all modules further down in the import tree that contain
            family instance declarations.
        (The information is split into these two parts for the exact same reasons why
        the info about orphan modules is split, too.)
      - This is the first step to *optimised* overlap checking of family instances
        coming from imported modules.
      
      *** WARNING: This patch changes the interface file format! ***
      ***          Recompile libraries and stage2 from scratch!  ***
      311b1cdf
  31. 11 Oct, 2006 2 commits
    • Simon Marlow's avatar
      ab22f4e6
    • Simon Marlow's avatar
      Interface file optimisation and removal of nameParent · b00b5bc0
      Simon Marlow authored
      This large commit combines several interrelated changes:
      
        - IfaceSyn now contains actual Names rather than the special
          IfaceExtName type.  The binary interface file contains
          a symbol table of Names, where each entry is a (package,
          ModuleName, OccName) triple.  Names in the IfaceSyn point
          to entries in the symbol table.
      
          This reduces the size of interface files, which should
          hopefully improve performance (not measured yet).
      
          The toIfaceXXX functions now do not need to pass around
          a function from Name -> IfaceExtName, which makes that
          code simpler.
      
        - Names now do not point directly to their parents, and the
          nameParent operation has gone away.  It turned out to be hard to
          keep this information consistent in practice, and the parent info
          was only valid in some Names.  Instead we made the following
          changes:
      
          * ImportAvails contains a new field 
                imp_parent :: NameEnv AvailInfo
            which gives the family info for any Name in scope, and
            is used by the renamer when renaming export lists, amongst
            other things.  This info is thrown away after renaming.
      
          * The mi_ver_fn field of ModIface now maps to
            (OccName,Version) instead of just Version, where the
            OccName is the parent name.  This mapping is used when
            constructing the usage info for dependent modules.
            There may be entries in mi_ver_fn for things that are not in
            scope, whereas imp_parent only deals with in-scope things.
      
          * The md_exports field of ModDetails now contains
            [AvailInfo] rather than NameSet.  This gives us
            family info for the exported names of a module.
      
      Also:
      
         - ifaceDeclSubBinders moved to IfaceSyn (seems like the
           right place for it).
      
         - heavily refactored renaming of import/export lists.
      
         - Unfortunately external core is now broken, as it relied on
           IfaceSyn.  It requires some attention.
      b00b5bc0
  32. 06 Oct, 2006 1 commit