1. 09 May, 2018 1 commit
    • Simon Marlow's avatar
      Add -fghci-leak-check to check for space leaks · 5fe6aaa3
      Simon Marlow authored
      Summary:
      Space leaks in GHCi emerge from time to time and tend to come back again
      after they get fixed. This is an attempt to limit regressions by
      
      * adding a reliable detection for some classes of space leaks in GHCi
      * turning on leak checking for all GHCi tests in the test suite, so that
        we'll notice if the leak appears again.
      
      The idea for detecting space leaks is quite simple:
      
      * find some data that we expect to be GC'd later, make a weak pointer to it
      * when we expect the data to be dead, do a `performGC` and then check
        the status of the weak pointer.
      
      It would be nice to apply this trick to lots of things in GHC,
      e.g. ensuring that HsSyn is not retained after the desugarer, or
      ensuring that CoreSyn from the previous simplifier pass is not retained.
      
      Test Plan: validate
      
      Reviewers: bgamari, simonpj, erikd, niteria
      
      Subscribers: thomie, carter
      
      GHC Trac Issues: #15111
      
      Differential Revision: https://phabricator.haskell.org/D4658
      5fe6aaa3
  2. 15 Jan, 2018 2 commits
    • Matthew Pickering's avatar
      Add flag -fno-it · 41afbb3f
      Matthew Pickering authored
      This flag stops ghci creating the special variable `it`
      after evaluating an expression. This stops ghci leaking
      as much memory when evaluating expressions. See #14336
      
      Reviewers: bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #14336
      
      Differential Revision: https://phabricator.haskell.org/D4299
      41afbb3f
    • Ben Gamari's avatar
      Support LIBRARY_PATH and LD_LIBRARY_PATH in rts · 87917a59
      Ben Gamari authored
      `LIBRARY_PATH` is used to find libraries and other link artifacts while
      `LD_LIBRARY_PATH` is used to find shared libraries by the loader.
      
      Due to an implementation detail on Windows, using `LIBRARY_PATH` will
      automatically add the path of any library found to the loader's path.
      
      So in that case `LD_LIBRARY_PATH` won't be needed.
      
      Test Plan:
      ./validate along with T14611 which has been made Windows only
      due to linux using the system linker/loader by default. So I feel a
      testcase there is unwarranted as the support is indirect via glibc.
      
      Reviewers: hvr, bgamari, erikd, simonmar, RyanGlScott
      
      Reviewed By: RyanGlScott
      
      Subscribers: RyanGlScott, rwbarton, thomie, carter
      
      GHC Trac Issues: #14611
      
      Differential Revision: https://phabricator.haskell.org/D4275
      87917a59
  3. 23 Nov, 2017 1 commit
  4. 07 Nov, 2017 1 commit
  5. 06 Nov, 2017 1 commit
    • Ben Gamari's avatar
      DynFlags: Introduce -show-mods-loaded flag · 8613e61d
      Ben Gamari authored
      This flag reintroduces the verbose module name output produced by GHCi's
      :load command behind a new flag, -show-mods-loaded. This was originally
      removed in D3651 but apparently some tools (e.g. haskell-mode) rely on
      this output.
      
      Addresses #14427.
      
      Test Plan: Validate
      
      Reviewers: svenpanne
      
      Reviewed By: svenpanne
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D4164
      8613e61d
  6. 25 Oct, 2017 1 commit
    • Joachim Breitner's avatar
      Make language extensions their own category in the documentation · 61f1b46e
      Joachim Breitner authored
      I.e. instead of
      
          .. ghc-flag:: -XUnboxedTuples
              :shortdesc: Enable the use of unboxed tuple syntax.
              :type: dynamic
              :reverse: -XNoUnboxedTuples
              :category:
      
      one simply writes
      
          .. extension:: UnboxedTuples
              :shortdesc: Enable the use of unboxed tuple syntax.
      
      This allows language extensions to be referenced as
      
          If :extension:`UnboxedTuples` is enabled, then...
      
      This directive still creates the entries for the `-XUnboxedTuples` flag,
      so in particular,
      
          Set :ghc-flag:`-XUnboxedTuples` if you have to.
      
      still works, and lists of flags in general (e.g. for the manpage)
      include these.
      
      I also removed lots of links from the shortdesc of the extensions, when
      this link simply points to the section where the extension is defined.
      
      I removed the list of `-X` flags from the flag reference table, but added a
      table of extension under “10.1. Language options”
      
      Lots of text in the manual now refers to “extension `Foo`” rather than
      “flag `-XFoo`”.
      
      I consider `-XFoo` a historic artifact that stems from when language
      extensions were really just flags. These days, the use of `-XFoo` is
      (IMHO) deprecated: You should be using `LANGUAGE Foo`, or maybe the
      appropriate field in a `.cabal` file. See 9278994a which did this change
      to error messages already.
      
      Differential Revision: https://phabricator.haskell.org/D4112
      61f1b46e
  7. 19 Aug, 2017 1 commit
    • patrickdoc's avatar
      users_guide: Convert mkUserGuidePart generation to a Sphinx extension · cf8ab1ce
      patrickdoc authored
      This removes all dependencies the users guide had on `mkUserGuidePart`.
      The generation of the flag reference table and the various pieces of the
      man page is now entirely contained within the Spinx extension
      `flags.py`. You can see the man page generation on the orphan page
      https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/ghc.html
      
      The extension works by collecting all of the meta-data attached to the
      `ghc-flag` directives and then formatting and displaying it at
      `flag-print` directives. There is a single printing directive that can
      be customized with two options, what format to display (table, list, or
      block of flags) and an optional category to limit the output to
      (verbosity, warnings, codegen, etc.).
      
      New display formats can be added by creating a function
      `generate_flag_xxx` (where `xxx` is a description of the format) which
      takes a list of flags and a category and returns a new `xxx`. Then just
      add a reference in the dispatch table `handlers`. That display can now
      be run by passing `:type: xxx` to the `flag-print` directive.
      
      `flags.py` contains two maps of settings that can be adjusted. The first
      is a canonical list of flag categories, and the second sets default
      categories for files.
      
      The only functionality that Sphinx could not replace was the
      `what_glasgow_exts_does.gen.rst` file. `mkUserGuidePart` actually just
      reads the list of flags from `compiler/main/DynFlags.hs` which Sphinx
      cannot do. As the flag is deprecated, I added the list as a static file
      which can be updated manually.
      
      Additionally, this patch updates every single documented flag with the
      data from `mkUserGuidePart` to generate the reference table.
      
      Fixes #11654 and, incidentally, #12155.
      
      Reviewers: austin, bgamari
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #11654, #12155
      
      Differential Revision: https://phabricator.haskell.org/D3839
      cf8ab1ce
  8. 17 Aug, 2017 1 commit
    • Takenobu Tani's avatar
      user-guide: fix examples of ghci commands · 33856696
      Takenobu Tani authored
      Fix examples of ghci commands:
        * correct typos
        * add top-level binding without let statement
        * modify Time.getClockTime to Data.Time.getZonedTime
        * modify Directory.setCurrentDirectory
        * modify ghc version number
      
      Test Plan: build
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3852
      33856696
  9. 24 Jul, 2017 1 commit
  10. 23 Jul, 2017 2 commits
    • Ben Gamari's avatar
      Fix more documentation wibbles · 2dff2c7f
      Ben Gamari authored
      Fixes #14020, #14016, #14015, #14019
      2dff2c7f
    • patrickdoc's avatar
      users-guide: Standardize and repair all flag references · 44b090be
      patrickdoc authored
      This patch does three things:
      
      1.) It simplifies the flag parsing code in `conf.py` to properly display
      flag definitions created by `.. (ghc|rts)-flag::`. Additionally, all flag
      references must include the associated arguments. Documentation has been
      added to `editing-guide.rst` to explain this.
      
      2.) It normalizes all flag definitions to a similar format. Notably, all
      instances of `<>` have been replaced with `⟨⟩`. All references across the
      users guide have been updated to match.
      
      3.) It fixes a couple issues with the flag reference table's generation code,
      which did not handle comma separated flags in the same cell and did not
      properly reference flags with arguments.
      
      Test Plan:
      `SPHINXOPTS = -n` to activate "nitpicky" mode, which reports all broken
      references. All remaining errors are references to flags without any
      documentation.
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #13980
      
      Differential Revision: https://phabricator.haskell.org/D3778
      44b090be
  11. 14 Mar, 2017 1 commit
    • Ryan Scott's avatar
      Further document :type +v's role in analyzing -XTypeApplications in GHCi · b335f506
      Ryan Scott authored
      Summary:
      The section on `-XTypeApplications` in the users' guide isn't terribly
      clear on how to view the visibility of a function type signature's type
      variables in GHCi properly (i.e., using the `:type +v` GHCi command). This
      adds some more exposition that demonstrates how to use `:type +v` (and why you
      don't want to use `:type`).
      
      Fixes #13401.
      
      Test Plan: Eyeball it
      
      Reviewers: bgamari, austin, goldfire, crockeea
      
      Reviewed By: goldfire, crockeea
      
      Subscribers: rwbarton, thomie, crockeea
      
      Differential Revision: https://phabricator.haskell.org/D3310
      b335f506
  12. 23 Feb, 2017 1 commit
  13. 20 Feb, 2017 1 commit
  14. 14 Feb, 2017 1 commit
    • vivid-synth's avatar
      Allow type defaulting for multi-param type classes with ExtendedDefaultRules · c3bbd1af
      vivid-synth authored
      Expressions like the following will now typecheck:
      
      ```
          data A x = A deriving Show
      
          class ToA a x where
             toA :: a -> A x
      
          instance ToA Integer x where
             toA _ = A
      
          main = print (toA 5 :: A Bool)
      ```
      
      The new defaulting rules are
      
      Find all the unsolved constraints. Then:
      
      * Find those that have exactly one free type variable, and partition
        that subset into groups that share a common type variable `a`.
      * Now default `a` (to one of the types in the default list) if at least
        one of the classes `Ci` is an interactive class
      
      Reviewers: goldfire, bgamari, austin, mpickering, simonpj
      
      Reviewed By: bgamari, simonpj
      
      Subscribers: mpickering, simonpj, goldfire, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2822
      c3bbd1af
  15. 06 Feb, 2017 1 commit
    • rwbarton's avatar
      Don't replace type family instances with the same LHS in GHCi (#7102) · 0abe7361
      rwbarton authored
      This fixes the easy part of #7102 by removing the logic that lets the
      user replace a type family instance with a new one with the same LHS.
      As discussed on that ticket, this is unsound in general. Better to have
      the user redefine the type family from scratch.
      
      The example from comment:7 involving loading modules into ghci is not
      fixed yet; it actually doesn't rely on the instances having the same LHS.
      This commit adds an expect_broken test for that example as well.
      
      Test Plan: T7102a for the fix; T7102 is the test not fixed yet
      
      Reviewers: dfeuer, austin, bgamari, goldfire
      
      Reviewed By: dfeuer
      
      Subscribers: dfeuer, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2994
      0abe7361
  16. 03 Jan, 2017 1 commit
  17. 31 Aug, 2016 1 commit
  18. 23 Jun, 2016 1 commit
  19. 01 May, 2016 1 commit
    • niksaz's avatar
      Greater customization of GHCi prompt · 533037cc
      niksaz authored
      This patch is trying to redesign the :set prompt option to take not a
      String but a Haskell function, like [String] -> Int -> IO String, where
      [String] is the list of the names of the currently loaded modules and
      Int is the line number. Currently you may set prompt function with
      **:set promt-function [String] -> Int -> IO String** option and old
      version is also available - :set prompt String.
      
      So, it looks like I've almost completed this patch:
      
      1) Now we have a lot of escape sequences - 13 to be exact. Most of them
         are similar to bash prompt escape sequences. Thus they are quite handy.
      
      2) We may use the special escape sequence to call shell functions, for
         example "%call(ls -l -a)".
      
      3) We may use :set prompt-function to set PFunction to handle prompt.
         It is just [String] -> Int -> IO String.
      
      Reviewers: erikd, austin, mpickering, bgamari
      
      Reviewed By: mpickering, bgamari
      
      Subscribers: mpickering, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2084
      
      GHC Trac Issues: #5850
      533037cc
  20. 12 Mar, 2016 1 commit
  21. 01 Feb, 2016 1 commit
    • Eric Seidel's avatar
      Hide the CallStack implicit parameter · 94048f9f
      Eric Seidel authored
      The implicit parameter isn't actually very relevant to the CallStack
      machinery, so we hide the implementation details behind a constraint
      alias
      
      ```
      type HasCallStack = (?callStack :: CallStack)
      ```
      
      This has a few benefits:
      
      1. No need to enable `ImplicitParams` in user code.
      2. No need to remember the `?callStack` naming convention.
      3. Gives us the option to change the implementation details in the
      future with less user-land breakage.
      
      The revised `CallStack` API is exported from `GHC.Stack` and makes no
      mention of the implicit parameter.
      
      Test Plan: ./validate
      
      Reviewers: simonpj, austin, hvr, bgamari
      
      Reviewed By: simonpj, bgamari
      
      Subscribers: thomie
      
      Projects: #ghc
      
      Differential Revision: https://phabricator.haskell.org/D1818
      94048f9f
  22. 09 Jan, 2016 1 commit
  23. 08 Jan, 2016 1 commit
  24. 04 Jan, 2016 1 commit
  25. 30 Dec, 2015 1 commit
  26. 23 Dec, 2015 1 commit
  27. 20 Dec, 2015 1 commit
  28. 18 Dec, 2015 1 commit
  29. 16 Dec, 2015 1 commit
    • quchen's avatar
      Add `-W(no-)xxx` aliases for `-f(no-)warn-xxx` flags · 2206fa8c
      quchen authored
      This also updates the user's guide to refer to the `-W`-based warning
      flags by default.
      
      Quoting the release note entry:
      
      | Warnings can now be controlled with `-W(no-)...` flags in addition to
      | the old `-f(no-)warn...` ones. This was done as the first part of a
      | rewrite of the warning system to provide better control over warnings,
      | better warning messages, and more common syntax compared to other
      | compilers. The old `-fwarn...`-based warning flags will remain
      | functional for the forseeable future.
      
      This is part of
      https://ghc.haskell.org/wiki/Design/Warnings
      and addresses #11218
      
      Reviewed By: hvr, bgamari
      
      Differential Revision: https://phabricator.haskell.org/D1613
      2206fa8c
  30. 21 Nov, 2015 1 commit
    • roshats's avatar
      Function definition in GHCi · b98ff3cc
      roshats authored
      This patch allows define and re-define functions in ghci. `let` is not
      required anymore (but can be used).
      
      Idea: If ghci input string can be parsed as statement then run it as
      statement else run it as declaration.
      
      Reviewers: mpickering, bgamari, austin
      
      Reviewed By: mpickering, bgamari, austin
      
      Subscribers: hvr, mpickering, dterei, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1299
      
      GHC Trac Issues: #7253
      b98ff3cc
  31. 24 Oct, 2015 1 commit
  32. 20 Oct, 2015 1 commit
  33. 03 Oct, 2015 1 commit