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.
  2. 03 Apr, 2008 1 commit
  3. 29 Feb, 2008 1 commit
  4. 28 Feb, 2008 1 commit
    • chak@cse.unsw.edu.au.'s avatar
      Remove GADT refinements, part 1 · 4226903d
      chak@cse.unsw.edu.au. authored
      - A while ago, I changed the type checker to use equality constraints together
        with implication constraints to track local type refinement due to GADT
        pattern matching.  This patch is the first of a number of surgical strikes
        to remove the resulting dead code of the previous GADT refinement machinery.
        Hurray to code simplification!
  5. 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:
      at least some of which have this symptom:
          Exception: expectJust prune
  6. 17 Jan, 2008 1 commit
  7. 21 Nov, 2007 1 commit
    • simonpj@microsoft.com's avatar
      Make rebindable do-notation behave as advertised · 1d1c3c72
      simonpj@microsoft.com authored
      Adopt Trac #1537.  The patch ended up a bit bigger than I expected,
      so I suggest we do not merge this into the 6.8 branch.  But there
      is no funadamental reason why not.
      With this patch, rebindable do-notation really does type as if you
      had written the original (>>) and (>>=) operations in desguared form.
      I ended up refactoring some of the (rather complicated) error-context
      stuff in TcUnify, by pushing an InstOrigin into tcSubExp and its
      various calls. That means we could get rid of tcFunResTy, and the
      SubCtxt type.  This should improve error messages slightly
      in complicated situations, because we have an Origin to hand
      to instCall (in the (isSigmaTy actual_ty) case of tc_sub1).
      Thanks to Pepe for the first draft of the patch.
  8. 06 Nov, 2007 2 commits
    • simonpj@microsoft.com's avatar
      Fix Trac #1814 (staging interaction in Template Haskell and GHCi), and add comments · 3f1b316d
      simonpj@microsoft.com authored
      An Id bound by GHCi from a previous Stmt is Global but Internal, and
      I'd forgotten that, leading to unnecessary restrictions when using TH
      and GHCi together.
      This patch fixes the problem and adds lots of explanatory comments (which
      is where most of the extra lines come from).
    • Simon Marlow's avatar
      GHC API: add checkAndLoadModule · 7379e82a
      Simon Marlow authored
      Does what the name suggests: it performs the function of both
      checkModule and load on that module, avoiding the need to process each
      module twice when checking a batch of modules.  This will make Haddock
      and ghctags much faster.
      Along with this is the beginnings of a refactoring of the HscMain
      interface.  HscMain now exports functions for separately running the
      parser, typechecher, and generating ModIface and ModDetails.
      Eventually the plan is to complete this interface and use it to
      replace the existing one.
  9. 02 Nov, 2007 1 commit
    • simonpj@microsoft.com's avatar
      Refactor error recovery slightly · b9a98f56
      simonpj@microsoft.com authored
      Mostly this patch is refacoring, but it also avoids post-tc zonking if
      the typechecker found errors.  This is good because otherwise with
      DEBUG you can get the "Inventing strangely-kinded TyCon" warning.
  10. 01 Nov, 2007 1 commit
    • David Waern's avatar
      Refactor Haddock options · 03d8585e
      David Waern authored
      This patch renames the DOC_OPTIONS pragma to OPTIONS_HADDOCK. It also
      adds "-- # ..."-style Haddock option pragmas, for compatibility with
      code that use them.
      Another change is that both of these two pragmas behave like
      OPTIONS_GHC, i.e. they are only allowed at the top of the module, they
      are ignored everywhere else and they are stored in the dynflags. There is
      no longer any Haddock options in HsSyn.
      Please merge this to the 6.8.2 branch when 6.8.1 is out, if appropriate.
  11. 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.
  12. 05 Sep, 2007 1 commit
  13. 04 Sep, 2007 1 commit
  14. 03 Sep, 2007 1 commit
  15. 01 Sep, 2007 1 commit
  16. 30 Aug, 2007 1 commit
  17. 26 Aug, 2007 1 commit
  18. 04 Aug, 2007 1 commit
  19. 02 Aug, 2007 1 commit
  20. 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.
  21. 12 Jul, 2007 1 commit
    • mnislaih's avatar
      Teach :print to not panic when the DataCon for a closure is not exposed by the .hi file · 876db7ed
      mnislaih authored
      Previously the behaviour was to panic.
      Now it will print an approximated representation, 
      using the names (enclosed in keys, i.e. "<...>") 
      and the pointed subterms. Non pointed subterms cannot 
      be included in this representation:
      Prelude> let se = Data.Sequence.fromList (map Just "abc")
      Prelude> :eval se
      Prelude> :p se
      se = <Data.Sequence.Deep> (<Data.Sequence.One> (_t1::t)) () (<Data.Sequence.Two> (_t2::t) (_t3::t))
      Prelude> :eval _t2
      Prelude> :p se
      se = <Data.Sequence.Deep> (<Data.Sequence.One> (_t4::t1)) () (<Data.Sequence.Two> (Just 'b') (_t5::t1))
      This patch also includes some fixes in the pretty printer 
      for the Term datatype
  22. 13 Jul, 2007 1 commit
  23. 10 Jul, 2007 1 commit
  24. 23 May, 2007 1 commit
    • simonpj@microsoft.com's avatar
      In GHCi, bind identifiers at TH level 'impLevel' · 800dba35
      simonpj@microsoft.com authored
      Consder Trac #1265, which does this in GHCi:
      	Prelude> let doit = fail "Code not written yet" :: ExpQ
      	Prelude> $(doit)
      Even though 'doit' is defined "in the same module", it's OK to use it in a splice
      because it'll have been fully compiled to bytecode.  (Contrast the situation if
      these two lines appeared in a single, compiled module.)
      Hence we want to bind 'doit' at TH's "imported level" (TcRnTypes.impLevel).  
      This used to happen because GHCi-bound Ids were in the *global* type
      env (and hence at "imported level").  But since SimonM moved
      GHCi-bound ids to the *local* type env (for good reasons) the above
      program has been rejected.
      This patch makes it work again.
  25. 14 May, 2007 1 commit
  26. 11 May, 2007 1 commit
  27. 10 May, 2007 1 commit
  28. 06 May, 2007 1 commit
  29. 04 May, 2007 1 commit
  30. 03 May, 2007 1 commit
  31. 02 May, 2007 2 commits
    • Simon Marlow's avatar
      Refactoring, tidyup and improve layering · 86bec429
      Simon Marlow authored
      The stack of breakpoint resume contexts is now part of the
      InteractiveContext and managed by the GHC API.  This prevents misuse
      of the resume context by the client (e.g. resuming a breakpoint that
      isn't the topmost, which would lead to a confused IC at the least).
      I changed the TypeEnv in the IC to a [Id].  It only contained Ids
      anyway, and this allows us to have shadowing, which removes an ugly
      and annoying restriction.
      The parts of the GHC API which deal with interactive evaluation are
      now in a module of their own, InteractiveEval.
    • simonpj@microsoft.com's avatar
      Do not generate warnings for compiler-generated code · c94fac1c
      simonpj@microsoft.com authored
      Fixes Trac #1313
  32. 25 Apr, 2007 2 commits
  33. 17 Apr, 2007 1 commit
    • Simon Marlow's avatar
      Re-working of the breakpoint support · cdce6477
      Simon Marlow authored
      This is the result of Bernie Pope's internship work at MSR Cambridge,
      with some subsequent improvements by me.  The main plan was to
       (a) Reduce the overhead for breakpoints, so we could enable 
           the feature by default without incurrent a significant penalty
       (b) Scatter more breakpoint sites throughout the code
      Currently we can set a breakpoint on almost any subexpression, and the
      overhead is around 1.5x slower than normal GHCi.  I hope to be able to
      get this down further and/or allow breakpoints to be turned off.
      This patch also fixes up :print following the recent changes to
      constructor info tables.  (most of the :print tests now pass)
      We now support single-stepping, which just enables all breakpoints.
        :step <expr>     executes <expr> with single-stepping turned on
        :step            single-steps from the current breakpoint
      The mechanism is quite different to the previous implementation.  We
      share code with the HPC (haskell program coverage) implementation now.
      The coverage pass annotates source code with "tick" locations which
      are tracked by the coverage tool.  In GHCi, each "tick" becomes a
      potential breakpoint location.
      Previously breakpoints were compiled into code that magically invoked
      a nested instance of GHCi.  Now, a breakpoint causes the current
      thread to block and control is returned to GHCi.
      See the wiki page for more details and the current ToDo list:
  34. 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.
  35. 21 Mar, 2007 3 commits