[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / CONTRIB / pphs / docs / string2.hs
diff --git a/ghc/CONTRIB/pphs/docs/string2.hs b/ghc/CONTRIB/pphs/docs/string2.hs
new file mode 100644 (file)
index 0000000..c3a0637
--- /dev/null
@@ -0,0 +1,8 @@
+main = appendChan stdout "please type a filename\n" exit (
+       readChan stdin exit (\ userInput ->
+       let (name : _) = lines userInput in
+       appendChan stdout name exit (
+       readFile name (\ ioerror -> appendChan stdout
+                                  "can't open file" exit done)
+                    (\ contents ->
+       appendChan stdout contents exit done))))