1. 10 Nov, 2014 1 commit
  2. 07 Nov, 2014 1 commit
  3. 30 Oct, 2014 1 commit
  4. 20 Oct, 2014 1 commit
  5. 07 Oct, 2014 1 commit
  6. 02 Oct, 2014 1 commit
    • Edward Z. Yang's avatar
      Rename _closure to _static_closure, apply naming consistently. · 35672072
      Edward Z. Yang authored
      Summary:
      In preparation for indirecting all references to closures,
      we rename _closure to _static_closure to ensure any old code
      will get an undefined symbol error.  In order to reference
      a closure foobar_closure (which is now undefined), you should instead
      use STATIC_CLOSURE(foobar).  For convenience, a number of these
      old identifiers are macro'd.
      
      Across C-- and C (Windows and otherwise), there were differing
      conventions on whether or not foobar_closure or &foobar_closure
      was the address of the closure.  Now, all foobar_closure references
      are addresses, and no & is necessary.
      
      CHARLIKE/INTLIKE were not changed, simply alpha-renamed.
      
      Part of remove HEAP_ALLOCED patch set (#8199)
      
      Depends on D265
      Signed-off-by: Edward Z. Yang's avatarEdward Z. Yang <ezyang@mit.edu>
      
      Test Plan: validate
      
      Reviewers: simonmar, austin
      
      Subscribers: simonmar, ezyang, carter, thomie
      
      Differential Revision: https://phabricator.haskell.org/D267
      
      GHC Trac Issues: #8199
      35672072
  7. 26 Sep, 2014 1 commit
  8. 23 Sep, 2014 1 commit
    • thomie's avatar
      Delete hack when takeDirectory returns "" · 2a743bbd
      thomie authored
      Summary:
      Since commits 8fe1f8 and bb6731 in the filepath packages (ticket #2034, closed
      in 2010), takeDirectory "foo" returns ".", and not "", so this check is no
      longer needed.
      
      Other commits:
      * Remove trailing whitespace
      * Update comments for #2278
      
      Test Plan: harbormaster
      
      Reviewers: austin
      
      Reviewed By: austin
      
      Subscribers: simonmar, ezyang, carter
      
      Differential Revision: https://phabricator.haskell.org/D213
      
      GHC Trac Issues: #2034
      2a743bbd
  9. 16 Sep, 2014 1 commit
  10. 09 Sep, 2014 1 commit
    • Austin Seipp's avatar
      Make Applicative a superclass of Monad · d94de872
      Austin Seipp authored
      Summary:
      This includes pretty much all the changes needed to make `Applicative`
      a superclass of `Monad` finally. There's mostly reshuffling in the
      interests of avoid orphans and boot files, but luckily we can resolve
      all of them, pretty much. The only catch was that
      Alternative/MonadPlus also had to go into Prelude to avoid this.
      
      As a result, we must update the hsc2hs and haddock submodules.
      Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
      
      Test Plan: Build things, they might not explode horribly.
      
      Reviewers: hvr, simonmar
      
      Subscribers: simonmar
      
      Differential Revision: https://phabricator.haskell.org/D13
      d94de872
  11. 31 Aug, 2014 1 commit
  12. 29 Aug, 2014 1 commit
    • Duncan Coutts's avatar
      Add a ghc -show-packages mode to display ghc's view of the package env · a4cb9a61
      Duncan Coutts authored
      You can use ghc -show-packages, in addition to any -package -package-conf
      -hide-package, etc flags and see just what ghc's package info looks like.
      The format is much like ghc-pkg show.
      
      Like the existing verbose tracing, but a specific mode.
      Re-introduce pretty printed package info (Cabal handled this previously).
      a4cb9a61
  13. 07 Aug, 2014 1 commit
    • Sergei Trofimovich's avatar
      ghci: tweak option list indentation in ':show packages' · af1fc53a
      Sergei Trofimovich authored
      Summary:
      Caught by './validate --slow' in 'ghci/scripts/ghci024'.
      
      Commit 20787529 changed indentation a bit:
      
          --- ./ghci/scripts/ghci024.stdout       2014-07-31 12:05:34.000000000 +0300
          +++ ./ghci/scripts/ghci024.run.stdout   2014-08-07 17:19:23.000000000 +0300
          @@ -33,4 +33,4 @@
           active package flags: none
           ~~~~~~~~~~ Testing :show packages, including the ghc package
           active package flags:
          -  -package ghc
          +-package ghc
      
      Patch restores indentation.
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      
      Test Plan: passed validate, tested manually
      
      Reviewers: austin, ezyang
      
      Reviewed By: ezyang
      
      Subscribers: phaskell, simonmar, relrod, ezyang, carter
      
      Differential Revision: https://phabricator.haskell.org/D126
      af1fc53a
  14. 05 Aug, 2014 4 commits
    • Edward Z. Yang's avatar
      Thinning and renaming modules from packages on the command line. · 20787529
      Edward Z. Yang authored
      Summary:
      This patch set adds support for extra syntax on -package and related
      arguments which allow you to thin and rename modules from a package.
      For example, this argument:
      
          -package "base (Data.Bool as Bam, Data.List)"
      
      adds two more modules into scope, Bam and Data.List, without adding
      any of base's other modules to scope.
      
      These flags are additive: so, for example, saying:
      
          -hide-all-packages -package base -package "base (Data.Bool as Bam)"
      
      will provide both the normal bindings for modules in base, as well as
      the module Bam.
      
      There is also a new debug flag -ddump-mod-map which prints the state
      of the module mapping database.  H = hidden, E = exposed (so for
      example EH says the module in question is exported, but in a hidden
      package.)
      
      Module suggestions have been minorly overhauled to work better with reexports:
      if you have -package "base (Data.Bool as Bam)" and mispell Bam, GHC
      will suggest "Did you mean Bam (defined via package flags to be
      base:Data.Bool)"; and generally you will get more accurate information.
      Also, fix a bug where we suggest the -package flag when we really need
      the -package-key flag.
      
      NB: The renaming afforded here does *not* affect what wired in
      symbols GHC generates.  (But it does affect implicit prelude!)
      
      ToDo: add 'hiding' functionality, to make it easier to support the alternative
      prelude use-case.
      
      ToDo: Cabal support
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: new tests and validate
      
      Reviewers: simonpj, simonmar, hvr, austin
      
      Subscribers: simonmar, relrod, ezyang, carter
      
      Differential Revision: https://phabricator.haskell.org/D113
      
      GHC Trac Issues: #9375
      20787529
    • Edward Z. Yang's avatar
      Refactor PackageFlags so that ExposePackage is a single constructor. · 4accf601
      Edward Z. Yang authored
      You can parametrize over the different selection by using a
      different PackageArg.  This helps reduce code duplication.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      4accf601
    • Edward Z. Yang's avatar
      Make PackageState an abstract type. · de3f0644
      Edward Z. Yang authored
      Summary: Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: simonpj, simonmar, hvr, austin
      
      Subscribers: simonmar, relrod, ezyang, carter
      
      Differential Revision: https://phabricator.haskell.org/D107
      de3f0644
    • Edward Z. Yang's avatar
      Package keys (for linking/type equality) separated from package IDs. · 66218d15
      Edward Z. Yang authored
      This patch set makes us no longer assume that a package key is a human
      readable string, leaving Cabal free to "do whatever it wants" to allocate
      keys; we'll look up the PackageId in the database to display to the user.
      This also means we have a new level of qualifier decisions to make at the
      package level, and rewriting some Safe Haskell error reporting code to DTRT.
      
      Additionally, we adjust the build system to use a new ghc-cabal output
      Make variable PACKAGE_KEY to determine library names and other things,
      rather than concatenating PACKAGE/VERSION as before.
      
      Adds a new `-this-package-key` flag to subsume the old, erroneously named
      `-package-name` flag, and `-package-key` to select packages by package key.
      
      RFC: The md5 hashes are pretty tough on the eye, as far as the file
      system is concerned :(
      
      ToDo: safePkg01 test had its output updated, but the fix is not really right:
      the rest of the dependencies are truncated due to the fact the we're only
      grepping a single line, but ghc-pkg is wrapping its output.
      
      ToDo: In a later commit, update all submodules to stop using -package-name
      and use -this-package-key.  For now, we don't do it to avoid submodule
      explosion.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: simonpj, simonmar, hvr, austin
      
      Subscribers: simonmar, relrod, carter
      
      Differential Revision: https://phabricator.haskell.org/D80
      66218d15
  15. 26 Jul, 2014 1 commit
    • Edward Z. Yang's avatar
      Module reexports, fixing #8407. · 7f5c1086
      Edward Z. Yang authored
      The general approach is to add a new field to the package database,
      reexported-modules, which considered by the module finder as possible
      module declarations.  Unlike declaring stub module files, multiple
      reexports of the same physical package at the same name do not
      result in an ambiguous import.
      
      Has submodule updates for Cabal and haddock.
      
      NB: When a reexport renames a module, that renaming is *not* accessible
      from inside the package.  This is not so much a deliberate design choice
      as for implementation expediency (reexport resolution happens only when
      a package is in the package database.)
      
      TODO: Error handling when there are duplicate reexports/etc is not very
      well tested.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Conflicts:
      	compiler/main/HscTypes.lhs
      	testsuite/.gitignore
      	utils/haddock
      7f5c1086
  16. 21 Jul, 2014 1 commit
    • Edward Z. Yang's avatar
      Rename PackageId to PackageKey, distinguishing it from Cabal's PackageId. · 4bebab25
      Edward Z. Yang authored
      Summary:
      Previously, both Cabal and GHC defined the type PackageId, and we expected
      them to be roughly equivalent (but represented differently).  This refactoring
      separates these two notions.
      
      A package ID is a user-visible identifier; it's the thing you write in a
      Cabal file, e.g. containers-0.9.  The components of this ID are semantically
      meaningful, and decompose into a package name and a package vrsion.
      
      A package key is an opaque identifier used by GHC to generate linking symbols.
      Presently, it just consists of a package name and a package version, but
      pursuant to #9265 we are planning to extend it to record other information.
      Within a single executable, it uniquely identifies a package.  It is *not* an
      InstalledPackageId, as the choice of a package key affects the ABI of a package
      (whereas an InstalledPackageId is computed after compilation.)  Cabal computes
      a package key for the package and passes it to GHC using -package-name (now
      *extremely* misnamed).
      
      As an added bonus, we don't have to worry about shadowing anymore.
      
      As a follow on, we should introduce -current-package-key having the same role as
      -package-name, and deprecate the old flag.  This commit is just renaming.
      
      The haddock submodule needed to be updated.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: simonpj, simonmar, hvr, austin
      
      Subscribers: simonmar, relrod, carter
      
      Differential Revision: https://phabricator.haskell.org/D79
      
      Conflicts:
      	compiler/main/HscTypes.lhs
      	compiler/main/Packages.lhs
      	utils/haddock
      4bebab25
  17. 20 Jul, 2014 1 commit
    • Mathieu Boespflug's avatar
      Make GHCi permissions checks ignore root user. · fb936e0d
      Mathieu Boespflug authored
      Summary:
      As a security precaution, GHCi helpfully refuses to run a .ghci file if it is owned by another user. But if the that other user is root, then arguably GHCi should not refuse to interpret the file, because if root really was malicious, then the user would be having a bad day anyways.
      This means that .ghci files installed in a global location, say under /usr/local/, can now be read.
      
      Fixes #9324
      
      Test Plan:
      ```
      $ sudo touch .ghci
      $ ghci
      ```
      Notice that the warning about the file being owned by someone else is now gone.
      
      Reviewers: austin
      
      Reviewed By: austin
      
      Subscribers: phaskell, simonmar, carter, nomeata, relrod
      
      Projects: #ghc
      
      Differential Revision: https://phabricator.haskell.org/D75
      fb936e0d
  18. 13 Jul, 2014 1 commit
  19. 07 Jul, 2014 1 commit
  20. 22 Jun, 2014 1 commit
    • Edward Z. Yang's avatar
      Simplify package dump for -v4 · b6352c99
      Edward Z. Yang authored
      Summary:
      Previously, on -v4  and greater, we dumped out the entire package
      database, including lots of metadata that GHC doesn't really care about,
      and is guaranteed to correspond to the equivalent in the local/global
      package databases on disk.  So, to make this output more useful, on -v4
      we instead just print package IDs, and the exposed and trusted flags
      (E and T, which can be tweaked at runtime).
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: successful validate
      
      Reviewers: simonpj
      
      Subscribers: simonmar, relrod
      
      Differential Revision: https://phabricator.haskell.org/D24
      b6352c99
  21. 13 Jun, 2014 1 commit
  22. 03 Jun, 2014 1 commit
    • Simon Peyton Jones's avatar
      Do pretty-printing of TyThings via IfaceDecl (Trac #7730) · b4856f9f
      Simon Peyton Jones authored
      All the initial work on this was done fy 'archblob' (fcsernik@gmail.com);
      thank you!
      
      I reviewed the patch, started some tidying, up and then ended up in a huge
      swamp of changes, not all of which I can remember now.  But:
      
      * To suppress kind arguments when we have -fno-print-explicit-kinds,
          - IfaceTyConApp argument types are in a tagged list IfaceTcArgs
      
      * To allow overloaded types to be printed with =>, add IfaceDFunTy to IfaceType.
      
      * When printing data/type family instances for the user, I've made them
        print out an informative RHS, which is a new feature. Thus
              ghci> info T
              data family T a
              data instance T Int = T1 Int Int
              data instance T Bool = T2
      
      * In implementation terms, pprIfaceDecl has just one "context" argument,
        of type IfaceSyn.ShowSub, which says
             - How to print the binders of the decl
               see note [Printing IfaceDecl binders] in IfaceSyn
             - Which sub-comoponents (eg constructors) to print
      
      * Moved FastStringEnv from RnEnv to OccName
      
      It all took a ridiculously long time to do.  But it's done!
      b4856f9f
  23. 15 May, 2014 1 commit
  24. 14 May, 2014 2 commits
  25. 22 Apr, 2014 1 commit
  26. 08 Apr, 2014 1 commit
  27. 27 Mar, 2014 1 commit
    • Simon Marlow's avatar
      Don't perform permission checks for scripts named with -ghci-script (#6017) · a6f2c852
      Simon Marlow authored
      The user explicitly requested this script on the command-line, so it's
      unnecessary to require that the script is also owned by the user.
      Also, it is currently impossible to make a GHCi wrapper that invokes a
      custom script without first making a copy of the script to circumvent
      the permissions check, which seems wrong.
      a6f2c852
  28. 05 Mar, 2014 1 commit
  29. 20 Feb, 2014 1 commit
  30. 18 Feb, 2014 2 commits
  31. 17 Feb, 2014 2 commits
    • Austin Seipp's avatar
      Add comments explaining #8754 · b626c3d4
      Austin Seipp authored
      Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
      b626c3d4
    • Austin Seipp's avatar
      Fix #8754 in a round-about way. · 5023c917
      Austin Seipp authored
      For some reason on OS X, it seems like -Bsymbolic (which we use for
      hooks into the RTS) isn't working, which results in #8754, where stats
      don't work because defaultHooks doesn't initialize the stats flag. This
      seems to work on Linux static/dynamically, but only on OS X statically.
      
      After talking with Simon, really, the entire hooks thing is a bit
      fragile. For now, we just work around it (since GHCi is dynamically
      linked) by calling into the defaultHooks ourselves when GHC starts.
      Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
      5023c917
  32. 20 Jan, 2014 1 commit
    • cactus's avatar
      Implement pattern synonyms · 4f8369bf
      cactus 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/ImplementationReviewed-by: Simon Peyton Jones's avatarSimon Peyton Jones <simonpj@microsoft.com>
      Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
      4f8369bf
  33. 09 Jan, 2014 1 commit
  34. 03 Jan, 2014 1 commit