1. 12 Jan, 2011 1 commit
    • simonpj@microsoft.com's avatar
      Major refactoring of the type inference engine · 27310213
      simonpj@microsoft.com authored
      This patch embodies many, many changes to the contraint solver, which
      make it simpler, more robust, and more beautiful.  But it has taken
      me ages to get right. The forcing issue was some obscure programs
      involving recursive dictionaries, but these eventually led to a
      massive refactoring sweep.
      Main changes are:
       * No more "frozen errors" in the monad.  Instead "insoluble
         constraints" are now part of the WantedConstraints type.
       * The WantedConstraint type is a product of bags, instead of (as
         before) a bag of sums.  This eliminates a good deal of tagging and
       * This same WantedConstraints data type is used
           - As the way that constraints are gathered
           - As a field of an implication constraint
           - As both argument and result of solveWanted
           - As the argument to reportUnsolved
       * We do not generate any evidence for Derived constraints. They are
         purely there to allow "impovement" by unifying unification
       * In consequence, nothing is ever *rewritten* by a Derived
         constraint.  This removes, by construction, all the horrible
         potential recursive-dictionary loops that were making us tear our
         hair out.  No more isGoodRecEv search either. Hurrah!
       * We add the superclass Derived constraints during canonicalisation,
         after checking for duplicates.  So fewer superclass constraints
         are generated than before.
       * Skolem tc-tyvars no longer carry SkolemInfo.  Instead, the
         SkolemInfo lives in the GivenLoc of the Implication, where it
         can be tidied, zonked, and substituted nicely.  This alone is
         a major improvement.
       * Tidying is improved, so that we tend to get t1, t2, t3, rather
         than t1, t11, t111, etc
         Moreover, unification variables are always printed with a digit
         (thus a0, a1, etc), so that plain 'a' is available for a skolem
         arising from a type signature etc. In this way,
           (a) We quietly say which variables are unification variables,
               for those who know and care
           (b) Types tend to get printed as the user expects.  If he writes
                   f :: a -> a
                   f = ...blah...
               then types involving 'a' get printed with 'a', rather than
               some tidied variant.
       * There are significant improvements in error messages, notably
         in the "Cannot deduce X from Y" messages.
  2. 11 Jan, 2011 1 commit
  3. 10 Jan, 2011 2 commits
    • simonpj@microsoft.com's avatar
      Do dependency analysis when kind-checking type declarations · 6ea06bbf
      simonpj@microsoft.com authored
      This patch fixes Trac #4875.  The main point is to do dependency
      analysis on type and class declarations, and kind-check them in
      dependency order, so as to improve error messages.
      This patch means that a few programs that would typecheck before won't
      typecheck any more; but before we were (naughtily) going beyond
      Haskell 98 without any language-extension flags, and Trac #4875
      convinces me that doing so is a Bad Idea.
      Here's an example that won't typecheck any more
             data T a b = MkT (a b)
             type F k = T k Maybe
      If you look at T on its own you'd default 'a' to kind *->*;
      and then kind-checking would fail on F.
      But GHC currently accepts this program beause it looks at
      the *occurrences* of T.
    • simonpj@microsoft.com's avatar
  4. 07 Jan, 2011 1 commit
  5. 05 Jan, 2011 1 commit
  6. 09 Jan, 2011 1 commit
    • Ian Lynagh's avatar
      Rejig the includes/ installation rules · e8a42ae2
      Ian Lynagh authored
      They're a little nicer now, and a regression in the cygwin build is
      fixed (the $i in the destination wasn't surviving being passed through
  7. 08 Jan, 2011 3 commits
  8. 30 Nov, 2010 1 commit
  9. 27 Nov, 2010 1 commit
  10. 07 Jan, 2011 2 commits
    • Simon Marlow's avatar
      catch SIGTSTP and save/restore terminal settings (#4460) · 8625c675
      Simon Marlow authored
      As far as I can tell, it is the responsibility of the program to save
      and restore its own terminal settings across a suspend/foreground, the
      shell doesn't do it (which seems odd).  So I've added a signal handler
      for SIGTSTP to the RTS which will save and restore the terminal
      settings iff we modified them with hSetBuffering or hSetEcho (we
      already restore them at exit time in these cases).
    • Simon Marlow's avatar
      comment updates · 62db6241
      Simon Marlow authored
  11. 06 Jan, 2011 6 commits
  12. 05 Jan, 2011 1 commit
  13. 05 Nov, 2010 1 commit
    • vivian's avatar
      multiline commands in GHCi #4316 · 4edbeb14
      vivian authored
      This patch adds support for multiline commands in GHCi.
      The first line of input is lexed.  If there is an active
      layout context once the lexer reaches the end of file, the
      user is prompted for more input.
      Multiline input is exited by an empty line and can be escaped 
      with a user interrupt.
      Multiline mode is toggled with `:set +m`
  14. 05 Jan, 2011 2 commits
  15. 19 Dec, 2010 1 commit
  16. 04 Jan, 2011 1 commit
    • Ian Lynagh's avatar
      Define cTargetArch and start to use it rather than ifdefs · f0e3d790
      Ian Lynagh authored
      Using Haskell conditionals means the compiler sees all the code, so
      there should be less rot of code specific to uncommon arches. Code
      for other platforms should still be optimised away, although if we want
      to support targetting other arches then we'll need to compile it
      for-real anyway.
  17. 19 Dec, 2010 1 commit
  18. 04 Jan, 2011 1 commit
  19. 21 Dec, 2010 1 commit
    • gwright@antiope.com's avatar
      Fix #4829 (build does not respect --with-gcc option) · 834a2186
      gwright@antiope.com authored
      This patch fixes what seems to be the last problem with the --with-gcc
      option.  On OS X, we need to pass the path to gcc to dtrace as the
      preprocessor.  (Internally, dtrace on OS X sets the default preprocessor
      to /usr/bin/gcc.)  ATM, dtrace is only supported on OS X, so we don't
      need any conditionalization.  If dtrace is ported to other platforms,
      we might need to change this. However, usage on other platforms will
      probably be similar to OS X, since many of Apple's changes are to
      use the gnu toolchain instead of the Sun toolchain.
  20. 31 Dec, 2010 1 commit
  21. 20 Dec, 2010 1 commit
  22. 24 Dec, 2010 2 commits
  23. 22 Dec, 2010 7 commits
    • simonpj@microsoft.com's avatar
      Implement fuzzy matching for the Finder · f14f1daa
      simonpj@microsoft.com authored
      ..so that you get a more helpful message when
      you mis-spell a module name in an 'import'.
      Validates, but not fully tested.
      Based on Max's patch in Trac #2442, but heavily refactored.
    • simonpj@microsoft.com's avatar
      Implement fuzzy matching for the renamer · 820ddd55
      simonpj@microsoft.com authored
      ...so that you get helpful suggestions when you mis-spell a name
      Based on Max's patch in Trac #2442, but heavily refactored.
    • simonpj@microsoft.com's avatar
      Add fuzzyLookup, a variant of fuzzyMatch · b6f9d6f2
      simonpj@microsoft.com authored
      Plus, I changed quite a bit of layout to make the lines shorter.
    • simonpj@microsoft.com's avatar
      White space only · a677bc58
      simonpj@microsoft.com authored
    • simonpj@microsoft.com's avatar
      Layout and white space only · de295725
      simonpj@microsoft.com authored
    • simonpj@microsoft.com's avatar
      Tidy up rebindable syntax for MDo · ba05282d
      simonpj@microsoft.com authored
      For a long time an 'mdo' expression has had a SyntaxTable
      attached to it.  However, we're busy deprecating SyntaxTables
      in favour of rebindable syntax attached to individual Stmts,
      and MDoExpr was totally inconsistent with DoExpr in this
      This patch tidies it all up.  Now there's no SyntaxTable on
      MDoExpr, and 'modo' is generally handled much more like 'do'.
      There is resulting small change in behaviour: now MonadFix is
      required only if you actually *use* recursion in mdo. This
      seems consistent with the implicit dependency analysis that
      is done for mdo.
      Still to do:
        * Deal with #4148 (this patch is on the way)
        * Get rid of the last remaining SyntaxTable on HsCmdTop
    • simonpj@microsoft.com's avatar
      Make the occurrence analyser track preInlineUnconditionally · 16dd51fb
      simonpj@microsoft.com authored
      This fixes a somewhat obscure situation in which an
      over-optimistic use of "occurs once" led to an infinite
      sequence of simplifier iterations.  Se Note [Cascading inlines]
      for the details.
      This showed up when compiling rather large DPH programs, which
      run lots of iterations of the simplifier, which in turn made
      compilation take much longer than necessary.