1
+ {-# LANGUAGE CPP #-}
1
2
{-# LANGUAGE GADTs #-}
2
3
{-# LANGUAGE KindSignatures #-}
3
4
{-# LANGUAGE PatternSynonyms #-}
@@ -63,7 +64,9 @@ pattern Bottom :: () => t ~ a => Depth_ node a t
63
64
pattern Bottom <- (checkBottom -> AtBottom )
64
65
where
65
66
Bottom = Depth_ 0
67
+ #if defined(MIN_VERSION_GLASGOW_HASKELL) && MIN_VERSION_GLASGOW_HASKELL(9,2,0,0)
66
68
{-# INLINE Bottom #-}
69
+ #endif
67
70
68
71
-- | The depth is non-zero.
69
72
pattern Deeper :: () => t ~ node t' => Depth_ node a t' -> Depth_ node a t
@@ -72,7 +75,9 @@ pattern Deeper d <- (checkBottom -> NotBottom d)
72
75
Deeper (Depth_ d)
73
76
| d == maxBound = error " Depth overflow"
74
77
| otherwise = Depth_ (d + 1 )
78
+ #if defined(MIN_VERSION_GLASGOW_HASKELL) && MIN_VERSION_GLASGOW_HASKELL(9,2,0,0)
75
79
{-# INLINE Deeper #-}
80
+ #endif
76
81
77
82
{-# COMPLETE Bottom, Deeper #-}
78
83
@@ -83,7 +88,11 @@ data CheckedBottom node a t where
83
88
checkBottom :: Depth_ node a t -> CheckedBottom node a t
84
89
checkBottom (Depth_ 0 ) = unsafeCoerce AtBottom
85
90
checkBottom (Depth_ d) = unsafeCoerce (NotBottom (Depth_ (d - 1 )))
91
+ #if defined(MIN_VERSION_GLASGOW_HASKELL) && MIN_VERSION_GLASGOW_HASKELL(9,2,0,0)
86
92
{-# INLINE checkBottom #-}
93
+ #else
94
+ {-# NOINLINE checkBottom #-}
95
+ #endif
87
96
88
97
89
98
-- | A version of 'Depth_' for implementing traversals. Conceptually,
@@ -102,7 +111,9 @@ pattern Bottom2 :: () => (t ~ a, u ~ b) => Depth2_ node a t b u
102
111
pattern Bottom2 <- (checkBottom2 -> AtBottom2 )
103
112
where
104
113
Bottom2 = Depth2_ 0
114
+ #if defined(MIN_VERSION_GLASGOW_HASKELL) && MIN_VERSION_GLASGOW_HASKELL(9,2,0,0)
105
115
{-# INLINE Bottom2 #-}
116
+ #endif
106
117
107
118
-- | The depth is non-zero.
108
119
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)
111
122
Deeper2 (Depth2_ d)
112
123
| d == maxBound = error " Depth2 overflow"
113
124
| otherwise = Depth2_ (d + 1 )
125
+ #if defined(MIN_VERSION_GLASGOW_HASKELL) && MIN_VERSION_GLASGOW_HASKELL(9,2,0,0)
114
126
{-# INLINE Deeper2 #-}
127
+ #endif
115
128
116
129
{-# COMPLETE Bottom2, Deeper2 #-}
117
130
@@ -122,4 +135,8 @@ data CheckedBottom2 node a t b u where
122
135
checkBottom2 :: Depth2_ node a t b u -> CheckedBottom2 node a t b u
123
136
checkBottom2 (Depth2_ 0 ) = unsafeCoerce AtBottom2
124
137
checkBottom2 (Depth2_ d) = unsafeCoerce (NotBottom2 (Depth2_ (d - 1 )))
138
+ #if MIN_VERSION_GLASGOW_HASKELL(9,2,0,0)
125
139
{-# INLINE checkBottom2 #-}
140
+ #else
141
+ {-# NOINLINE checkBottom2 #-}
142
+ #endif
0 commit comments