template-haskell 2.11.0.0 → 2.11.1.0
raw patch · 4 files changed
+28/−10 lines, 4 files
Files
- Language/Haskell/TH/Ppr.hs +11/−6
- Language/Haskell/TH/Syntax.hs +8/−2
- changelog.md +8/−1
- template-haskell.cabal +1/−1
Language/Haskell/TH/Ppr.hs view
@@ -159,12 +159,17 @@ pprExp _ (CompE []) = text "<<Empty CompExp>>" -- This will probably break with fixity declarations - would need a ';'-pprExp _ (CompE ss) = text "[" <> ppr s- <+> text "|"- <+> commaSep ss'- <> text "]"- where s = last ss- ss' = init ss+pprExp _ (CompE ss) =+ if null ss'+ -- If there are no statements in a list comprehension besides the last+ -- one, we simply treat it like a normal list.+ then text "[" <> ppr s <> text "]"+ else text "[" <> ppr s+ <+> text "|"+ <+> commaSep ss'+ <> text "]"+ where s = last ss+ ss' = init ss pprExp _ (ArithSeqE d) = ppr d pprExp _ (ListE es) = brackets (commaSep es) pprExp i (SigE e t) = parensIf (i > noPrec) $ ppr e <+> dcolon <+> ppr t
Language/Haskell/TH/Syntax.hs view
@@ -471,14 +471,20 @@ -- | Add a finalizer that will run in the Q monad after the current module has -- been type checked. This only makes sense when run within a top-level splice.+--+-- The finalizer is given the local type environment at the splice point. Thus+-- 'reify' is able to find the local definitions when executed inside the+-- finalizer. addModFinalizer :: Q () -> Q () addModFinalizer act = Q (qAddModFinalizer (unQ act)) --- | Get state from the 'Q' monad.+-- | Get state from the 'Q' monad. Note that the state is local to the+-- Haskell module in which the Template Haskell expression is executed. getQ :: Typeable a => Q (Maybe a) getQ = Q qGetQ --- | Replace the state in the 'Q' monad.+-- | Replace the state in the 'Q' monad. Note that the state is local to the+-- Haskell module in which the Template Haskell expression is executed. putQ :: Typeable a => a -> Q () putQ x = Q (qPutQ x)
changelog.md view
@@ -1,6 +1,13 @@ # Changelog for [`template-haskell` package](http://hackage.haskell.org/package/template-haskell) -## 2.11.0.0 *TBA*+## 2.11.1.0 Jan 2017++ * Bundled with GHC 8.0.2++ * Fix pretty-printing of list comprehensions with only one statement. Previously this was rendered as `[Foo|]` instead of `Foo]`.+++## 2.11.0.0 May 2016 * Bundled with GHC 8.0.1
template-haskell.cabal view
@@ -1,5 +1,5 @@ name: template-haskell-version: 2.11.0.0+version: 2.11.1.0 -- NOTE: Don't forget to update ./changelog.md license: BSD3 license-file: LICENSE