1. 01 Nov, 2012 1 commit
  2. 31 Oct, 2012 1 commit
  3. 03 Sep, 2012 1 commit
  4. 14 Aug, 2012 1 commit
  5. 05 Jul, 2012 1 commit
  6. 20 Jun, 2012 1 commit
  7. 11 Apr, 2012 2 commits
  8. 01 Mar, 2012 1 commit
    • Simon Marlow's avatar
      GHCi: add :seti, for options that apply only at the prompt (#3217) · 2e55760b
      Simon Marlow authored
      GHCi now maintains two DynFlags: one that applies to whole modules
      loaded with :load, and one that applies to things typed at the prompt
      (expressions, statements, declarations, commands).
      
        The :set command modifies both DynFlags.  This is for backwards
        compatibility: users won't notice any difference.
      
        The :seti command applies only to the interactive DynFlags.
      
      Additionally, I made a few changes to ":set" (with no arguments):
      
        * Now it only prints out options that differ from the defaults,
          rather than the whole list.
      
        * There is a new variant, ":set -a" to print out all options (the
          old behaviour).
      
        * It also prints out language options.
      
      e.g.
      
      Prelude> :set
      options currently set: none.
      base language is: Haskell2010
      with the following modifiers:
        -XNoDatatypeContexts
        -XNondecreasingIndentation
      GHCi-specific dynamic flag settings:
      other dynamic, non-language, flag settings:
        -fimplicit-import-qualified
      warning settings:
      
      ":seti" (with no arguments) does the same as ":set", but for the
      interactive options.  It also has the "-a" option.
      
      The interactive DynFlags are kept in the InteractiveContext, and
      copied into the HscEnv at the appropriate points (all in HscMain).
      
      There are some new GHC API operations:
      
      -- | Set the 'DynFlags' used to evaluate interactive expressions.
      setInteractiveDynFlags :: GhcMonad m => DynFlags -> m ()
      
      -- | Get the 'DynFlags' used to evaluate interactive expressions.
      getInteractiveDynFlags :: GhcMonad m => m DynFlags
      
      -- | Sets the program 'DynFlags'.
      setProgramDynFlags :: GhcMonad m => DynFlags -> m [PackageId]
      
      -- | Returns the program 'DynFlags'.
      getProgramDynFlags :: GhcMonad m => m DynFlags
      
      Note I have not completed the whole of the plan outlined in #3217 yet:
      when in the context of a loaded module we don't take the interactive
      DynFlags from that module.  That needs some more refactoring and
      thinking about, because we'll need to save and restore the original
      interactive DynFlags.
      
      This solves the immediate problem that people are having with the new
      flag checking in 7.4.1, because now it is possible to set language
      options in ~/.ghci that do not affect loaded modules and thereby cause
      recompilation.
      2e55760b
  9. 02 Dec, 2011 1 commit
    • Simon Marlow's avatar
      More changes aimed at improving call stacks. · 1469f1eb
      Simon Marlow authored
        - Attach a SrcSpan to every CostCentre.  This had the side effect
          that CostCentres that used to be merged because they had the same
          name are now considered distinct; so I had to add a Unique to
          CostCentre to give them distinct object-code symbols.
      
        - New flag: -fprof-auto-calls.  This flag adds an automatic SCC to
          every call site (application, to be precise).  This is typically
          more useful for call stacks than annotating whole functions.
      
      Various tidy-ups at the same time: removed unused NoCostCentre
      constructor, and refactored a bit in Coverage.lhs.
      
      The call stack we get from traceStack now looks like this:
      
      Stack trace:
        Main.CAF (<entire-module>)
        Main.main.xs (callstack002.hs:18:12-24)
        Main.map (callstack002.hs:13:12-16)
        Main.map.go (callstack002.hs:15:21-34)
        Main.map.go (callstack002.hs:15:21-23)
        Main.f (callstack002.hs:10:7-43)
      1469f1eb
  10. 06 Oct, 2011 1 commit
  11. 04 Oct, 2011 1 commit
  12. 29 Sep, 2011 1 commit
  13. 26 Aug, 2011 1 commit
    • Simon Marlow's avatar
      Clean up the handling of the import and :module commands in GHCi · 79d6745f
      Simon Marlow authored
      Previously we remembered the whole history of commands and replayed
      them on every :load/:reload, which lead to some non-linear performance
      characteristics (#5317).  The handling of the implicit Prelude import
      and the implicit imports of recently loaded modules was also
      complicated and wrong in various obscure ways.
      
      The Prelude import works just like the implicit Prelude import in a
      Haskell module: it can be overriden with an explicit Prelude
      import.
      
      I have added a new ":show imports" command to show which imports are
      currently in force.
      
      Prelude> :show imports
      import Prelude -- implicit
      Prelude> import Prelude ()
      Prelude> :show imports
      import Prelude ()
      Prelude> map
      
      <interactive>:0:1: Not in scope: `map'
      Prelude>
      
      Full documentation in the User's Guide.
      
      There are various other little tweaks and improvements, such as when a
      module is imported with 'as', we now show the 'as' name in the prompt
      rather than the original name.
      79d6745f
  14. 22 Aug, 2011 2 commits
  15. 26 Jun, 2011 1 commit
  16. 31 May, 2011 2 commits
  17. 06 Jan, 2011 1 commit
  18. 05 Nov, 2010 1 commit
    • vivian's avatar
      multiline commands in GHCi #4316 · 4edbeb14
      vivian authored
      This patch adds support for multiline commands in GHCi.
      
      The first line of input is lexed.  If there is an active
      layout context once the lexer reaches the end of file, the
      user is prompted for more input.
      
      Multiline input is exited by an empty line and can be escaped 
      with a user interrupt.
      
      Multiline mode is toggled with `:set +m`
      4edbeb14
  19. 26 Feb, 2011 1 commit
    • vivian's avatar
      :script file scripts in GHCi #1363 · eccb2d89
      vivian authored
      This patch adds the script command in GHCi
      
      A file is read and executed as a series of GHCi commands.
      
      Execution terminates on the first error.  The filename and
      line number are included in the error.
      eccb2d89
  20. 13 Oct, 2010 1 commit
  21. 20 Oct, 2010 1 commit
  22. 08 Jul, 2010 1 commit
  23. 25 Jun, 2010 1 commit
  24. 12 Jun, 2010 1 commit
  25. 25 May, 2010 1 commit
  26. 01 Dec, 2009 1 commit
  27. 17 Nov, 2009 1 commit
  28. 31 Oct, 2008 1 commit
  29. 27 Aug, 2008 1 commit
    • Simon Marlow's avatar
      re-fix of #1205, fix #2542 · 3d73e45b
      Simon Marlow authored
      New form of :load in GHCi:
      
      > :load *A
      
      forces A to be loaded as byte-code.  See the manual for details.  The
      previous behaviour for specifying filenames vs. module names on the
      command line and in :load has been restored.
      
      The Target datatype has a new Bool field, which is True if the target
      is allowed to be loaded from compiled code, or False otherwise, so
      this functionality is available via the GHC API.  guessTarget
      understands the *-prefix form for specifying targets.
      3d73e45b
  30. 05 Aug, 2008 1 commit
  31. 11 Jul, 2008 1 commit
  32. 09 Jul, 2008 1 commit
    • Simon Marlow's avatar
      #1205: ':load foo.hs' in GHCi always compiles to bytecode · 3897d02a
      Simon Marlow authored
      So now
      
        :load foo.hs       loads bytecode for foo.hs, even if foo.o exists
        :load foo          is just shorthand for :load foo.hs
        :load M            loads a module M, as object code if possible
                           (no change here)
      
        :set -fobject-code
        :load foo.hs       loads foo.hs as object code; an existing foo.o
                           can be used.
        
      This turned out to be very straightforward: when building the
      ModSummary for a file (summariseFile) we just ignore the object file
      unless -fobject-code is on.
      3897d02a
  33. 01 May, 2008 1 commit
  34. 26 Feb, 2008 2 commits
  35. 23 Jan, 2008 1 commit
    • Simon Marlow's avatar
      FIX #1838, #1987: change where GHCi searches for config files · f6efe0c7
      Simon Marlow authored
      6.6 behaviour:
        - ./.ghci
        - $HOME/.ghci
      
      6.8.[12] behaviour:
        - ./.ghci
        - Windows: c:/Documents and Settings/<user>/.ghci
        - Unix: $HOME/.ghci
      
      6.10 (and 6.8.3 when this is merged):
        - ./.ghci
        - Windows: c:/Documents and Settings/<user>/Application Data/ghc/ghci.conf
        - Unix: $HOME/.ghc/ghci.conf
        - $HOME/.ghci
      
      We will need to document this in the 6.8.3 release notes because it
      may affect Windows users who have adapted their setup to 6.8.[12].
      f6efe0c7
  36. 19 Jan, 2008 1 commit
    • Ian Lynagh's avatar
      Add :run and tweak :main · c24bd1bb
      Ian Lynagh authored
      You can now give :main a Haskell [String] as an argument, e.g.
      :main ["foo", "bar"]
      and :run is a variant that takes the name of the function to run.
      Also, :main now obeys the -main-is flag.
      c24bd1bb