2 module GHC.Debug (debugLn) where
8 debugLn :: [Char] -> IO ()
9 debugLn xs = IO (\s0 ->
10 -- Start with 1 so that we have space to put in a \0 at
14 case newByteArray# l s0 of
16 case write mba 0# xs s1 of
21 len l (_ : xs') = len (l +# 1#) xs'
23 write mba offset [] s = writeCharArray# mba offset '\0'# s
24 write mba offset (C# x : xs') s
25 = case writeCharArray# mba offset x s of
27 write mba (offset +# 1#) xs' s'
29 foreign import ccall unsafe "debugLn"
30 c_debugLn :: MutableByteArray# RealWorld -> IO ()