X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2FCONTRIB%2Fpphs%2Fdocs%2Fstring2.hs;fp=ghc%2FCONTRIB%2Fpphs%2Fdocs%2Fstring2.hs;h=c3a063756b25e7956a2abf21bc761b8fa31af897;hb=e7d21ee4f8ac907665a7e170c71d59e13a01da09;hp=0000000000000000000000000000000000000000;hpb=e48474bff05e6cfb506660420f025f694c870d38;p=ghc-hetmet.git diff --git a/ghc/CONTRIB/pphs/docs/string2.hs b/ghc/CONTRIB/pphs/docs/string2.hs new file mode 100644 index 0000000..c3a0637 --- /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))))