on develop help sign in
Merge pull request #101 from hamishmack/develop

haskell-src-exts 1.18 support

commit0cb3ffcb0544b46e7d6dab01ff07642ce8bbadef authorRyan Trinkle <ryan.trinkle@gmail.com> dateTue 4 Apr 2017, 06:43 (10 years ago) parent0f5b87d5ef29ee
7 files changed+17−6
default.nix+1−1 reflex.cabal+2−2 src/Reflex/Dynamic/TH.hs+10 src/Reflex/Patch.hs+1−1 src/Reflex/Spider/Internal.hs+2 test/GC.hs+1−1 test/Reflex/Test/CrossImpl.hs−1
default.nix+1−1
@@ -10,7 +10,7 @@
1010mkDerivation {
1111 pname = "reflex";
1212 version = "0.5.0";
13− src = builtins.filterSource (path: type: baseNameOf path != ".git") ./.;
13+ src = builtins.filterSource (path: type: !(builtins.elem (baseNameOf path) [ ".git" "dist" ])) ./.;
1414 libraryHaskellDepends = [
1515 base bifunctors containers dependent-map dependent-sum
1616 exception-transformers lens
reflex.cabal+2−2
@@ -107,8 +107,8 @@ library
107107 cpp-options: -DUSE_TEMPLATE_HASKELL
108108 build-depends:
109109 dependent-sum >= 0.3 && < 0.5,
110− haskell-src-exts >= 1.16 && < 1.18,
111− haskell-src-meta == 0.6.*,
110+ haskell-src-exts >= 1.16 && < 1.19,
111+ haskell-src-meta >= 0.6 && < 0.8,
112112 template-haskell >= 2.9 && < 2.12
113113 exposed-modules:
114114 Reflex.Dynamic.TH
src/Reflex/Dynamic/TH.hs+10
@@ -88,12 +88,22 @@ mkDynExp s = case Hs.parseExpWithMode (Hs.defaultParseMode { Hs.extensions = [ H
8888 Hs.ParseFailed (Hs.SrcLoc _ l c) err -> fail $ "mkDyn:" <> show l <> ":" <> show c <> ": " <> err
8989 Hs.ParseOk e -> qDynPure $ return $ everywhere (id `extT` reinstateUnqDyn) $ Hs.toExp $ everywhere (id `extT` antiE) e
9090 where TH.Name (TH.OccName occName) (TH.NameG _ _ (TH.ModName modName)) = 'unqMarker
91+#if MIN_VERSION_haskell_src_exts(1,18,0)
92+ antiE :: Hs.Exp Hs.SrcSpanInfo -> Hs.Exp Hs.SrcSpanInfo
93+ antiE x = case x of
94+ Hs.SpliceExp l se ->
95+ Hs.App l (Hs.Var l $ Hs.Qual l (Hs.ModuleName l modName) (Hs.Ident l occName)) $ case se of
96+ Hs.IdSplice l2 v -> Hs.Var l2 $ Hs.UnQual l2 $ Hs.Ident l2 v
97+ Hs.ParenSplice _ ps -> ps
98+ _ -> x
99+#else
91100 antiE x = case x of
92101 Hs.SpliceExp se ->
93102 Hs.App (Hs.Var $ Hs.Qual (Hs.ModuleName modName) (Hs.Ident occName)) $ case se of
94103 Hs.IdSplice v -> Hs.Var $ Hs.UnQual $ Hs.Ident v
95104 Hs.ParenSplice ps -> ps
96105 _ -> x
106+#endif
97107 reinstateUnqDyn (TH.Name (TH.OccName occName') (TH.NameQ (TH.ModName modName')))
98108 | modName == modName' && occName == occName' = 'unqMarker
99109 reinstateUnqDyn x = x
src/Reflex/Patch.hs+1−1
@@ -205,7 +205,7 @@ mapEditSetMoved moved = \case
205205-- * The same source key may not be moved to two destination keys.
206206-- * Any key that is the source of a Move must also be edited
207207-- (otherwise, the Move would duplicate it)
208−data PatchMapWithMove k v = PatchMapWithMove (Map k (MapEdit k v)) deriving (Show, Eq, Ord, Functor, Foldable, Traversable)
208+newtype PatchMapWithMove k v = PatchMapWithMove (Map k (MapEdit k v)) deriving (Show, Eq, Ord, Functor, Foldable, Traversable)
209209
210210unPatchMapWithMove :: PatchMapWithMove k v -> Map k (MapEdit k v)
211211unPatchMapWithMove (PatchMapWithMove p) = p
src/Reflex/Spider/Internal.hs+2
@@ -8,7 +8,9 @@
88{-# LANGUAGE FunctionalDependencies #-}
99{-# LANGUAGE GADTs #-}
1010{-# LANGUAGE GeneralizedNewtypeDeriving #-}
11+#if defined(DEBUG) || defined(DEBUG_CYCLES)
1112{-# LANGUAGE LambdaCase #-}
13+#endif
1214{-# LANGUAGE MagicHash #-}
1315{-# LANGUAGE MultiParamTypeClasses #-}
1416{-# LANGUAGE MultiWayIf #-}
test/GC.hs+1−1
@@ -1,4 +1,4 @@
1−{-# LANGUAGE OverloadedStrings, FlexibleContexts, GADTs, TypeFamilies, RankNTypes, ScopedTypeVariables, LambdaCase #-}
1+{-# LANGUAGE OverloadedStrings, FlexibleContexts, GADTs, TypeFamilies, RankNTypes, ScopedTypeVariables #-}
22module Main where
33
44import Control.Monad
test/Reflex/Test/CrossImpl.hs−1
@@ -4,7 +4,6 @@
44{-# LANGUAGE FlexibleInstances #-}
55{-# LANGUAGE FunctionalDependencies #-}
66{-# LANGUAGE GADTs #-}
7−{-# LANGUAGE LambdaCase #-}
87{-# LANGUAGE MultiParamTypeClasses #-}
98{-# LANGUAGE NoMonomorphismRestriction #-}
109{-# LANGUAGE RankNTypes #-}