Skip to content

Commit de9d2b0

Browse files
authored
Merge pull request #360 from phadej/semialign-1.1
Support semialign-1.1
2 parents 55a1e29 + 74c1db3 commit de9d2b0

File tree

4 files changed

+21
-6
lines changed

4 files changed

+21
-6
lines changed

reflex.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ library
7878

7979
if flag(split-these)
8080
build-depends: these >= 1 && <1.1,
81-
semialign >=1 && <1.1,
81+
semialign >=1 && <1.2,
8282
monoidal-containers >= 0.6 && < 0.7
8383
else
8484
build-depends: these >= 0.4 && <0.9,

src/Reflex/Class.hs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,15 @@ module Reflex.Class
173173
, slowHeadE
174174
) where
175175

176-
#if defined(MIN_VERSION_semialign)
176+
#ifdef MIN_VERSION_semialign
177177
import Prelude hiding (zip, zipWith)
178178

179179
#if MIN_VERSION_these(0,8,0)
180180
import Data.These.Combinators (justThese)
181181
#endif
182+
#if MIN_VERSION_semialign(1,1,0)
183+
import Data.Zip (Zip (..))
184+
#endif
182185
#endif
183186

184187
import Control.Applicative
@@ -1077,7 +1080,10 @@ instance Reflex t => Semialign (Event t) where
10771080
#endif
10781081
align = alignEventWithMaybe Just
10791082

1080-
#if defined(MIN_VERSION_semialign)
1083+
#ifdef MIN_VERSION_semialign
1084+
#if MIN_VERSION_semialign(1,1,0)
1085+
instance Reflex t => Zip (Event t) where
1086+
#endif
10811087
zip x y = mapMaybe justThese $ align x y
10821088
#endif
10831089

src/Reflex/Collection.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ module Reflex.Collection
2727
, simpleList
2828
) where
2929

30-
#if defined(MIN_VERSION_semialign)
30+
#ifdef MIN_VERSION_semialign
3131
import Prelude hiding (zip, zipWith)
32+
#if MIN_VERSION_semialign(1,1,0)
33+
import Data.Zip (Zip (..))
34+
#endif
3235
#endif
3336

3437
import Control.Monad.Identity

src/Reflex/Spider/Internal.hs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,13 @@ import System.IO.Unsafe
7272
import System.Mem.Weak
7373
import Unsafe.Coerce
7474

75-
#if defined(MIN_VERSION_semialign)
75+
#ifdef MIN_VERSION_semialign
7676
#if MIN_VERSION_these(0,8,0)
7777
import Data.These.Combinators (justThese)
7878
#endif
79+
#if MIN_VERSION_semialign(1,1,0)
80+
import Data.Zip (Zip (..))
81+
#endif
7982
#endif
8083

8184
#ifdef DEBUG_CYCLES
@@ -1163,7 +1166,10 @@ instance HasSpiderTimeline x => Semialign (Event x) where
11631166
align ea eb = mapMaybe dmapToThese $ mergeG coerce $ dynamicConst $
11641167
DMap.fromDistinctAscList [LeftTag :=> ea, RightTag :=> eb]
11651168

1166-
#if defined(MIN_VERSION_semialign)
1169+
#ifdef MIN_VERSION_semialign
1170+
#if MIN_VERSION_semialign(1,1,0)
1171+
instance HasSpiderTimeline x => Zip (Event x) where
1172+
#endif
11671173
zip x y = mapMaybe justThese $ align x y
11681174
#endif
11691175

0 commit comments

Comments
 (0)