[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / misc / examples / cats / hcat6.hs
diff --git a/ghc/misc/examples/cats/hcat6.hs b/ghc/misc/examples/cats/hcat6.hs
new file mode 100644 (file)
index 0000000..ce9b4e6
--- /dev/null
@@ -0,0 +1,18 @@
+module Main (mainPrimIO) where
+
+import PreludePrimIO
+
+mainPrimIO :: PrimIO ()
+mainPrimIO
+  = _casm_
+    ``do { int c;
+    while ((c = getchar()) != EOF) {
+        putchar(c);
+    }} while (0);
+    %r = 1;'' -- pretend we have a "result"
+    `thenPrimIO` \ (I# _) ->
+    returnPrimIO ()
+
+-- 1,955,134 bytes/sec ( 600KB input)
+-- 1,989,892 bytes/sec ( 9.3MB input)
+-- 1,871,706 bytes/sec (25.5MB input)