1. 10 Feb, 2015 1 commit
    • Simon Peyton Jones's avatar
      Refactor the handling of quasi-quotes · f46360ed
      Simon Peyton Jones authored
      As Trac #10047 points out, a quasi-quotation [n|...blah...|] is supposed
      to behave exactly like $(n "...blah...").  But it doesn't!  This was outright
      wrong: quasiquotes were being run even inside brackets.
      
      Now that TH supports both typed and untyped splices, a quasi-quote is properly
      regarded as a particular syntax for an untyped splice. But apart from that
      they should be treated the same.  So this patch refactors the handling of
      quasiquotes to do just that.
      
      The changes touch quite a lot of files, but mostly in a routine way.
      The biggest changes by far are in RnSplice, and more minor changes in
      TcSplice.  These are the places where there was real work to be done.
      Everything else is routine knock-on changes.
      
      * No more QuasiQuote forms in declarations, expressions, types, etc.
        So we get rid of these data constructors
          * HsBinds.QuasiQuoteD
          * HsExpr.HsSpliceE
          * HsPat.QuasiQuotePat
          * HsType.HsQuasiQuoteTy
      
      * We get rid of the HsQuasiQuote type altogether
      
      * Instead, we augment the HsExpr.HsSplice type to have three
        consructors, for the three types of splice:
          * HsTypedSplice
          * HsUntypedSplice
          * HsQuasiQuote
        There are some related changes in the data types in HsExpr near HsSplice.
        Specifically: PendingRnSplice, PendingTcSplice, UntypedSpliceFlavour.
      
      * In Hooks, we combine rnQuasiQuoteHook and rnRnSpliceHook into one.
        A smaller, clearer interface.
      
      * We have to update the Haddock submodule, to accommodate the hsSyn changes
      f46360ed
  2. 20 Dec, 2014 1 commit
    • Luite Stegeman's avatar
      add runMeta hook · e7eef005
      Luite Stegeman authored
      Summary:
      The runMeta hook can be used to override how metaprogramming expressions
      are evaluated. It makes the metaprogramming request types explicit and
      has access to the TcM monad. This makes it a much more convenient starting
      point for implementing out of process Template Haskell than the existing
      hscCompileCoreExpr hook.
      
      Reviewers: hvr, edsko, austin, simonpj
      
      Reviewed By: austin
      
      Subscribers: thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D501
      e7eef005
  3. 15 Dec, 2014 1 commit
    • Simon Peyton Jones's avatar
      Fix dll-split problem with patch 'Make Core Lint check for locally-bound GlobalId' · 3f87866a
      Simon Peyton Jones authored
      The trouble was that my changes made a lot more files transitively link with
      DynFlags, which is the root module for the revolting Windows dll-split stuff.
      
      Anyway this patch fixes it, in a good way:
      
       - Make GHC/Hooks *not* import DsMonad, because DsMonad imports too
         much other stuff (notably tcLookup variants).  Really, Hooks depends
         only on *types* not *code*.
      
       - To do this I need the DsM type, and the types it depends on,
         not to be part of DsMonad.  So I moved it to TcRnTypes, which is
         where the similar pieces for the TcM and IfM monads live.
      
       - We can then delete DsMonad.hs-boot
      
       - There are a bunch of knock-on change, of no great significance
      3f87866a
  4. 03 Dec, 2014 1 commit
  5. 03 May, 2014 1 commit
  6. 08 Jan, 2014 1 commit
  7. 27 Dec, 2013 1 commit
    • Edsko de Vries's avatar
      Add hook for splicing in renamer · df2dd64d
      Edsko de Vries authored
      With the recent modifications to the TH infrastructure, many splices are now
      expanded in the renamer rather than the typechecker. This means that tools
      which inspect the renamed tree don't get to see the original splices. Added a
      new hook which gets called before such a splice gets expanded, analogous to the
      runQuasiQuoteHook.
      df2dd64d
  8. 22 Sep, 2013 1 commit