@@ -220,28 +220,31 @@ import Data.Functor.Classes
220
220
import Data.Traversable
221
221
222
222
-- GHC specific stuff
223
- #ifdef __GLASGOW_HASKELL__
224
- import GHC.Exts (build )
223
+ #if defined(__GLASGOW_HASKELL__) || defined(__MHS__)
225
224
import Text.Read (Lexeme (Ident ), lexP , parens , prec ,
226
225
readPrec , readListPrec , readListPrecDefault )
226
+ #endif
227
+ #ifdef __GLASGOW_HASKELL__
228
+ import GHC.Exts (build )
227
229
import Data.Data
228
230
import Data.String (IsString (.. ))
229
231
import qualified Language.Haskell.TH.Syntax as TH
230
232
-- See Note [ Template Haskell Dependencies ]
231
233
import Language.Haskell.TH ()
232
234
import GHC.Generics (Generic , Generic1 )
233
- #endif
234
235
235
236
-- Array stuff, with GHC.Arr on GHC
236
- import Data.Array (Ix , Array )
237
- import qualified Data.Array
238
- #ifdef __GLASGOW_HASKELL__
239
237
import qualified GHC.Arr
238
+ import Data.Coerce
239
+ import qualified GHC.Exts
240
+ #else
241
+ import qualified Data.List
240
242
#endif
241
243
244
+ import Data.Array (Ix , Array )
245
+ import qualified Data.Array
246
+
242
247
import Utils.Containers.Internal.Coercions ((.#) , (.^#) )
243
- import Data.Coerce
244
- import qualified GHC.Exts
245
248
246
249
import Data.Functor.Identity (Identity (.. ))
247
250
@@ -976,7 +979,7 @@ liftCmpLists cmp = go
976
979
{-# INLINE liftCmpLists #-}
977
980
978
981
instance Read a => Read (Seq a ) where
979
- #ifdef __GLASGOW_HASKELL__
982
+ #if defined( __GLASGOW_HASKELL__) || defined(__MHS__)
980
983
readPrec = parens $ prec 10 $ do
981
984
Ident " fromList" <- lexP
982
985
xs <- readPrec
@@ -4260,7 +4263,7 @@ fromList :: [a] -> Seq a
4260
4263
-- it gets a bit hard to read.
4261
4264
fromList = Seq . mkTree . map_elem
4262
4265
where
4263
- #ifdef __GLASGOW_HASKELL__
4266
+ #if defined( __GLASGOW_HASKELL__) || defined(__MHS__)
4264
4267
mkTree :: forall a' . [Elem a' ] -> FingerTree (Elem a' )
4265
4268
#else
4266
4269
mkTree :: [Elem a ] -> FingerTree (Elem a )
@@ -4308,7 +4311,7 @@ fromList = Seq . mkTree . map_elem
4308
4311
where
4309
4312
d2 = Three x1 x2 x3
4310
4313
d1 = Three (Node3 3 x4 x5 x6) (Node3 3 x7 x8 x9) (Node3 3 y0 y1 y2)
4311
- #ifdef __GLASGOW_HASKELL__
4314
+ #if defined( __GLASGOW_HASKELL__) || defined(__MHS__)
4312
4315
cont :: (Digit (Node (Elem a' )), Digit (Elem a' )) -> FingerTree (Node (Node (Elem a' ))) -> FingerTree (Elem a' )
4313
4316
#endif
4314
4317
cont (! r1, ! r2) ! sub =
@@ -4335,7 +4338,7 @@ fromList = Seq . mkTree . map_elem
4335
4338
! n10 = Node3 (3 * s) n1 n2 n3
4336
4339
4337
4340
mkTreeC ::
4338
- #ifdef __GLASGOW_HASKELL__
4341
+ #if defined( __GLASGOW_HASKELL__) || defined(__MHS__)
4339
4342
forall a b c .
4340
4343
#endif
4341
4344
(b -> FingerTree (Node a) -> c)
@@ -4377,7 +4380,7 @@ fromList = Seq . mkTree . map_elem
4377
4380
mkTreeC cont s (LCons x1 (LCons x2 (LCons x3 (LCons x4 (LCons x5 (LCons x6 (LCons x7 (LCons x8 (LCons x9 (LCons y0 (LCons y1 (LCons y2 (LCons y3 (LCons y4 (LCons y5 (LCons y6 xs)))))))))))))))) =
4378
4381
mkTreeC cont2 (9 * s) (getNodesC (3 * s) (Node3 (3 * s) y3 y4 y5) y6 xs)
4379
4382
where
4380
- #ifdef __GLASGOW_HASKELL__
4383
+ #if defined( __GLASGOW_HASKELL__) || defined(__MHS__)
4381
4384
cont2 :: (b , Digit (Node (Node a )), Digit (Node a )) -> FingerTree (Node (Node (Node a ))) -> c
4382
4385
#endif
4383
4386
cont2 (b, r1, r2) ! sub =
0 commit comments