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.
      b2bd63f9
  2. 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
      fdf86568
  3. 06 Mar, 2011 1 commit
  4. 10 Jan, 2011 1 commit
    • simonpj@microsoft.com's avatar
      Do dependency analysis when kind-checking type declarations · 6ea06bbf
      simonpj@microsoft.com authored
      This patch fixes Trac #4875.  The main point is to do dependency
      analysis on type and class declarations, and kind-check them in
      dependency order, so as to improve error messages.
      
      This patch means that a few programs that would typecheck before won't
      typecheck any more; but before we were (naughtily) going beyond
      Haskell 98 without any language-extension flags, and Trac #4875
      convinces me that doing so is a Bad Idea.
      
      Here's an example that won't typecheck any more
             data T a b = MkT (a b)
             type F k = T k Maybe
      
      If you look at T on its own you'd default 'a' to kind *->*;
      and then kind-checking would fail on F.
      
      But GHC currently accepts this program beause it looks at
      the *occurrences* of T.
      6ea06bbf
  5. 27 Nov, 2010 1 commit
  6. 19 Dec, 2010 1 commit
  7. 27 Nov, 2010 1 commit
  8. 30 Oct, 2010 1 commit
  9. 15 Nov, 2010 1 commit
  10. 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
  11. 22 Oct, 2010 1 commit
    • simonpj@microsoft.com's avatar
      Add rebindable syntax for if-then-else · 4e0c994e
      simonpj@microsoft.com authored
      There are two main changes
      
       * New LANGUAGE option RebindableSyntax, which implies NoImplicitPrelude
      
       * if-the-else becomes rebindable, with function name "ifThenElse"
         (but case expressions are unaffected)
      
      Thanks to Sam Anklesaria for doing most of the work here
      4e0c994e
  12. 18 Sep, 2010 1 commit
  13. 15 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
          foldRightWithKey
      which works around the fold(r)WithKey addition and deprecation.
      e95ee1f7
  15. 13 Sep, 2010 1 commit
  16. 01 Jul, 2010 1 commit
    • simonpj@microsoft.com's avatar
      Fix second bug in Trac #4127 · 2c183f9b
      simonpj@microsoft.com authored
      This bug concerned the awkward shadowing we do for 
      Template Haskell declaration brackets.  Lots of
      comments in 
      
        Note [Top-level Names in Template Haskell decl quotes]
      2c183f9b
  17. 20 Jun, 2010 2 commits
  18. 18 Jun, 2010 1 commit
  19. 15 Jun, 2010 1 commit
  20. 25 May, 2010 1 commit
    • simonpj@microsoft.com's avatar
      Refactor (again) the handling of default methods · 78693246
      simonpj@microsoft.com authored
      This patch fixes Trac #4056, by 
      
       a) tidying up the treatment of default method names
       b) removing the 'module' argument to newTopSrcBinder
      
      The details aren't that interesting, but the result
      is much tidier. The original bug was a 'nameModule' panic,
      caused by trying to find the module of a top-level name.
      But TH quotes generate Internal top-level names that don't
      have a module, and that is generally a good thing.  
      
      Fixing that in turn led to the default-method refactoring,
      which also makes the Name for a default method be handled
      in the same way as other derived names, generated in BuildTyCl
      via a call newImplicitBinder.  Hurrah.
      78693246
  21. 06 May, 2010 1 commit
  22. 03 Mar, 2010 1 commit
  23. 04 Jan, 2010 1 commit
  24. 02 Jan, 2010 1 commit
  25. 04 Dec, 2009 1 commit
    • simonpj@microsoft.com's avatar
      Use addToUFM_Acc where appropriate · 65277a1c
      simonpj@microsoft.com authored
      This way of extending a UniqFM has existed for some time, but
      we weren't really using it.
      
      addToUFM_Acc	:: Uniquable key =>
      			      (elt -> elts -> elts)	-- Add to existing
      			   -> (elt -> elts)		-- New element
      			   -> UniqFM elts 		-- old
      			   -> key -> elt 		-- new
      			   -> UniqFM elts		-- result
      65277a1c
  26. 15 Nov, 2009 1 commit
  27. 24 Jul, 2009 1 commit
  28. 19 Jul, 2009 1 commit
  29. 07 Jul, 2009 1 commit
  30. 06 Jul, 2009 1 commit
  31. 02 Jul, 2009 1 commit
  32. 26 Apr, 2009 1 commit
  33. 13 Mar, 2009 1 commit
  34. 03 Oct, 2008 2 commits
    • simonpj@microsoft.com's avatar
      Expunge ThFake, cure Trac #2632 · 08a9d734
      simonpj@microsoft.com authored
      This patch fixes a dirty hack (the fake ThFake module), which in turn
      was causing Trac #2632.
      
      The new scheme is that the top-level binders in a TH [d| ... |] decl splice
      get Internal names.  That breaks a previous invariant that things like
      TyCons always have External names, but these TyCons are never long-lived;
      they live only long enough to typecheck the TH quotation; the result is
      discarded.  So it seems cool.
      
      Nevertheless -- Template Haskell folk: please test your code.  The testsuite
      is OK but it's conceivable that I've broken something in TH.  Let's see.
      08a9d734
    • simonpj@microsoft.com's avatar
      Add ASSERTs to all calls of nameModule · 66579ff9
      simonpj@microsoft.com authored
      nameModule fails on an InternalName.  These ASSERTS tell you
      which call failed.
      66579ff9
  35. 05 Aug, 2008 2 commits
    • Simon Marlow's avatar
      Don't warn if 'import Prelude' doesn't import anything · 3245f93f
      Simon Marlow authored
      ... even if Prelude doesn't come from the base package (it might come from
      a old backwards-compatible version of base, for example).
      3245f93f
    • Simon Marlow's avatar
      Add -XPackageImports, new syntax for package-qualified imports · 1867a7bb
      Simon Marlow authored
      Now you can say
        
        import "network" Network.Socket
      
      and get Network.Socket from package "network", even if there are
      multiple Network.Socket modules in scope from different packages
      and/or the current package.
      
      This is not really intended for general use, it's mainly so that we
      can build backwards-compatible versions of packages, where we need to
      be able to do
      
      module GHC.Base (module New.GHC.Base) where
      import "base" GHC.Base as New.GHC.Base
      1867a7bb
  36. 31 Jul, 2008 1 commit
  37. 21 Jul, 2008 1 commit