1. 19 Dec, 2011 1 commit
    • Ian Lynagh's avatar
      Add a class HasDynFlags(getDynFlags) · 06c6d970
      Ian Lynagh authored
      We no longer have many separate, clashing getDynFlags functions
      
      I've given each GhcMonad its own HasDynFlags instance, rather than
      using UndecidableInstances to make a GhcMonad m => HasDynFlags m
      instance.
      06c6d970
  2. 04 Nov, 2011 1 commit
  3. 03 Oct, 2011 1 commit
  4. 21 Sep, 2011 1 commit
    • Simon Marlow's avatar
      Add support for all top-level declarations to GHCi · 3db75724
      Simon Marlow authored
        This is work mostly done by Daniel Winograd-Cort during his
        internship at MSR Cambridge, with some further refactoring by me.
      
      This commit adds support to GHCi for most top-level declarations that
      can be used in Haskell source files.  Class, data, newtype, type,
      instance are all supported, as are Type Family-related declarations.
      
      The current set of declarations are shown by :show bindings.  As with
      variable bindings, entities bound by newer declarations shadow earlier
      ones.
      
      Tests are in testsuite/tests/ghci/scripts/ghci039--ghci054.
      Documentation to follow.
      3db75724
  5. 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
  6. 03 Jun, 2011 1 commit
  7. 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
  8. 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
  9. 24 Dec, 2010 1 commit
  10. 03 Nov, 2010 1 commit
  11. 27 Oct, 2010 1 commit
    • Simon Marlow's avatar
      Refactoring and tidyup of HscMain and related things (also fix #1666) · 94bf0d36
      Simon Marlow authored
      While trying to fix #1666 (-Werror aborts too early) I decided to some
      tidyup in GHC/DriverPipeline/HscMain.
      
       - The GhcMonad overloading is gone from DriverPipeline and HscMain
         now.  GhcMonad is now defined in a module of its own, and only
         used in the top-level GHC layer.  DriverPipeline and HscMain
         use the plain IO monad and take HscEnv as an argument.
      
       - WarnLogMonad is gone.  printExceptionAndWarnings is now called
         printException (the old name is deprecated).  Session no longer
         contains warnings.
      
       - HscMain has its own little monad that collects warnings, and also
         plumbs HscEnv around.  The idea here is that warnings are collected
         while we're in HscMain, but on exit from HscMain (any function) we
         check for warnings and either print them (via log_action, so IDEs
         can still override the printing), or turn them into an error if
         -Werror is on.
      
       - GhcApiCallbacks is gone, along with GHC.loadWithLogger.  Thomas
         Schilling told me he wasn't using these, and I don't see a good
         reason to have them.
      
       - there's a new pure API to the parser (suggestion from Neil Mitchell):
            parser :: String
                   -> DynFlags
                   -> FilePath
                   -> Either ErrorMessages (WarningMessages, 
                                            Located (HsModule RdrName))
      94bf0d36
  12. 09 Jul, 2010 1 commit
  13. 05 Jul, 2010 1 commit
  14. 25 Jun, 2010 1 commit
  15. 21 Oct, 2009 1 commit
  16. 18 Sep, 2009 1 commit
  17. 06 Jul, 2009 1 commit
  18. 01 Jul, 2009 1 commit
  19. 29 May, 2009 1 commit
  20. 29 Apr, 2009 1 commit
  21. 22 Feb, 2009 1 commit
  22. 27 Jan, 2009 1 commit
  23. 06 Oct, 2008 1 commit
  24. 15 Sep, 2008 1 commit
  25. 31 Jul, 2008 1 commit
  26. 30 Jul, 2008 1 commit
  27. 20 Jul, 2008 1 commit
  28. 11 Jul, 2008 1 commit
  29. 28 May, 2008 1 commit
  30. 03 May, 2008 2 commits
  31. 29 Apr, 2008 1 commit
  32. 05 Apr, 2008 1 commit
    • mnislaih's avatar
      Virtualize the cwd in GHCi · 24f608a8
      mnislaih authored
      This fixes the issue where :list would stop working if the
      program being debugged side-effected the working directory,
      and should prevent other similar issues
      24f608a8
  33. 21 Jan, 2008 1 commit
    • Simon Marlow's avatar
      FIX #2049, another problem with the module context on :reload · eea143f8
      Simon Marlow authored
      The previous attempt to fix this (#1873, #1360) left a problem that
      occurred when the first :load of the program failed (#2049).  
      
      Now I've implemented a different strategy: between :loads, we remember
      all the :module commands, and just replay them after a :reload.  This
      is in addition to remembering all the package modules added with
      :module, which is orthogonal.
      
      This approach is simpler than the previous one, and seems to do the
      right thing in all the cases I could think of.  Let's hope this is the
      last bug in this series...
      eea143f8
  34. 09 Jan, 2008 1 commit
  35. 25 Nov, 2007 1 commit
    • Ian Lynagh's avatar
      MERGED: Make ":" in GHCi repeat the last command · d2b3daa3
      Ian Lynagh authored
      Ian Lynagh <igloo@earth.li>**20071124231857
       It used to be a synonym for ":r" in 6.6.1, but this wasn't documented or
       known about by the developers. In 6.8.1 it was accidentally broken.
       This patch brings it back, but as "repeat the last command", similar to
       pressing enter in gdb. This is almost as good for people who want it to
       reload, and means that it can also be used to repeat commands like :step.
      d2b3daa3
  36. 16 Nov, 2007 1 commit
    • Simon Marlow's avatar
      Attempt at fixing #1873, #1360 · 037aa382
      Simon Marlow authored
      I think I figured out a reasonable way to manage the GHCi context,
      comments welcome.
      
      Rule 1: external package modules in the context are persistent.  That
      is, when you say 'import Data.Maybe' it survives over :load, :add,
      :reload and :cd.
      
      Rule 2: :load and :add remove all home-package modules from the
      context and add the rightmost target, as a *-module if possible.  This
      is as before, and makes sense for :load because we're starting a new
      program; the old home-package modules don't make sense any more.  For
      :add, it usually does what you want, because the new target will
      become the context.
      
      Rule 3: any modules from the context that fail to load during a
      :reload are remembered, and re-added to the context at the next
      successful :reload.
      
      Claus' suggestion about adding the "remembered" modules to the prompt
      prefixed with a ! is implemented but commented out.  I couldn't
      decide whether it was useful or confusing.
      
      One difference that people might notice is that after a :reload where
      there were errors, GHCi would previously dump you in the most recent
      module that it loaded.  Now it dumps you in whatever subset of the
      current context still makes sense, and in the common case that will
      probably be {Prelude}.
      037aa382
  37. 14 Nov, 2007 1 commit
  38. 04 Sep, 2007 1 commit
  39. 03 Sep, 2007 1 commit