support template-haskell 2.16, build with GHC 8.10
This commit is contained in:
parent
873bee0cfa
commit
dd649bf238
@ -84,7 +84,12 @@ mkRenderRouteClauses =
|
|||||||
let cons y ys = InfixE (Just y) colon (Just ys)
|
let cons y ys = InfixE (Just y) colon (Just ys)
|
||||||
let pieces' = foldr cons (VarE a) piecesSingle
|
let pieces' = foldr cons (VarE a) piecesSingle
|
||||||
|
|
||||||
let body = LamE [TupP [VarP a, VarP b]] (TupE [pieces', VarE b]) `AppE` (rr `AppE` VarE child)
|
let body = LamE [TupP [VarP a, VarP b]] (TupE
|
||||||
|
#if MIN_VERSION_template_haskell(2,16,0)
|
||||||
|
$ map Just
|
||||||
|
#endif
|
||||||
|
[pieces', VarE b]
|
||||||
|
) `AppE` (rr `AppE` VarE child)
|
||||||
|
|
||||||
return $ Clause [pat] (NormalB body) [FunD childRender childClauses]
|
return $ Clause [pat] (NormalB body) [FunD childRender childClauses]
|
||||||
|
|
||||||
@ -119,11 +124,20 @@ mkRenderRouteClauses =
|
|||||||
let cons y ys = InfixE (Just y) colon (Just ys)
|
let cons y ys = InfixE (Just y) colon (Just ys)
|
||||||
let pieces = foldr cons (VarE a) piecesSingle
|
let pieces = foldr cons (VarE a) piecesSingle
|
||||||
|
|
||||||
return $ LamE [TupP [VarP a, VarP b]] (TupE [pieces, VarE b]) `AppE` (rr `AppE` VarE x)
|
return $ LamE [TupP [VarP a, VarP b]] (TupE
|
||||||
|
#if MIN_VERSION_template_haskell(2,16,0)
|
||||||
|
$ map Just
|
||||||
|
#endif
|
||||||
|
[pieces, VarE b]
|
||||||
|
) `AppE` (rr `AppE` VarE x)
|
||||||
_ -> do
|
_ -> do
|
||||||
colon <- [|(:)|]
|
colon <- [|(:)|]
|
||||||
let cons a b = InfixE (Just a) colon (Just b)
|
let cons a b = InfixE (Just a) colon (Just b)
|
||||||
return $ TupE [foldr cons piecesMulti piecesSingle, ListE []]
|
return $ TupE
|
||||||
|
#if MIN_VERSION_template_haskell(2,16,0)
|
||||||
|
$ map Just
|
||||||
|
#endif
|
||||||
|
[foldr cons piecesMulti piecesSingle, ListE []]
|
||||||
|
|
||||||
return $ Clause [pat] (NormalB body) []
|
return $ Clause [pat] (NormalB body) []
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user