summaryrefslogtreecommitdiff
path: root/ghc/CONTRIB/pphs/docs/string2.hs
diff options
context:
space:
mode:
Diffstat (limited to 'ghc/CONTRIB/pphs/docs/string2.hs')
-rw-r--r--ghc/CONTRIB/pphs/docs/string2.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/ghc/CONTRIB/pphs/docs/string2.hs b/ghc/CONTRIB/pphs/docs/string2.hs
new file mode 100644
index 0000000000..c3a063756b
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/string2.hs
@@ -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))))