aboutsummaryrefslogtreecommitdiff
path: root/src/CabalHelper/Compiletime
diff options
context:
space:
mode:
authorjneira <atreyu.bbb@gmail.com>2020-04-16 15:02:54 +0200
committerDaniel Gröber <dxld@darkboxed.org>2020-05-01 18:46:14 +0200
commit5ae2e4a4c75e314d80f0bde52483653dea9d207a (patch)
tree6ebb6f63334ef7fe2284800bed0355801a76cec3 /src/CabalHelper/Compiletime
parentf8e2e11524934115cef22b933a7e5cb3cb3b0f33 (diff)
Support GHC 8.10
Diffstat (limited to 'src/CabalHelper/Compiletime')
-rw-r--r--src/CabalHelper/Compiletime/Data.hs14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/CabalHelper/Compiletime/Data.hs b/src/CabalHelper/Compiletime/Data.hs
index 3533aa7..9586c77 100644
--- a/src/CabalHelper/Compiletime/Data.hs
+++ b/src/CabalHelper/Compiletime/Data.hs
@@ -9,7 +9,7 @@
--
-- http://www.apache.org/licenses/LICENSE-2.0
-{-# LANGUAGE TemplateHaskell, ScopedTypeVariables #-}
+{-# LANGUAGE TemplateHaskell, ScopedTypeVariables, CPP #-}
{-# OPTIONS_GHC -fforce-recomp #-}
{-|
@@ -90,11 +90,19 @@ runtimeSources = $(
let hashes = map (bytestringDigest . sha256) contents
let top_hash = showDigest $ sha256 $ LBS.concat hashes
+ let exprWrapper =
+#if MIN_VERSION_template_haskell(2,16,0)
+ Just
+#else
+ id
+#endif
+
+
thfiles <- forM (map fst files `zip` contents) $ \(f, xs) -> do
- return $ TupE [LitE (StringL f), LitE (StringL (LUTF8.toString xs))]
+ return $ TupE [exprWrapper (LitE (StringL f)), exprWrapper (LitE (StringL (LUTF8.toString xs)))]
- return $ TupE [LitE (StringL top_hash), ListE thfiles]
+ return $ TupE [exprWrapper (LitE (StringL top_hash)), exprWrapper (ListE thfiles)]
)