Skip to content
Snippets Groups Projects
  1. Jan 13, 2020
    • Matthew Pickering's avatar
      Overloaded Quotation Brackets (#246) · 9129210f
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      This patch implements overloaded quotation brackets which generalise the
      desugaring of all quotation forms in terms of a new minimal interface.
      
      The main change is that a quotation, for example, [e| 5 |], will now
      have type `Quote m => m Exp` rather than `Q Exp`. The `Quote` typeclass
      contains a single method for generating new names which is used when
      desugaring binding structures.
      
      The return type of functions from the `Lift` type class, `lift` and `liftTyped` have
      been restricted to `forall m . Quote m => m Exp` rather than returning a
      result in a Q monad.
      
      More details about the feature can be read in the GHC proposal.
      
      https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0246-overloaded-bracket.rst
      9129210f
  2. May 11, 2015
    • Edward Z. Yang's avatar
      Support stage 1 Template Haskell (non-quasi) quotes, fixes #10382. · f16ddcee
      Edward Z. Yang authored
      
      Summary:
      This commit adds stage 1 support for Template Haskell
      quoting, e.g. [| ... expr ... |], which is useful
      for authors of quasiquoter libraries that do not actually
      need splices.  The TemplateHaskell extension now does not
      unconditionally fail; it only fails if the renamer encounters
      a splice that it can't run.
      
      In order to make sure the referenced data structures
      are consistent, template-haskell is now a boot library.
      There are some minor BC changes to template-haskell to make it boot
      on GHC 7.8.
      
      Note for reviewer: big diff changes are simply code
      being moved out of an ifdef; there was no other substantive
      change to that code.
      
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: simonpj, austin, goldfire
      
      Subscribers: bgamari, thomie
      
      Differential Revision: https://phabricator.haskell.org/D876
      
      GHC Trac Issues: #10382
      f16ddcee
  3. May 09, 2015
  4. Jul 20, 2011
  5. Oct 06, 2010
  6. Nov 06, 2003
    • Simon Peyton Jones's avatar
      [project @ 2003-11-06 17:09:59 by simonpj] · 5ed4d1e2
      Simon Peyton Jones authored
      ------------------------------------
      	Major increment for Template Haskell
      	------------------------------------
      
      1.  New abstract data type "Name" which appears where String used to be.
          E.g. 	data Exp = VarE Name | ...
      
      2.  New syntax 'x and ''T, for quoting Names.  It's rather like [| x |]
          and [t| T |] respectively, except that
      
      	a) it's non-monadic:  'x :: Name
      	b) you get a Name not an Exp or Type
      
      3.  reify is an ordinary function
      	reify :: Name -> Q Info
          New data type Info which tells what TH knows about Name
      
      4.  Local variables work properly.  So this works now (crashed before):
      	f x = $( [| x |] )
      
      5.  THSyntax is split up into three modules:
      
        Language.Haskell.TH		TH "clients" import this
      
        Language.Haskell.TH.THSyntax	data type declarations and internal stuff
      
        Language.Haskell.TH.THLib	Support library code (all re-exported
      				by TH), including smart constructors and
      				pretty printer
      
      6.  Error reporting and recovery are in (not yet well tested)
      
      	report :: Bool {- True <=> fatal -} -> String -> Q ()
      	recover :: Q a -> Q a -> Q a
      
      7.  Can find current module
      
      	currentModule :: Q String
      
      
      Much other cleaning up, needless to say.
      5ed4d1e2
  7. Oct 30, 2003
Loading