1. 09 Jun, 2011 1 commit
    • Ian Lynagh's avatar
      Refactor SrcLoc and SrcSpan · b2bd63f9
      Ian Lynagh authored
      The "Unhelpful" cases are now in a separate type. This allows us to
      improve various things, e.g.:
      * Most of the panic's in SrcLoc are now gone
      * The Lexer now works with RealSrcSpans rather than SrcSpans, i.e. it
        knows that it has real locations and thus can assume that the line
        number etc really exists
      * Some of the more suspicious cases are no longer necessary, e.g.
        we no longer need this case in advanceSrcLoc:
            advanceSrcLoc loc _ = loc -- Better than nothing
      More improvements can probably be made, e.g. tick locations can
      probably use RealSrcSpans too.
  2. 04 Jun, 2011 1 commit
  3. 21 Apr, 2011 2 commits
  4. 19 Apr, 2011 1 commit
    • Simon Peyton Jones's avatar
      This BIG PATCH contains most of the work for the New Coercion Representation · fdf86568
      Simon Peyton Jones authored
      See the paper "Practical aspects of evidence based compilation in System FC"
      * Coercion becomes a data type, distinct from Type
      * Coercions become value-level things, rather than type-level things,
        (although the value is zero bits wide, like the State token)
        A consequence is that a coerion abstraction increases the arity by 1
        (just like a dictionary abstraction)
      * There is a new constructor in CoreExpr, namely Coercion, to inject
        coercions into terms
  5. 12 Apr, 2011 1 commit
    • Simon Marlow's avatar
      Change the way module initialisation is done (#3252, #4417) · a52ff761
      Simon Marlow authored
      Previously the code generator generated small code fragments labelled
      with __stginit_M for each module M, and these performed whatever
      initialisation was necessary for that module and recursively invoked
      the initialisation functions for imported modules.  This appraoch had
       - FFI users had to call hs_add_root() to ensure the correct
         initialisation routines were called.  This is a non-standard,
         and ugly, API.
       - unless we were using -split-objs, the __stginit dependencies would
         entail linking the whole transitive closure of modules imported,
         whether they were actually used or not.  In an extreme case (#4387,
         #4417), a module from GHC might be imported for use in Template
         Haskell or an annotation, and that would force the whole of GHC to
         be needlessly linked into the final executable.
      So now instead we do our initialisation with C functions marked with
      __attribute__((constructor)), which are automatically invoked ...
  6. 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.
  7. 25 Jan, 2011 1 commit
    • simonpj@microsoft.com's avatar
      Split main/GHC into GHC and GhcMake · a79a5319
      simonpj@microsoft.com authored
      There are two things going on in main/GHC.hs.
        * It's the root module of the GHC package
        * It contains lots of stuff for --make
      It is also gigantic (2.7k lines)
      This patch splits it into two
        * GHC.hs is the root module for the GHC package
            (1.3k lines)
        * GhcMake.hs contains the stuff for --make
            (1.4k lines)
      Happily the functional split divided it almost
      exactly in half.
      This is a pure refactoring.  There should be no 
      behavioural change.
  8. 10 Jan, 2011 1 commit
  9. 18 Dec, 2010 1 commit
  10. 15 Nov, 2010 1 commit
    • pepeiborra@gmail.com's avatar
      Fix bug #3165 (:history throws irrefutable pattern failed) · add9b7f1
      pepeiborra@gmail.com authored
      I ran across this bug and took the time to fix it, closing
      a long time due TODO in InteractiveEval.hs
      Instead of looking around to find the enclosing declaration
      of a tick, this patch makes use of the information already collected during the
      coverage desugaring phase
  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))
  12. 13 Oct, 2010 1 commit
    • simonpj@microsoft.com's avatar
      Remove GHC.extendGlobalRdrScope, GHC.extendGlobalTypeScope · 762c2432
      simonpj@microsoft.com authored
      These functions were added by
         Tue Apr 18 03:36:06 BST 2006  Lemmih <lemmih@gmail.com>
         * Make the initial rdr and type scope available in the ghc-api
      The are extremely dubious, because they extend the Rdr and Type
      env for every compilation.  The right thing to do is to use
      the InteractiveContext for temporary extensions.
      So far as we know, no one uses them.  And if they are being used
      it's probably a mistake.  So we're backing them out.
  13. 18 Sep, 2010 1 commit
  14. 14 Sep, 2010 1 commit
    • Ian Lynagh's avatar
      Remove (most of) the FiniteMap wrapper · e95ee1f7
      Ian Lynagh authored
      We still have
          insertList, insertListWith, deleteList
      which aren't in Data.Map, and
      which works around the fold(r)WithKey addition and deprecation.
  15. 13 Sep, 2010 1 commit
  16. 31 Jul, 2010 1 commit
  17. 25 Jun, 2010 1 commit
  18. 21 Jun, 2010 1 commit
  19. 15 Jun, 2010 1 commit
  20. 02 Jun, 2010 1 commit
  21. 25 May, 2010 1 commit
  22. 20 Mar, 2010 1 commit
  23. 27 Jan, 2010 1 commit
  24. 12 Jan, 2010 1 commit
    • Simon Marlow's avatar
      Do some recompilation avoidance in GHC.loadModule · ce426964
      Simon Marlow authored
      GHC.loadModule compiles a module after it has been parsed and
      typechecked explicity. If we are compiling to object code and there is
      a valid object file already on disk, then we can skip the compilation
      step. This is useful in Haddock, when processing a package that uses
      Template Haskell and hence needs actual compilation, and the package
      has already been compiled.
      As usual, the recomp avoidance can be disabled with -fforce-recomp.
  25. 04 Jan, 2010 1 commit
    • simonpj@microsoft.com's avatar
      Substantial improvements to coercion optimisation · b06d623b
      simonpj@microsoft.com authored
      The main purpose of this patch is to add a bunch of new rules
      to the coercion optimiser.  They are documented in the (revised)
      Appendix of the System FC paper.  
      Some code has moved about:
      - OptCoercion is now a separate module, mainly because it
        now uses tcMatchTy, which is defined in Unify, so OptCoercion
        must live higehr up in the hierarchy
      - Functions that manipulate Kinds has moved from 
        Type.lhs to Coercion.lhs.  Reason: the function typeKind
        now needs to call coercionKind.  And in any case, a Kind is
        a flavour of Type, so it builds on top of Type; indeed Coercions
        and Kinds are both flavours of Type.
        This change required fiddling with a number of imports, hence
        the one-line changes to otherwise-unrelated modules
      - The representation of CoTyCons in TyCon has changed.   Instead of
        an extensional representation (a kind checker) there is now an
        intensional representation (namely TyCon.CoTyConDesc).  This was
        needed for one of the new coercion optimisations.
  26. 27 Nov, 2009 1 commit
  27. 16 Sep, 2009 1 commit
  28. 26 Aug, 2009 1 commit
  29. 16 Aug, 2009 1 commit
    • Thomas Schilling's avatar
      Make updates to the Finder caches atomic. Well, almost. · f391c6e6
      Thomas Schilling authored
      Flushing and uncaching a single module is not completely atomic since
      both caches a cleared separately.  However, flushing is only done when
      changing the working directory which shouldn't be done concurrently to
      other threads.  Uncaching is only done in 'summariseModule' which
      requires some more work to become thread-safe anyway.
  30. 16 Jul, 2009 1 commit
  31. 07 Jul, 2009 1 commit
  32. 06 Jul, 2009 1 commit
  33. 01 Jul, 2009 1 commit
  34. 04 Jun, 2009 1 commit
  35. 19 May, 2009 1 commit
    • Duncan Coutts's avatar
      When linking a shared library with --make, always do the link step · 8aaa9ef4
      Duncan Coutts authored
      Without -shared, the default target is a binary and in that case
      it makes sense for --make to not try and link a binary when there
      is no Main module. But for a shared library the user already has
      to specify -shared and there's no reason a shared lib should
      contain any Main module or main function.
  36. 21 Apr, 2009 1 commit
    • Simon Marlow's avatar
      FIX #2682: banish silly cases of the "module Foo is not loaded" error · ef03a76a
      Simon Marlow authored
      In GHCi if you say 'import Foo' meaning to load a package module Foo,
      and Foo.hs is found on the search path, then GHCi replies "module Foo
      is not loaded", because it knows Foo refers to the source file rather
      than the package module, and you haven't loaded that module with
      This is consistent with the usual module-finding semantics.  However,
      it isn't particularly useful.  And it leads to silly problems like not
      being able to start GHCi when you happen to be sitting in
      libraries/base, because GHCi thinks the Prelude hasn't been loaded.
      So now I've made a slight change to the way that 'import M' works: if
      M is loaded, then it refers to the loaded module, otherwise it looks
      for a package module M.  This does what the reporter of #2682 wanted,
      and since it turns an error condition into meaningful behaviour it
      can't break anything.  
      The only undesirable consequence is that 'import M' might refer to a
      different M than ':load M'.  Hopefully that won't lead to confusion.
  37. 11 Mar, 2009 1 commit
  38. 11 Dec, 2008 1 commit
  39. 02 Dec, 2008 1 commit