Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix build errors with GHC 8.10.1-alpha2 #245

Merged
merged 1 commit into from
Jan 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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