From 2fa686c70d4f10993ca7c73b510e18568620b1d0 Mon Sep 17 00:00:00 2001 From: Fumiaki Kinoshita Date: Wed, 1 May 2019 21:23:12 +0900 Subject: [PATCH] support template-haskell-2.15 --- Data/Vector/Unboxed/Deriving.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Data/Vector/Unboxed/Deriving.hs b/Data/Vector/Unboxed/Deriving.hs index 52380b6..e27e954 100644 --- a/Data/Vector/Unboxed/Deriving.hs +++ b/Data/Vector/Unboxed/Deriving.hs @@ -126,7 +126,11 @@ derivingUnbox name argsQ toRepQ fromRepQ = do # define MAYBE_KIND # define MAYBE_OVERLAP #endif +#if MIN_VERSION_template_haskell(2,15,0) + let newtypeMVector = NewtypeInstD [] Nothing (ConT ''MVector `AppT` s `AppT` typ) MAYBE_KIND +#else let newtypeMVector = NewtypeInstD [] ''MVector [s, typ] MAYBE_KIND +#endif (NormalC mvName [(lazy, ConT ''MVector `AppT` s `AppT` rep)]) [] let mvCon = ConE mvName let instanceMVector = InstanceD MAYBE_OVERLAP cxts @@ -147,8 +151,13 @@ derivingUnbox name argsQ toRepQ fromRepQ = do , wrap 'M.basicUnsafeMove [mv, mv'] id , wrap 'M.basicUnsafeGrow [mv, n] (liftE mvCon) ] +#if MIN_VERSION_template_haskell(2,15,0) + let newtypeVector = NewtypeInstD [] Nothing (ConT ''Vector `AppT` typ) MAYBE_KIND + (NormalC vName [(lazy, ConT ''Vector `AppT` rep)]) [] +#else let newtypeVector = NewtypeInstD [] ''Vector [typ] MAYBE_KIND (NormalC vName [(lazy, ConT ''Vector `AppT` rep)]) [] +#endif let vCon = ConE vName let instanceVector = InstanceD MAYBE_OVERLAP cxts (ConT ''G.Vector `AppT` ConT ''Vector `AppT` typ) $ concat @@ -193,4 +202,3 @@ Consult the