1. 19 Dec, 2011 1 commit
    • Ian Lynagh's avatar
      Add a class HasDynFlags(getDynFlags) · 06c6d970
      Ian Lynagh authored
      We no longer have many separate, clashing getDynFlags functions
      I've given each GhcMonad its own HasDynFlags instance, rather than
      using UndecidableInstances to make a GhcMonad m => HasDynFlags m
  2. 16 Dec, 2011 2 commits
  3. 15 Dec, 2011 1 commit
  4. 13 Dec, 2011 3 commits
  5. 12 Dec, 2011 2 commits
  6. 05 Dec, 2011 1 commit
    • Simon Peyton Jones's avatar
      Allow full constraint solving under a for-all (Trac #5595) · 2e6dcdf7
      Simon Peyton Jones authored
      The main idea is that when we unify
          forall a. t1  ~  forall a. t2
      we get constraints from unifying t1~t2 that mention a.
      We are producing a coercion witnessing the equivalence of
      the for-alls, and inside *that* coercion we need bindings
      for the solved constraints arising from t1~t2.
      We didn't have way to do this before.  The big change is
      that here's a new type TcEvidence.TcCoercion, which is
      much like Coercion.Coercion except that there's a slot
      for TcEvBinds in it.
      This has a wave of follow-on changes. Not deep but broad.
      * New module TcEvidence, which now contains the HsWrapper
        TcEvBinds, EvTerm etc types that used to be in HsBinds
      * The typechecker works exclusively in terms of TcCoercion.
      * The desugarer converts TcCoercion to Coercion
      * The main payload is in TcUnify.unifySigmaTy. This is the
        function that had a gross hack before, but is now beautiful.
      * LCoercion is gone!  Hooray.
      Many many fiddly changes in conssequence.  But it's nice.
  7. 29 Nov, 2011 4 commits
    • dimitris's avatar
    • Simon Peyton Jones's avatar
      Refactor (again) the treatment of record-selector bindings · ac11b1f1
      Simon Peyton Jones authored
      We were generating them from the tcg_tcs field of the TcGblEnv,
      but that goes badly wrong when there are top-level Template
      Haskell splices, because the tcg_tcs field grows successively.
      If we generate record-selector binds for all the TyCons in the
      accumulated list, we generate them multiple times for TyCons
      earlier in the program.  This what was happening in Trac #5665:
        data T = T { x :: Int }
        $(f 4)  -- Top level splice
        ..more code..
      Here the record selector bindings for T were being generated
      Better instead to generate the record-selector bindings in
      TcTyClsDecls, right where the new TyCons are being declared (as indeed
      they were some time ago).  This pushed me into doing some refactoring:
      instead of returning the record bindings, tcTyAndClassDecls adds them
      to the tcg_binds field of the TcGblEnv.  I think the result is a bit
      nicer, and it has the additional merit of working.
    • Simon Peyton Jones's avatar
      White space only · e332180e
      Simon Peyton Jones authored
    • dimitris's avatar
      Reintroducing isReflCo optimization: invariant · 4aa0a2d8
      dimitris authored
      that evVarPred.cc_id must be equal to ctPred
      needs no longer be true.
  8. 28 Nov, 2011 5 commits
    • Ian Lynagh's avatar
      Implement a capi calling convention; fixes #2979 · 36f8cabe
      Ian Lynagh authored
      In GHC, this provides an easy way to call a C function via a C wrapper.
      This is important when the function is really defined by CPP.
      Requires the new CApiFFI extension.
      Not documented yet, as it's still an experimental feature at this stage.
    • dimitris's avatar
      isReflCo no longer reliable for detection of type identity. · e5449309
      dimitris authored
      isReflCo is no longer reliable for detection of no-rewriting/flattening
      since we are using cached reflexivity solved goals. Introduced a boolean
      flag in the flattener for this purpose, instead.
    • dimitris's avatar
      Implemented -dsuppress-var-kinds flag to remove silly kinds when dppr-debug is on. · cae91683
      dimitris authored
      Adding commentary, and fixing a knot-tie related bug.
      Commentary only.
    • dimitris's avatar
      Solved goal caching and zonking optimisations. · 4bc84da3
      dimitris authored
      1) Stopped rewriting and caching solveds in the inerts because
      profiling showed that a lot of time was spent on rewriting
      already solved goals.
      2) Optimisations in zonkEvBinds for common-case
      evidence bindings generated from the constraint solver.
      3) Now solved goals cache their evidence terms, so that we can more
      aggressively optimize Refl coercions during constraint solving.
      This patch also includes a rewrite of rewriteInertEqsFromInertEq
      which greatly improves its efficiency.
    • dimitris's avatar
      This patch includes: · f3183d9a
      dimitris authored
      0) Typo in panic message.
      1) prioritization of equalities over family equalities in the worklists.
      2) rewriting of inert substitutions and solveds on-the-spot instead of
         kicking them out in the inerts. This required a monadic map over
         substitutions hence the modifications in UniqFM.
      3) Just comments and removing stale commented code.
      4) Useful SCC for simplifyInfer.
      5) Making CoreStats outputable.
  9. 27 Nov, 2011 1 commit
  10. 26 Nov, 2011 1 commit
    • Simon Peyton Jones's avatar
      Add missing cases in TcUnify.uUnfilledVars · e99f3234
      Simon Peyton Jones authored
      These missing cases dealt with unifying a meta type variable with a
      skolem when the kinds match -- a pretty common case.  The missing
      cases meant that instead of directly solving on the fly (which is easy
      in this situation) we were generating an equality constraint viat
      `utype_defer`.  This isn't *wrong*, but it's a lot less efficient than
      it could be!
      All this arose from investigating #5631.  This one change does this
      to the compiler allocation
           821,257,552 bytes allocated in the heap
                    94 MB total memory in use (0 MB lost due to fragmentation)
        MUT     time    1.54s  (  1.67s elapsed)
        GC      time    1.36s  (  1.60s elapsed)
        Total   time    2.93s  (  3.27s elapsed)
           424,244,124 bytes allocated in the heap
                    49 MB total memory in use (0 MB lost due to fragmentation)
        MUT     time    0.64s  (  0.89s elapsed)
        GC      time    0.83s  (  0.77s elapsed)
        Total   time    1.47s  (  1.66s elapsed)
      Not bad for a 3-line change!
  11. 25 Nov, 2011 4 commits
  12. 24 Nov, 2011 1 commit
    • Simon Marlow's avatar
      Relax the restriction on using abstract newtypes in FFI declarations. · c6b0fd62
      Simon Marlow authored
      Given the high impact of this change, we decided to back off and make
      abstract newtypes give a warning for one release, before we make it an
      error in 7.6.1.
          Warning: newtype `CInt' is used in an FFI declaration,
                   but its constructor is not in scope.
                   This will become an error in GHC 7.6.1.
          When checking declaration:
            foreign import ccall unsafe "static zlib.h deflate" c_deflate
              :: StreamState -> CInt -> IO CInt
  13. 23 Nov, 2011 1 commit
  14. 22 Nov, 2011 1 commit
  15. 21 Nov, 2011 2 commits
    • dreixel's avatar
      Replace EkCtxt by an SDoc · 4296552c
      dreixel authored
      We were never really manipulating the EkCtxt after we had built it,
      so it's simpler to just pass the final SDoc.
    • dreixel's avatar
      Rename ? to OpenKind and ?? to ArgKind · 18c7aea0
      dreixel authored
      The previous names were not informative at all, and now we have
      named kinds like Constraint and datatype promotion to kind, so
      we might as well name these too.
      I tried to update some comments to the new names, but certainly
      many references to the old names remain.
  16. 18 Nov, 2011 1 commit
    • Simon Marlow's avatar
      Track #included files for recompilation checking (#4900, #3589) · 3f34e091
      Simon Marlow authored
      This was pretty straightforward: collect the filenames in the lexer,
      and add them in to the tcg_dependent_files list that the typechecker
      Note that we still don't get #included files in the ghc -M output.
      Since we don't normally lex the whole file in ghc -M, this same
      mechanism can't be used directly.
  17. 17 Nov, 2011 2 commits
  18. 16 Nov, 2011 6 commits
  19. 15 Nov, 2011 1 commit