packString, -- :: String -> PackedString
unpackPS, -- :: PackedString -> String
-#ifdef __GLASGOW_HASKELL__
+#ifndef __NHC__
-- * I\/O with @PackedString@s
hPutPS, -- :: Handle -> PackedString -> IO ()
hGetPS, -- :: Handle -> Int -> IO PackedString
substrPS :: PackedString -> Int -> Int -> PackedString
substrPS (PS ps) begin end = packString [ ps ! i | i <- [begin..end] ]
-#ifdef __GLASGOW_HASKELL__
-- -----------------------------------------------------------------------------
-- hPutPS
--- | Outputs a 'PackedString' to the specified 'Handle' (GHC only).
+-- | Outputs a 'PackedString' to the specified 'Handle'.
--
-- NOTE: the representation of the 'PackedString' in the file is assumed to
-- be in the ISO-8859-1 encoding. In other words, only the least signficant
-- -----------------------------------------------------------------------------
-- hGetPS
--- | Read a 'PackedString' directly from the specified 'Handle' (GHC only).
+-- | Read a 'PackedString' directly from the specified 'Handle'.
-- This is far more efficient than reading the characters into a 'String'
-- and then using 'packString'.
--
l <- hGetArray h arr i
chars <- mapM (\i -> readArray arr i >>= return.chr.fromIntegral) [0..l-1]
return (packString chars)
-#endif /* __GLASGOW_HASKELL__ */
#else /* __NHC__ */