1. 24 Nov, 2014 1 commit
  2. 21 Nov, 2014 4 commits
    • Merijn Verstraaten's avatar
      Add -fdefer-typed-holes flag which defers hole errors to runtime. · 2cc854b7
      Merijn Verstraaten authored
      Summary:
      As proposed by Richard on Trac. This patch adds a new flag -fdefer-typed-holes
      and changes the semantics of the -fno-warn-typed-holes flag.
      
      To summarise, by default GHC has typed holes enabled and produces a compile
      error when it encounters a typed hole.
      
      When -fdefer-type-errors OR -fdefer-typed-holes is enabled, hole errors are
      converted to warnings and result in runtime errors when evaluated.
      
      The warning flag -fwarn-typed-holes is on by default. Without -fdefer-type-errors
      or -fdefer-typed-holes this flag is a no-op, since typed holes are an error
      under these conditions. If either of the defer flags are enabled (converting
      typed hole errors into warnings) the -fno-warn-typed-holes flag disables the
      warnings. This means compilation silently succeeds and evaluating a hole will
      produce a runtime error.
      
      The rationale behind allowing typed holes warnings to be silenced is that tools
      like Syntastic for vim highlight warnings and hole warnings may be undesirable.
      Signed-off-by: Merijn Verstraaten's avatarMerijn Verstraaten <merijn@inconsistent.nl>
      
      Test Plan: validate
      
      Reviewers: austin, simonpj, thomie
      
      Reviewed By: simonpj, thomie
      
      Subscribers: Fuuzetsu, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D442
      
      GHC Trac Issues: #9497
      
      Conflicts:
      	compiler/main/DynFlags.hs
      2cc854b7
    • Lennart Kolmodin's avatar
      ghc: allow --show-options and --interactive together · 624a7c5a
      Lennart Kolmodin authored
      Summary:
      Previously 'ghc --show-options' showed all options that GHC can possibly
      accept. With this patch, it'll only show the options that have effect in
      non-interactive modes.
      This change also adds support for using 'ghc --interactive --show-options'
      which previously was disallowed. This command will show all options that have
      effect in the interactive mode.
      The CmdLineParser is updated to know about the GHC modes, and then each flag
      is annotated with which mode it has effect.
      This fixes #9259.
      
      Test Plan:
      Try out --show-options with --interactive on the command line. With and without
      --interactive should give different results.
      Run the test suite, mode001 has been updated to verify this new flag
      combination.
      
      Reviewers: austin, jstolarek
      
      Reviewed By: austin, jstolarek
      
      Subscribers: jstolarek, thomie, carter, simonmar
      
      Differential Revision: https://phabricator.haskell.org/D337
      
      GHC Trac Issues: #9259
      624a7c5a
    • jpm@cs.ox.ac.uk's avatar
      Implement #5462 (deriving clause for arbitrary classes) · 7ed482d9
      jpm@cs.ox.ac.uk authored
      Summary: (this has been submitted on behalf on @dreixel)
      
      Reviewers: simonpj, hvr, austin
      
      Reviewed By: simonpj, austin
      
      Subscribers: goldfire, thomie, carter, dreixel
      
      Differential Revision: https://phabricator.haskell.org/D476
      
      GHC Trac Issues: #5462
      7ed482d9
    • Eric Seidel's avatar
      Add flag `-fwarn-missing-exported-sigs` · 067f1e4f
      Eric Seidel authored
      Summary: add `-fwarn-missing-exported-sigs` to only warn about missing signatures if the name is exported
      
      Test Plan: validate, see testsuite/tests/warnings/should_compile/T2526.hs
      
      Reviewers: ezyang, austin, thomie
      
      Reviewed By: austin, thomie
      
      Subscribers: ezyang, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D482
      
      GHC Trac Issues: #2526
      
      Conflicts:
      	docs/users_guide/7.10.1-notes.xml
      067f1e4f
  3. 19 Nov, 2014 1 commit
  4. 14 Nov, 2014 1 commit
  5. 13 Nov, 2014 2 commits
  6. 06 Nov, 2014 4 commits
  7. 04 Nov, 2014 1 commit
  8. 31 Oct, 2014 1 commit
  9. 24 Oct, 2014 1 commit
    • Edward Z. Yang's avatar
      Implementation of hsig (module signatures), per #9252 · aa479953
      Edward Z. Yang authored
      Summary:
      Module signatures, like hs-boot files, are Haskell modules which omit
      value definitions and contain only signatures.  This patchset implements
      one particular aspect of module signature, namely compiling them against
      a concrete implementation.  It works like this: when we compile an hsig
      file, we must be told (via the -sig-of flag) what module this signature
      is implementing.  The signature is compiled into an interface file which
      reexports precisely the entities mentioned in the signature file.  We also
      verify that the interface is compatible with the implementation.
      
      This feature is useful in a few situations:
      
          1. Like explicit import lists, signatures can be used to reduce
          sensitivity to upstream changes.  However, a signature can be defined
          once and then reused by many modules.
      
          2. Signatures can be used to quickly check if a new upstream version
          is compatible, by typechecking just the signatures and not the actual
          modules.
      
          3. A signature can be used to mediate separate modular development,
          where the signature is used as a placeholder for functionality which
          is loaded in later.  (This is only half useful at the moment, since
          typechecking against signatures without implementations is not implemented
          in this patchset.)
      
      Unlike hs-boot files, hsig files impose no performance overhead.
      
      This patchset punts on the type class instances (and type families) problem:
      instances simply leak from the implementation to the signature.  You can
      explicitly specify what instances you expect to have, and those will be checked,
      but you may get more instances than you asked for.  Our eventual plan is
      to allow hiding instances, but to consider all transitively reachable instances
      when considering overlap and soundness.
      
      ToDo: signature merging: when a module is provided by multiple signatures
      for the same base implementation, we should not consider this ambiguous.
      
      ToDo: at the moment, signatures do not constitute use-sites, so if you
      write a signature for a deprecated function, you won't get a warning
      when you compile the signature.
      
      Future work: The ability to feed in shaping information so that we can take
      advantage of more type equalities than might be immediately evident.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate and new tests
      
      Reviewers: simonpj, simonmar, hvr, austin
      
      Subscribers: simonmar, relrod, ezyang, carter, goldfire
      
      Differential Revision: https://phabricator.haskell.org/D130
      
      GHC Trac Issues: #9252
      aa479953
  10. 21 Oct, 2014 1 commit
    • mlen's avatar
      Enabled warn on tabs by default (fixes #9230) · 972ba121
      mlen authored
      Summary:
      This revision enables -fwarn-tabs by default and add a suppression
      flag, so that GHC compilation won't fail when some files contain tab
      characters.
      
      Test Plan: Additional test case, T9230, was added to cover that change.
      
      Reviewers: austin
      
      Reviewed By: austin
      
      Subscribers: simonmar, ezyang, carter, thomie, mlen
      
      Differential Revision: https://phabricator.haskell.org/D255
      
      GHC Trac Issues: #9230
      
      Conflicts:
      	testsuite/driver/testlib.py
      972ba121
  11. 18 Sep, 2014 1 commit
    • Krzysztof Gogolewski's avatar
      Add -fwarn-context-quantification (#4426) · 275dcafb
      Krzysztof Gogolewski authored
      Summary:
      This warning (enabled by default) reports places where a context
      implicitly binds a type variable, for example
      
      type T a = {-forall m.-} Monad m => a -> m a
      
      Also update Haddock submodule.
      
      Test Plan: validate
      
      Reviewers: hvr, goldfire, simonpj, austin
      
      Reviewed By: austin
      
      Subscribers: simonmar, ezyang, carter
      
      Differential Revision: https://phabricator.haskell.org/D211
      
      GHC Trac Issues: #4426
      275dcafb
  12. 31 Aug, 2014 1 commit
  13. 28 Aug, 2014 1 commit
    • Simon Peyton Jones's avatar
      Add -fspecialise-aggressively · b9e49d3e
      Simon Peyton Jones authored
      This flag specialises any imported overloaded function that has an
      unfolding, whether or not it was marked INLINEABLE.
      
      We get a lot of orphan SPEC rules as a result, but that doesn't matter
      provided we don't treat orphan auto-generated rules as causing the module
      itself to be an orphan module.  See Note [Orphans and auto-generated rules]
      in MkIface.
      b9e49d3e
  14. 19 Aug, 2014 1 commit
  15. 05 Aug, 2014 3 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
      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
  16. 02 Aug, 2014 1 commit
  17. 01 Aug, 2014 1 commit
  18. 31 Jul, 2014 1 commit
    • Simon Peyton Jones's avatar
      Complete work on new OVERLAPPABLE/OVERLAPPING pragmas (Trac #9242) · 1ae5fa45
      Simon Peyton Jones authored
      * Deprecate -XOverlappingInstances
      
      * Update test suite.  Several tests even had entirely unnecessary
        uses of -XOverlappingInstances
      
      * Update user manual with a careful description of the instance
        resolution story
      
      * Fix an outright bug in the handling of duplidate instances in GHCi,
        which are meant to silently overwrite the earlier duplicate. The
        logic was right for family instances but was both more complicated,
        and plain wrong, for class instances.  (If you are interested, the
        bug was that we were eliminating the duplicate from the InstEnv, but
        not from the [ClsInst] held in tcg_insts.)  Test is ghci044a.
      1ae5fa45
  19. 28 Jul, 2014 1 commit
  20. 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
  21. 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
  22. 27 Jun, 2014 1 commit
    • Herbert Valerio Riedel's avatar
      Add -XBinaryLiterals language extension (re #9224) · 1c0b5fdc
      Herbert Valerio Riedel authored
      Haskell2010 supports
      
      - base-10 (prefix-less),
      - base-8 (via `0[oO]`-prefix), and
      - base-16 (via `0[xX]`-prefix) integer literals.
      
      This commit adds syntax support for base-2 integer literals via the new `0[bB]`
      prefix. The use of a `0b` prefix for indicating binary literals is known
      from popular programming languages such as C++14, Perl, Python, Ruby, and Java.
      
      This syntax extension is disabled by default and can be enabled via the
      new `{-# LANGUAGE BinaryLiterals #-}` pragma and/or the new `-XBinaryLiterals`
      
      This new extensions requires to upgrade the `ExtsBitmap` type from
      `Word` to `Word64` as this adds a 33th flag which is not guaranteed to
      fit into a `Word`.
      Signed-off-by: Herbert Valerio Riedel's avatarHerbert Valerio Riedel <hvr@gnu.org>
      
      Differential Revision: https://phabricator.haskell.org/D22
      1c0b5fdc
  23. 26 Jun, 2014 1 commit
  24. 23 Jun, 2014 1 commit
  25. 08 Jun, 2014 1 commit
  26. 06 Jun, 2014 3 commits
  27. 04 Jun, 2014 1 commit
  28. 30 May, 2014 1 commit
  29. 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