1. 26 Apr, 2016 1 commit
    • niteria's avatar
      Kill varSetElemsWellScoped in quantifyTyVars · c9bcaf31
      niteria authored
      varSetElemsWellScoped introduces unnecessary non-determinism in
      inferred type signatures.
      Removing this instance required changing the representation of
      TcDepVars to use deterministic sets.
      This is the last occurence of varSetElemsWellScoped, allowing me to
      finally remove it.
      
      Test Plan:
      ./validate
      I will update the expected outputs when commiting, some reordering
      of type variables in types is expected.
      
      Reviewers: goldfire, simonpj, austin, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: thomie, simonmar
      
      Differential Revision: https://phabricator.haskell.org/D2135
      
      GHC Trac Issues: #4012
      c9bcaf31
  2. 22 Apr, 2016 1 commit
    • niteria's avatar
      Make benign non-determinism in pretty-printing more obvious · 0f96686b
      niteria authored
      This change takes us one step closer to being able to remove
      `varSetElemsWellScoped`. The end goal is to make every source
      of non-determinism obvious at the source level, so that when
      we achieve determinism it doesn't get broken accidentally.
      
      Test Plan: compile GHC
      
      Reviewers: simonmar, goldfire, simonpj, austin, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2123
      
      GHC Trac Issues: #4012
      0f96686b
  3. 19 Jan, 2016 1 commit
    • niteria's avatar
      Check InScopeSet in substTy and provide substTyUnchecked · 9d33adb6
      niteria authored
      This adds sanity checks to `substTy` that implement:
      
      > when calling substTy subst ty it should be the case that the in-scope
      > set in the substitution is a superset of
      > * The free vars of the range of the substitution
      > * The free vars of ty minus the domain of the substitution
      
      and replaces violators with unchecked version. The violators were found
      by running the GHC test suite.
      
      This ensures that I can work on this incrementally and that what I fix won't
      be undone by some other change.
      
      It also includes a couple of fixes that I've already done.
      
      Test Plan: ./validate
      
      Reviewers: simonmar, goldfire, simonpj, austin, bgamari
      
      Reviewed By: simonpj, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1792
      
      GHC Trac Issues: #11371
      9d33adb6
  4. 18 Jan, 2016 1 commit
    • Jan Stolarek's avatar
      Replace calls to `ptext . sLit` with `text` · b8abd852
      Jan Stolarek authored
      Summary:
      In the past the canonical way for constructing an SDoc string literal was the
      composition `ptext . sLit`.  But for some time now we have function `text` that
      does the same.  Plus it has some rules that optimize its runtime behaviour.
      This patch takes all uses of `ptext . sLit` in the compiler and replaces them
      with calls to `text`.  The main benefits of this patch are clener (shorter) code
      and less dependencies between module, because many modules now do not need to
      import `FastString`.  I don't expect any performance benefits - we mostly use
      SDocs to report errors and it seems there is little to be gained here.
      
      Test Plan: ./validate
      
      Reviewers: bgamari, austin, goldfire, hvr, alanz
      
      Subscribers: goldfire, thomie, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D1784
      b8abd852
  5. 31 Dec, 2015 1 commit
  6. 29 Nov, 2015 1 commit
    • quchen's avatar
      Implement warnings for Semigroups as parent of Monoid · 290def72
      quchen authored
      This patch is similar to the AMP patch (#8004), which offered two
      functions:
      
        1. Warn when an instance of a class has been given, but the type does
           not have a certain superclass instance
        2. Warn when top-level definitions conflict with future Prelude names
      
      These warnings are issued as part of the new `-Wcompat` warning group.
      
      Reviewers: hvr, ekmett, austin, bgamari
      
      Reviewed By: hvr, ekmett, bgamari
      
      Subscribers: ekmett, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1539
      
      GHC Trac Issues: #11139
      290def72
  7. 03 Sep, 2015 1 commit
  8. 17 Dec, 2014 1 commit
  9. 03 Dec, 2014 1 commit
  10. 05 Nov, 2014 1 commit
  11. 07 Oct, 2014 1 commit
  12. 21 Sep, 2014 1 commit
  13. 12 Jun, 2014 1 commit
  14. 15 May, 2014 1 commit
    • Herbert Valerio Riedel's avatar
      Add LANGUAGE pragmas to compiler/ source files · 23892440
      Herbert Valerio Riedel authored
      In some cases, the layout of the LANGUAGE/OPTIONS_GHC lines has been
      reorganized, while following the convention, to
      
      - place `{-# LANGUAGE #-}` pragmas at the top of the source file, before
        any `{-# OPTIONS_GHC #-}`-lines.
      
      - Moreover, if the list of language extensions fit into a single
        `{-# LANGUAGE ... -#}`-line (shorter than 80 characters), keep it on one
        line. Otherwise split into `{-# LANGUAGE ... -#}`-lines for each
        individual language extension. In both cases, try to keep the
        enumeration alphabetically ordered.
        (The latter layout is preferable as it's more diff-friendly)
      
      While at it, this also replaces obsolete `{-# OPTIONS ... #-}` pragma
      occurences by `{-# OPTIONS_GHC ... #-}` pragmas.
      23892440
  15. 05 Mar, 2014 1 commit
    • Joachim Breitner's avatar
      Major Call Arity rework · cb8a63cb
      Joachim Breitner authored
      This patch improves the call arity analysis in various ways.
      
      Most importantly, it enriches the analysis result information so that
      when looking at a call, we do not have to make a random choice about
      what side we want to take the information from. Instead we can combine
      the results in a way that does not lose valuable information.
      
      To do so, besides the incoming arities, we store remember "what can be
      called with what", i.e. an undirected graph between the (interesting)
      free variables of an expression. Of course it makes combining the
      results a bit more tricky (especially mutual recursion), but still
      doable.
      
      The actually implemation of the graph structure is abstractly put away
      in a module of its own (UnVarGraph.hs)
      
      The implementation is geared towards efficiently representing the graphs
      that we need (which can contain large complete and large complete
      bipartite graphs, which would be huge in other representations). If
      someone feels like designing data structures: There is surely some
      speed-up to be obtained by improving that data structure.
      
      Additionally, the analysis now takes into account that if a RHS stays a
      thunk, then its calls happen only once, even if the variables the RHS is
      bound to is evaluated multiple times, or is part of a recursive group.
      cb8a63cb
  16. 20 Jan, 2014 1 commit
    • Gergő Érdi's avatar
      Implement pattern synonyms · 4f8369bf
      Gergő Érdi authored
      This patch implements Pattern Synonyms (enabled by -XPatternSynonyms),
      allowing y ou to assign names to a pattern and abstract over it.
      
      The rundown is this:
      
        * Named patterns are introduced by the new 'pattern' keyword, and can
          be either *unidirectional* or *bidirectional*. A unidirectional
          pattern is, in the simplest sense, simply an 'alias' for a pattern,
          where the LHS may mention variables to occur in the RHS. A
          bidirectional pattern synonym occurs when a pattern may also be used
          in expression context.
      
        * Unidirectional patterns are declared like thus:
      
              pattern P x <- x:_
      
          The synonym 'P' may only occur in a pattern context:
      
              foo :: [Int] -> Maybe Int
              foo (P x) = Just x
              foo _     = Nothing
      
        * Bidirectional patterns are declared like thus:
      
              pattern P x y = [x, y]
      
          Here, P may not only occur as a pattern, but also as an expression
          when given values for 'x' and 'y', i.e.
      
              bar :: Int -> [Int]
              bar x = P x 10
      
        * Patterns can't yet have their own type signatures; signatures are inferred.
      
        * Pattern synonyms may not be recursive, c.f. type synonyms.
      
        * Pattern synonyms are also exported/imported using the 'pattern'
          keyword in an import/export decl, i.e.
      
              module Foo (pattern Bar) where ...
      
          Note that pattern synonyms share the namespace of constructors, so
          this disambiguation is required as a there may also be a 'Bar'
          type in scope as well as the 'Bar' pattern.
      
        * The semantics of a pattern synonym differ slightly from a typical
          pattern: when using a synonym, the pattern itself is matched,
          followed by all the arguments. This means that the strictness
          differs slightly:
      
              pattern P x y <- [x, y]
      
              f (P True True) = True
              f _             = False
      
              g [True, True] = True
              g _            = False
      
          In the example, while `g (False:undefined)` evaluates to False,
          `f (False:undefined)` results in undefined as both `x` and `y`
          arguments are matched to `True`.
      
      For more information, see the wiki:
      
          https://ghc.haskell.org/trac/ghc/wiki/PatternSynonyms
          https://ghc.haskell.org/trac/ghc/wiki/PatternSynonyms/Implementation
      
      Reviewed-by: Simon Peyton Jones's avatarSimon Peyton Jones <simonpj@microsoft.com>
      Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
      4f8369bf
  17. 12 Jan, 2014 1 commit
  18. 16 Dec, 2013 1 commit
  19. 02 Aug, 2013 1 commit
  20. 01 Nov, 2012 1 commit
  21. 28 Aug, 2012 1 commit
  22. 05 Aug, 2012 1 commit
  23. 26 Feb, 2012 1 commit
  24. 28 Nov, 2011 1 commit
    • 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.
      f3183d9a
  25. 04 Nov, 2011 1 commit
  26. 28 Jul, 2011 1 commit
  27. 12 Jul, 2011 1 commit
  28. 29 Jun, 2011 1 commit
  29. 13 Apr, 2011 1 commit
  30. 11 Apr, 2011 1 commit
  31. 15 Dec, 2010 1 commit
  32. 04 May, 2010 1 commit
    • Ian Lynagh's avatar
      Fix build with GHC 6.10 · 63dde2e3
      Ian Lynagh authored
      In GHC 6.10, intersectionWith is (a -> b -> a) instead of (a -> b -> c),
      so we need to jump through some hoops to get the more general type.
      63dde2e3
  33. 03 May, 2010 1 commit
    • milan's avatar
      Replace FiniteMap and UniqFM with counterparts from containers. · 5ff8ce7f
      milan authored
      The original interfaces are kept. There is small performance improvement:
      - when compiling for five nofib, we get following speedups:
          Average                -----           -2.5%
          Average                -----           -0.6%
          Average                -----           -0.5%
          Average                -----           -5.5%
          Average                -----          -10.3%
      - when compiling HPC ten times, we get:
          switches                          oldmaps   newmaps
          -O -fasm                          117.402s  116.081s (98.87%)
          -O -fasm -fregs-graph             119.993s  118.735s (98.95%)
          -O -fasm -fregs-iterative         120.191s  118.607s (98.68%)
      5ff8ce7f
  34. 04 Dec, 2009 1 commit
  35. 24 Apr, 2009 1 commit
  36. 04 Sep, 2008 1 commit
    • dias@eecs.harvard.edu's avatar
      add assertion to check that UniqFM is only passed "positive" uniques · 8b7a0a10
      dias@eecs.harvard.edu authored
      The insertion code in UniqFM fails if a unique key
      produces a negative FastInt. I've added an assertion to check
      that each insertion uses a positive Unique.
      
      Where do the negative uniques come from? Both Simom M and
      I have run into this problem when computing hashes for data structures.
      In both cases, we have avoided the problem by ensuring that
      the hashes remain positive.
      8b7a0a10
  37. 31 Jul, 2008 1 commit
  38. 29 Mar, 2008 1 commit
  39. 25 Feb, 2008 1 commit
  40. 06 Feb, 2008 1 commit