1. 05 May, 2010 1 commit
  2. 02 Mar, 2010 4 commits
  3. 10 Feb, 2010 1 commit
    • simonpj@microsoft.com's avatar
      Simplify syntax for quasi-quotation · 26f164e5
      simonpj@microsoft.com authored
      After some discussion we decided to make a quasi-quote look like
      
         [pads| ...blah... |]
      
      rather than
      
         [$pads| ...blah... |]
      
      as before. The new syntax is quieter, although it does not signal
      quite as clearly that there is a splice going on.
      26f164e5
  4. 16 Jan, 2010 2 commits
  5. 17 Dec, 2009 1 commit
  6. 10 Dec, 2009 1 commit
    • Simon Marlow's avatar
      Fix #3741, simplifying things in the process · f4b72748
      Simon Marlow authored
      The problem in #3741 was that we had confused column numbers with byte
      offsets, which fails in the case of UTF-8 (amongst other things).
      Fortunately we're tracking correct column offsets now, so we didn't
      have to make a calculation based on a byte offset.  I got rid of two
      fields from the PState (last_line_len and last_offs).and one field
      from the AI (alex input) constructor.
      f4b72748
  7. 05 Dec, 2009 1 commit
  8. 03 Dec, 2009 2 commits
  9. 29 Nov, 2009 3 commits
  10. 27 Nov, 2009 2 commits
  11. 18 Sep, 2009 1 commit
  12. 25 Nov, 2009 7 commits
  13. 24 Nov, 2009 1 commit
  14. 06 Nov, 2009 1 commit
    • Ben.Lippmeier@anu.edu.au's avatar
      * Refactor CLabel.RtsLabel to CLabel.CmmLabel · a02e7f40
      Ben.Lippmeier@anu.edu.au authored
      The type of the CmmLabel ctor is now
        CmmLabel :: PackageId -> FastString -> CmmLabelInfo -> CLabel
        
       - When you construct a CmmLabel you have to explicitly say what
         package it is in. Many of these will just use rtsPackageId, but
         I've left it this way to remind people not to pretend labels are
         in the RTS package when they're not. 
         
       - When parsing a Cmm file, labels that are not defined in the 
         current file are assumed to be in the RTS package. 
         
         Labels imported like
            import label
         are assumed to be in a generic "foreign" package, which is different
         from the current one.
         
         Labels imported like
            import "package-name" label
         are marked as coming from the named package.
         
         This last one is needed for the integer-gmp library as we want to
         refer to labels that are not in the same compilation unit, but
         are in the same non-rts package.
         
         This should help remove the nasty #ifdef __PIC__ stuff from
         integer-gmp/cbits/gmp-wrappers.cmm
         
      a02e7f40
  15. 29 Oct, 2009 1 commit
  16. 28 Oct, 2009 1 commit
    • simonpj@microsoft.com's avatar
      Add 'rec' to stmts in a 'do', and deprecate 'mdo' · f04dead9
      simonpj@microsoft.com authored
      The change is this (see Trac #2798).  Instead of writing
      
        mdo { a <- getChar
            ; b <- f c
            ; c <- g b
            ; putChar c
            ; return b }
      
      you would write
      
        do { a <- getChar
           ; rec { b <- f c
                 ; c <- g b }
           ; putChar c
           ; return b }
      
      That is, 
        * 'mdo' is eliminated 
        * 'rec' is added, which groups a bunch of statements
          into a single recursive statement
      
      This 'rec' thing is already present for the arrow notation, so it  
      makes the two more uniform.  Moreover, 'rec' lets you say more
      precisely where the recursion is (if you want to), whereas 'mdo' just
      says "there's recursion here somewhere".  Lastly, all this works with
      rebindable syntax (which mdo does not).
      
      Currently 'mdo' is enabled by -XRecursiveDo.  So we now deprecate this
      flag, with another flag -XDoRec to enable the 'rec' keyword.
      
      Implementation notes:
        * Some changes in Lexer.x
        * All uses of RecStmt now use record syntax
      
      I'm still not really happy with the "rec_ids" and "later_ids" in the
      RecStmt constructor, but I don't dare change it without consulting Ross
      about the consequences for arrow syntax.
      f04dead9
  17. 07 Oct, 2009 1 commit
  18. 10 Sep, 2009 1 commit
    • simonpj@microsoft.com's avatar
      Three improvements to Template Haskell (fixes #3467) · 1e436f2b
      simonpj@microsoft.com authored
      This patch implements three significant improvements to Template Haskell.
        
      Declaration-level splices with no "$" 
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      This change simply allows you to omit the "$(...)" wrapper for 
      declaration-level TH splices.  An expression all by itself is
      not legal, so we now treat it as a TH splice.  Thus you can now
      say
      	data T = T1 | T2
       	deriveMyStuff ''T
      
      where deriveMyStuff :: Name -> Q [Dec]
      This makes a much nicer interface for clients of libraries that use
      TH: no scary $(deriveMyStuff ''T).
      
      Nested top-level splices
      ~~~~~~~~~~~~~~~~~~~~~~~~
      Previously TH would reject this, saying that splices cannot be nested:
      	f x = $(g $(h 'x))
      But there is no reason for this not to work.  First $(h 'x) is run,
      yielding code <blah> that is spliced instead of the $(h 'x). Then (g
      <blah>) is typechecked and run, yielding code that replaces the
      $(g ...) splice.  
      
      So this simply lifts the restriction.
      
      Fix Trac #3467: non-top-level type splices
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      It appears that when I added the ability to splice types in TH
      programs, I failed to pay attention to non-top-level splices -- that
      is, splices inside quotatation brackets.  
      
      This patch fixes the problem.  I had to modify HsType, so there's a
      knock-on change to Haddock.
      
      Its seems that a lot of lines of code has changed, but almost all the
      new lines are comments!
      
      General tidying up
      ~~~~~~~~~~~~~~~~~~
      As a result of thinking all this out I re-jigged the data type ThStage,
      which had far too many values before.  And I wrote a nice state transition
      diagram to make it all precise; 
         see Note [Template Haskell state diagram] in TcSplice
      
      Lots more refactoring in TcSplice, resulting in significantly less code.
      (A few more lines, but actually less code -- the rest is comments.)
      
      I think the result is significantly cleaner.
      1e436f2b
  19. 05 Sep, 2009 1 commit
  20. 27 Jul, 2009 1 commit
  21. 25 Jul, 2009 1 commit
  22. 24 Jul, 2009 1 commit
  23. 17 Jul, 2009 1 commit
  24. 09 Jul, 2009 2 commits
  25. 02 Jul, 2009 1 commit