1. 26 Sep, 2015 1 commit
    • Ömer Sinan Ağacan's avatar
      reify associated types when reifying typeclasses(#10891) · b4d43b4e
      Ömer Sinan Ağacan authored
      As reported in Trac #10891, Template Haskell's `reify` was not
      generating Decls for associated types. This patch fixes that.
      
      Note that even though `reifyTyCon` function used in this patch returns
      some type instances, I'm ignoring that.
      
      Here's an example of how associated types are encoded with this patch:
      
      (Simplified representation)
      
          class C a where
            type F a :: *
      
          -->
      
          OpenTypeFamilyD "F" ["a"]
      
      With default type instances:
      
          class C a where
            type F a :: *
            type F a = a
      
          -->
      
          OpenTypeFamilyD "F" ["a"]
          TySynInstD "F" (TySynEqn [VarT "a"] "a")
      
      Test Plan:
      This patch was already reviewed and even merged. The patch is later
      reverted because apparently it broke the build some time between the
      validation of this patch and merge. Creating this new ticket to fix the
      validation.
      
      Reviewers: goldfire, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1277
      
      GHC Trac Issues: #10891
      b4d43b4e
  2. 23 Sep, 2015 2 commits
    • Austin Seipp's avatar
      Revert "reify associated types when reifying typeclasses" · 39a262e5
      Austin Seipp authored
      This caused the build to fail, due to some type checking errors. Whoops.
      
      This reverts commit 5c115236.
      39a262e5
    • Ömer Sinan Ağacan's avatar
      reify associated types when reifying typeclasses · 5c115236
      Ömer Sinan Ağacan authored
      As reported in Trac #10891, Template Haskell's `reify` was not generating Decls
      for associated types. This patch fixes that.
      
      Note that even though `reifyTyCon` function used in this patch returns some
      type instances, I'm ignoring that.
      
      Here's an example of how associated types are encoded with this patch:
      
      (Simplified representation)
      
          class C a where
            type F a :: *
      
          -->
      
          OpenTypeFamilyD "F" ["a"]
      
      With default type instances:
      
          class C a where
            type F a :: *
            type F a = a
      
          -->
      
          OpenTypeFamilyD "F" ["a"]
          TySynInstD "F" (TySynEqn [VarT "a"] "a")
      
      Reviewed By: goldfire
      
      Differential Revision: https://phabricator.haskell.org/D1254
      
      GHC Trac Issues: #10891
      5c115236
  3. 05 Aug, 2015 1 commit
    • Ryan Scott's avatar
      Add Fixity info for infix types · 575abf42
      Ryan Scott authored
      Template Haskell allows reification of fixity for infix functions and
      data constructors, and not for infix types. This adds a `Fixity` field
      to the relevant `Info` constructors that can have infix types (`ClassI`,
      `TyConI`, and `FamilyI`).
      
      I don't think that `VarI` or `PrimTyConI` can be infix, but I could be
      wrong.
      
      Test Plan: ./validate
      
      Reviewers: austin, goldfire, bgamari
      
      Reviewed By: goldfire, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1109
      
      GHC Trac Issues: #10704
      575abf42
  4. 02 Nov, 2014 1 commit
  5. 14 Mar, 2014 1 commit
    • eir@cis.upenn.edu's avatar
      Fix #8884. · 8c5ea91d
      eir@cis.upenn.edu authored
      There were two unrelated errors fixed here:
       1) Make sure that only the *result kind* is reified when reifying
          a type family. Previously, the whole kind was reified, which
          defies the TH spec.
      
       2) Omit kind patterns in equations.
      8c5ea91d
  6. 18 Sep, 2013 1 commit
  7. 02 Aug, 2013 1 commit
    • eir@cis.upenn.edu's avatar
      Add tests for roles. · 929155fa
      eir@cis.upenn.edu authored
      Many of the files modified are just wibbles to output, because now
      tycons have roles attached to them, which are produced in the debugging
      dumps.
      929155fa
  8. 12 Jan, 2012 1 commit
  9. 01 Sep, 2011 1 commit
  10. 20 Jul, 2011 1 commit
  11. 21 Jul, 2010 1 commit
  12. 28 Nov, 2009 1 commit
  13. 07 Aug, 2008 1 commit
  14. 06 Aug, 2008 1 commit
  15. 27 May, 2007 1 commit
  16. 05 Sep, 2006 1 commit
  17. 27 Jul, 2006 1 commit
  18. 23 Feb, 2006 1 commit
  19. 23 Dec, 2004 1 commit
    • simonpj's avatar
      [project @ 2004-12-23 09:07:39 by simonpj] · aaf9f205
      simonpj authored
      ---------------------------------
                Template Haskell: names again
        	---------------------------------
      
      On 2 Dec 04 I made this commit (1.58 in Convert.lhs)
      
          Fix a Template Haskell bug that meant that top-level names created
          with newName were not made properly unique.
      
      But that just introduced a new bug!  THe trouble is that names created by
      newName are NameUs; but I was *also* using NameU for names of free varaibles,
      such as the 'x' in the quoted code here
      	f x = $( g [| \y -> (x,y) |])
      
      But when converting to HsSyn, the x and y must be treated diffferently.
      The 'x' must convert to an Exact RdrName, so that it binds to the 'x' that's
      in the type environment; but the 'y' must generate a nice unique RdrName.
      
      So this commit adds NameL for the lexically-scoped bindings like 'x'.
      aaf9f205
  20. 21 Jun, 2004 1 commit
  21. 01 Jun, 2004 1 commit
    • igloo's avatar
      [project @ 2004-06-01 23:22:33 by igloo] · f07f8197
      igloo authored
      Add missing functions to TH export list (mostly spotted by Duncan Coutts).
      
      Update TH test output.
      
      Add TH support for patterns with type signatures, and test for same
      (requested by Isaac Jones).
      
      Add TH support for pattern guards, and tests for same
      (requested by Isaac Jones).
      
      Add infix patterns to TH datatypes.
      
      Added Lift instances for 2- to 7-tuples (requested by Duncan Coutts).
      f07f8197
  22. 15 Jan, 2004 1 commit
  23. 06 Nov, 2003 1 commit
    • simonpj's avatar
      [project @ 2003-11-06 17:09:59 by simonpj] · 5ed4d1e2
      simonpj 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