Skip to content

Commit

Permalink
Merge pull request #245 from simonmichael/master
Browse files Browse the repository at this point in the history
fix build errors with GHC 8.10.1-alpha2
  • Loading branch information
snoyberg authored Jan 27, 2020
2 parents 389d42a + f96f00c commit d3c7e0f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
13 changes: 11 additions & 2 deletions Text/Hamlet.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
Expand Down Expand Up @@ -231,7 +232,11 @@ docToExp env hr scope (DocCond conds final) = do
go (d, docs) = do
let d' = derefToExp ((specialOrIdent, VarE 'or):scope) d
docs' <- docsToExp env hr scope docs
return $ TupE [d', docs']
return $ TupE
#if MIN_VERSION_template_haskell(2,16,0)
$ map Just
#endif
[d', docs']
docToExp env hr scope (DocCase deref cases) = do
let exp_ = derefToExp scope deref
matches <- mapM toMatch cases
Expand Down Expand Up @@ -538,7 +543,11 @@ hamletFileReloadWithSettings hrr settings fp = do
vtToExp (d, vt) = do
d' <- lift d
c' <- toExp vt
return $ TupE [d', c' `AppE` derefToExp [] d]
return $ TupE
#if MIN_VERSION_template_haskell(2,16,0)
$ map Just
#endif
[d', c' `AppE` derefToExp [] d]
where
toExp = c
where
Expand Down
7 changes: 6 additions & 1 deletion Text/Internal/Css.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{-# OPTIONS_HADDOCK hide #-}
-- | This module is only being exposed to work around a GHC bug, its API is not stable

{-# LANGUAGE CPP #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
Expand Down Expand Up @@ -281,7 +282,11 @@ vtToExp :: (Deref, VarType) -> Q Exp
vtToExp (d, vt) = do
d' <- lift d
c' <- c vt
return $ TupE [d', c' `AppE` derefToExp [] d]
return $ TupE
#if MIN_VERSION_template_haskell(2,16,0)
$ map Just
#endif
[d', c' `AppE` derefToExp [] d]
where
c :: VarType -> Q Exp
c VTPlain = [|CDPlain . toCss|]
Expand Down
6 changes: 5 additions & 1 deletion Text/Shakespeare.hs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,11 @@ shakespeareFileReload settings fp = do
vtToExp (d, vt) = do
d' <- lift d
c' <- c vt
return $ TupE [d', c' `AppE` derefToExp [] d]
return $ TupE
#if MIN_VERSION_template_haskell(2,16,0)
$ map Just
#endif
[d', c' `AppE` derefToExp [] d]
where
c :: VarType -> Q Exp
c VTPlain = [|EPlain . $(return $
Expand Down
6 changes: 5 additions & 1 deletion Text/Shakespeare/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,11 @@ derefToExp _ (DerefIntegral i) = LitE $ IntegerL i
derefToExp _ (DerefRational r) = LitE $ RationalL r
derefToExp _ (DerefString s) = LitE $ StringL s
derefToExp s (DerefList ds) = ListE $ map (derefToExp s) ds
derefToExp s (DerefTuple ds) = TupE $ map (derefToExp s) ds
derefToExp s (DerefTuple ds) = TupE $
#if MIN_VERSION_template_haskell(2,16,0)
map Just $
#endif
map (derefToExp s) ds

-- FIXME shouldn't we use something besides a list here?
flattenDeref :: Deref -> Maybe [String]
Expand Down

0 comments on commit d3c7e0f

Please sign in to comment.