sweet-egison 0.1.1.2 → 0.1.1.3
raw patch · 3 files changed
+15/−6 lines, 3 filesdep ~template-haskell
Dependency ranges changed: template-haskell
Files
- src/Control/Egison/Matcher/Collection.hs +2/−2
- src/Control/Egison/QQ.hs +11/−2
- sweet-egison.cabal +2/−2
src/Control/Egison/Matcher/Collection.hs view
@@ -78,8 +78,8 @@ elmM (List m) _ = m {-# INLINE joinCons #-} joinCons (WC, _, WC) (List _) tgt = [ (undefined, x, undefined) | x <- tgt ]- joinCons (WC, _, _) (List _) tgt = [ (undefined, x, rs) | (x:rs) <- tails tgt ]- joinCons (_, _, _) (List _) tgt = f [] tgt+ joinCons (WC, _, _) (List _) tgt = [ (undefined, x, rs) | (x:rs) <- tails tgt ]+ joinCons (_, _, _) (List _) tgt = f [] tgt where f _ [] = [] f rhs (x : ts) = (reverse rhs, x, ts) : f (x : rhs) ts
src/Control/Egison/QQ.hs view
@@ -6,6 +6,7 @@ -- -- This module provides 'QuasiQuoter' that builds 'Query' from nice pattern expressions. +{-# LANGUAGE CPP #-} {-# LANGUAGE TemplateHaskell #-} module Control.Egison.QQ@@ -185,7 +186,7 @@ mName' <- newName "tmpM" tName' <- newName "tmpT" let pp = toPP p- body' <- go' (p, mName', tName') body+ body' <- go p mName' tName' body pure $ AppE (VarE 'fromList)@@ -195,7 +196,7 @@ mName' <- newName "tmpM" tName' <- newName "tmpT" let pp = toPP p- body' <- go' (p, mName', tName') body+ body' <- go p mName' tName' body pure $ let_ (mNameToVar p mName')@@ -209,7 +210,11 @@ go (Pat.Pattern cName ps) mName tName body | all isPatVar ps = do mNames <- mapM (\_ -> newName "tmpM") ps tNames <- mapM (\_ -> newName "tmpT") ps+#if MIN_VERSION_template_haskell(2,16,0) let pps = map (Just . toPP) ps+#else+ let pps = map toPP ps+#endif body' <- foldrM go' body (zip3 ps mNames tNames) pure $ AppE@@ -219,7 +224,11 @@ go (Pat.Pattern cName ps) mName tName body = do mNames <- mapM (\_ -> newName "tmpM") ps tNames <- mapM (\_ -> newName "tmpT") ps+#if MIN_VERSION_template_haskell(2,16,0) let pps = map (Just . toPP) ps+#else+ let pps = map toPP ps+#endif body' <- foldrM go' body (zip3 ps mNames tNames) pure $ let_
sweet-egison.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.0 name: sweet-egison-version: 0.1.1.2+version: 0.1.1.3 synopsis: Shallow embedding implementation of non-linear pattern matching @@ -47,7 +47,7 @@ , haskell-src-exts , haskell-src-meta , logict ^>=0.7.0- , template-haskell >= 2.16.0.0+ , template-haskell , transformers ghc-options: