on master help sign in
Use unsafeRawHead

These are closer to the equivalents

commit49c86ff1a7489d6f7ba767e484baca3966dec5c5 authorMatthew Bauer <matthew.bauer@obsidian.systems> dateThu 2 Aug 2018, 23:53 (8 years ago) parent78f714d
1 file changed+5−1
Data/Text/Unsafe.hs+5−1
Data/Text/Unsafe.hs+5−1
@@ -57,7 +57,11 @@ unsafeHead (Text arr off _len)
5757 where m = A.unsafeIndex arr off
5858 n = A.unsafeIndex arr (off+1)
5959#else
60−unsafeHead = coerce JSS.rawHead
60+unsafeRawHead :: JSString -> Char
61+unsafeRawHead x = C# (chr# (js_charCodeAt 0 x))
62+{-# INLINE unsafeRawHead #-}
63+
64+unsafeHead = coerce unsafeRawHead
6165#endif
6266{-# INLINE unsafeHead #-}
6367