1. 17 Feb, 2014 1 commit
  2. 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:
      Reviewed-by: default avatarSimon Peyton Jones <simonpj@microsoft.com>
      Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
  3. 14 Jan, 2014 1 commit
  4. 07 Jan, 2014 1 commit
    • John Lenz's avatar
      runghc: Fix interaction of stdin and --ghc-args · ec4af3fb
      John Lenz authored
      When reading the program from standard input, runghc did not properly
      handle the --ghc-arg= escape for arguments to ghc which do not start
      with a dash, since arguments were processed twice and the first time the
      --ghc-arg= was stripped.  Now arguments are only processed once.  For
      backwards compatibility, a prefix of --ghc-arg=--ghc-arg= is allowed
      since this prefix will work on both old and new versions of ghc.
      This fixes #8601
      Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
  5. 28 Nov, 2013 1 commit
  6. 15 Nov, 2013 1 commit
  7. 27 Oct, 2013 2 commits
  8. 26 Oct, 2013 1 commit
  9. 25 Oct, 2013 1 commit
  10. 17 Oct, 2013 1 commit
  11. 12 Oct, 2013 1 commit
    • Darin Morrison's avatar
      Fix mkdirhier.sh on OS X 10.9 (#8139) · feb76385
      Darin Morrison authored
      Mac OS X 10.9 mkdir is apparently stricter than the Mac OS X 10.8
      mkdir about which paths are considered valid arguments. For example,
      in a typical build on Mac OS X 10.9, the first of the following
      invocations of mkdirhier.sh will succeed but the second will fail:
      "inplace/bin/mkdirhier"   utils/ghc-cabal/dist/build/tmp//.  # WORKS
      "inplace/bin/mkdirhier"   bootstrapping/.                    # FAILS
      Simply prefixing the path arguments with "./" causes both to succeed:
      "inplace/bin/mkdirhier" ./utils/ghc-cabal/dist/build/tmp//.  # WORKS
      "inplace/bin/mkdirhier" ./bootstrapping/.                    # WORKS
      Testing indicates failure on paths satisfying all of these criteria:
      - path is suffixed with "/."
      - path is only 1 level deep (e.g., "foo/."; _not_ "foo/bar/.")
      - path is _not_ prefixed with "./"
      This workaround prefixes "./" to the path argument passed to mkdir.
      Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
  12. 11 Oct, 2013 2 commits
  13. 02 Oct, 2013 1 commit
  14. 01 Oct, 2013 1 commit
  15. 23 Sep, 2013 6 commits
  16. 18 Sep, 2013 1 commit
    • eir@cis.upenn.edu's avatar
      Change role annotation syntax. · f4046b50
      eir@cis.upenn.edu authored
      This fixes bugs #8185, #8234, and #8246. The new syntax is explained
      in the comments to #8185, appears in the "Roles" subsection of the
      manual, and on the [wiki:Roles] wiki page.
      This change also removes the ability for a role annotation on type
      synonyms, as noted in #8234.
  17. 15 Sep, 2013 1 commit
  18. 13 Sep, 2013 1 commit
  19. 11 Sep, 2013 1 commit
  20. 07 Sep, 2013 1 commit
  21. 04 Sep, 2013 1 commit
  22. 26 Aug, 2013 1 commit
  23. 23 Aug, 2013 1 commit
  24. 22 Aug, 2013 1 commit
  25. 14 Aug, 2013 1 commit
    • Jan Stolarek's avatar
      Comparison primops return Int# (Fixes #6135) · 6579a6c7
      Jan Stolarek authored
      This patch modifies all comparison primops for Char#, Int#, Word#, Double#,
      Float# and Addr# to return Int# instead of Bool. A value of 1# represents True
      and 0# represents False. For a more detailed description of motivation for this
      change, discussion of implementation details and benchmarking results please
      visit the wiki page: http://hackage.haskell.org/trac/ghc/wiki/PrimBool
      There's also some cleanup: whitespace fixes in files that were extensively edited
      in this patch and constant folding rules for Integer div and mod operators (which
      for some reason have been left out up till now).
  26. 06 Aug, 2013 1 commit
  27. 24 Jun, 2013 1 commit
  28. 15 Jun, 2013 2 commits
  29. 13 Jun, 2013 1 commit
  30. 30 May, 2013 1 commit
  31. 14 May, 2013 2 commits
    • ian@well-typed.com's avatar
      Fix the GHC package DLL-splitting · 60b86b04
      ian@well-typed.com authored
      There's now an internal -dll-split flag, which we use to tell GHC how
      the GHC package is split into 2 separate DLLs. This is used by
      Packages.isDllName to determine whether a call is within the same
      DLL, or whether it is a call to another DLL.
    • ian@well-typed.com's avatar
      Simplify ghc-cabal · ff1a16a0
      ian@well-typed.com authored
      It now consistently takes directory and distDirectory as its first 2
      arguments. Also, it only supports configuring 1 package at a time now
      (we weren't using the ability to configure more than one at once).