- = case (quotRem (I# n#) 62) of { (I# q#, I# r#) ->
- case (indexCharOffAddr# chars62# r#) of { c# ->
- go q# (C# c# : cs) }}
-
- chars62# = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"#
+ = case (quotRem (iBox n) 62) of { (q_, r_) ->
+ case iUnbox q_ of { q -> case iUnbox r_ of { r ->
+ case (chooseChar62 r) of { c -> c `seq`
+ (go q (c : cs)) }}}}
+
+ chooseChar62 :: FastInt -> Char
+ {-# INLINE chooseChar62 #-}
+#if defined(__GLASGOW_HASKELL__)
+ --then FastInt == Int#
+ chooseChar62 n = C# (indexCharOffAddr# chars62 n)
+ chars62 = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"#
+#else
+ --Haskell98 arrays are portable
+ chooseChar62 n = (!) chars62 n
+ chars62 = listArray (0,61) "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
+#endif