Skip to content

Commit 8563d99

Browse files
committed
Try to fix for old GHC
1 parent 9399062 commit 8563d99

File tree

1 file changed

+17
-0
lines changed
  • containers/src/Data/Sequence/Internal

1 file changed

+17
-0
lines changed

containers/src/Data/Sequence/Internal/Depth.hs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE GADTs #-}
23
{-# LANGUAGE KindSignatures #-}
34
{-# LANGUAGE PatternSynonyms #-}
@@ -63,7 +64,9 @@ pattern Bottom :: () => t ~ a => Depth_ node a t
6364
pattern Bottom <- (checkBottom -> AtBottom)
6465
where
6566
Bottom = Depth_ 0
67+
#if defined(MIN_VERSION_GLASGOW_HASKELL) && MIN_VERSION_GLASGOW_HASKELL(9,2,0,0)
6668
{-# INLINE Bottom #-}
69+
#endif
6770

6871
-- | The depth is non-zero.
6972
pattern Deeper :: () => t ~ node t' => Depth_ node a t' -> Depth_ node a t
@@ -72,7 +75,9 @@ pattern Deeper d <- (checkBottom -> NotBottom d)
7275
Deeper (Depth_ d)
7376
| d == maxBound = error "Depth overflow"
7477
| otherwise = Depth_ (d + 1)
78+
#if defined(MIN_VERSION_GLASGOW_HASKELL) && MIN_VERSION_GLASGOW_HASKELL(9,2,0,0)
7579
{-# INLINE Deeper #-}
80+
#endif
7681

7782
{-# COMPLETE Bottom, Deeper #-}
7883

@@ -83,7 +88,11 @@ data CheckedBottom node a t where
8388
checkBottom :: Depth_ node a t -> CheckedBottom node a t
8489
checkBottom (Depth_ 0) = unsafeCoerce AtBottom
8590
checkBottom (Depth_ d) = unsafeCoerce (NotBottom (Depth_ (d - 1)))
91+
#if defined(MIN_VERSION_GLASGOW_HASKELL) && MIN_VERSION_GLASGOW_HASKELL(9,2,0,0)
8692
{-# INLINE checkBottom #-}
93+
#else
94+
{-# NOINLINE checkBottom #-}
95+
#endif
8796

8897

8998
-- | A version of 'Depth_' for implementing traversals. Conceptually,
@@ -102,7 +111,9 @@ pattern Bottom2 :: () => (t ~ a, u ~ b) => Depth2_ node a t b u
102111
pattern Bottom2 <- (checkBottom2 -> AtBottom2)
103112
where
104113
Bottom2 = Depth2_ 0
114+
#if defined(MIN_VERSION_GLASGOW_HASKELL) && MIN_VERSION_GLASGOW_HASKELL(9,2,0,0)
105115
{-# INLINE Bottom2 #-}
116+
#endif
106117

107118
-- | The depth is non-zero.
108119
pattern Deeper2 :: () => (t ~ node t', u ~ node u') => Depth2_ node a t' b u' -> Depth2_ node a t b u
@@ -111,7 +122,9 @@ pattern Deeper2 d <- (checkBottom2 -> NotBottom2 d)
111122
Deeper2 (Depth2_ d)
112123
| d == maxBound = error "Depth2 overflow"
113124
| otherwise = Depth2_ (d + 1)
125+
#if defined(MIN_VERSION_GLASGOW_HASKELL) && MIN_VERSION_GLASGOW_HASKELL(9,2,0,0)
114126
{-# INLINE Deeper2 #-}
127+
#endif
115128

116129
{-# COMPLETE Bottom2, Deeper2 #-}
117130

@@ -122,4 +135,8 @@ data CheckedBottom2 node a t b u where
122135
checkBottom2 :: Depth2_ node a t b u -> CheckedBottom2 node a t b u
123136
checkBottom2 (Depth2_ 0) = unsafeCoerce AtBottom2
124137
checkBottom2 (Depth2_ d) = unsafeCoerce (NotBottom2 (Depth2_ (d - 1)))
138+
#if MIN_VERSION_GLASGOW_HASKELL(9,2,0,0)
125139
{-# INLINE checkBottom2 #-}
140+
#else
141+
{-# NOINLINE checkBottom2 #-}
142+
#endif

0 commit comments

Comments
 (0)