on master help sign in
Fix build for ghcjs_prim < 0.1.1
commit3ea808e8cabede6e67f565376376afcb2dfb94b8 authorLuigy Leon <luichi.19@gmail.com> dateSun 30 Sep 2018, 13:55 (8 years ago) parent50076be
1 file changed+4
Data/Text.hs+4
Data/Text.hs+4
@@ -260,7 +260,9 @@ import Data.Coerce
260260import GHC.Base (build)
261261import qualified GHC.CString as GHC
262262import GHC.Exts (Addr#, ByteArray#)
263+#if MIN_VERSION_ghcjs_prim(0,1,1)
263264import GHCJS.Prim (unsafeUnpackJSString#)
265+#endif
264266
265267unpack :: Text -> String
266268unpack = coerce JSS.unpack
@@ -277,9 +279,11 @@ singleton = coerce JSS.singleton
277279 unstream (S.singleton (safe a)) = singleton a
278280 #-}
279281
282+#if MIN_VERSION_ghcjs_prim(0,1,1)
280283{-# RULES "inlineJSString" forall s.
281284 pack (GHC.Base.build (GHC.unpackFoldrCString# s)) =
282285 Text (JSString (unsafeUnpackJSString# s)) #-}
286+#endif
283287
284288-- | /O(n)/ Convert a literal string into a JSString. Subject to fusion.
285289unpackCString# :: Addr# -> Text