import GHC.Ptr
puts :: String -> IO ()
-puts s = do withCStringLen (s++"\n") $ \(p,len) ->
+ -- In reality should be withCString, but assume ASCII to avoid possible loop
+puts s = do withCAStringLen (s++"\n") $ \(p,len) ->
c_write 1 (castPtr p) (fromIntegral len)
return ()
#endif