@@ -220,28 +220,31 @@ import Data.Functor.Classes
220220import Data.Traversable
221221
222222-- GHC specific stuff
223- #ifdef __GLASGOW_HASKELL__
224- import GHC.Exts (build )
223+ #if defined(__GLASGOW_HASKELL__) || defined(__MHS__)
225224import Text.Read (Lexeme (Ident ), lexP , parens , prec ,
226225 readPrec , readListPrec , readListPrecDefault )
226+ #endif
227+ #ifdef __GLASGOW_HASKELL__
228+ import GHC.Exts (build )
227229import Data.Data
228230import Data.String (IsString (.. ))
229231import qualified Language.Haskell.TH.Syntax as TH
230232-- See Note [ Template Haskell Dependencies ]
231233import Language.Haskell.TH ()
232234import GHC.Generics (Generic , Generic1 )
233- #endif
234235
235236-- Array stuff, with GHC.Arr on GHC
236- import Data.Array (Ix , Array )
237- import qualified Data.Array
238- #ifdef __GLASGOW_HASKELL__
239237import qualified GHC.Arr
238+ import Data.Coerce
239+ import qualified GHC.Exts
240+ #else
241+ import qualified Data.List
240242#endif
241243
244+ import Data.Array (Ix , Array )
245+ import qualified Data.Array
246+
242247import Utils.Containers.Internal.Coercions ((.#) , (.^#) )
243- import Data.Coerce
244- import qualified GHC.Exts
245248
246249import Data.Functor.Identity (Identity (.. ))
247250
@@ -976,7 +979,7 @@ liftCmpLists cmp = go
976979{-# INLINE liftCmpLists #-}
977980
978981instance Read a => Read (Seq a ) where
979- #ifdef __GLASGOW_HASKELL__
982+ #if defined( __GLASGOW_HASKELL__) || defined(__MHS__)
980983 readPrec = parens $ prec 10 $ do
981984 Ident " fromList" <- lexP
982985 xs <- readPrec
@@ -4260,7 +4263,7 @@ fromList :: [a] -> Seq a
42604263-- it gets a bit hard to read.
42614264fromList = Seq . mkTree . map_elem
42624265 where
4263- #ifdef __GLASGOW_HASKELL__
4266+ #if defined( __GLASGOW_HASKELL__) || defined(__MHS__)
42644267 mkTree :: forall a' . [Elem a' ] -> FingerTree (Elem a' )
42654268#else
42664269 mkTree :: [Elem a ] -> FingerTree (Elem a )
@@ -4308,7 +4311,7 @@ fromList = Seq . mkTree . map_elem
43084311 where
43094312 d2 = Three x1 x2 x3
43104313 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__)
43124315 cont :: (Digit (Node (Elem a' )), Digit (Elem a' )) -> FingerTree (Node (Node (Elem a' ))) -> FingerTree (Elem a' )
43134316#endif
43144317 cont (! r1, ! r2) ! sub =
@@ -4335,7 +4338,7 @@ fromList = Seq . mkTree . map_elem
43354338 ! n10 = Node3 (3 * s) n1 n2 n3
43364339
43374340 mkTreeC ::
4338- #ifdef __GLASGOW_HASKELL__
4341+ #if defined( __GLASGOW_HASKELL__) || defined(__MHS__)
43394342 forall a b c .
43404343#endif
43414344 (b -> FingerTree (Node a) -> c)
@@ -4377,7 +4380,7 @@ fromList = Seq . mkTree . map_elem
43774380 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)))))))))))))))) =
43784381 mkTreeC cont2 (9 * s) (getNodesC (3 * s) (Node3 (3 * s) y3 y4 y5) y6 xs)
43794382 where
4380- #ifdef __GLASGOW_HASKELL__
4383+ #if defined( __GLASGOW_HASKELL__) || defined(__MHS__)
43814384 cont2 :: (b , Digit (Node (Node a )), Digit (Node a )) -> FingerTree (Node (Node (Node a ))) -> c
43824385#endif
43834386 cont2 (b, r1, r2) ! sub =
0 commit comments