1 main = appendChan stdout "please type a filename\n" exit (
2 readChan stdin exit (\ userInput ->
3 let (name : _) = lines userInput in
4 appendChan stdout name exit (
5 readFile name (\ ioerror -> appendChan stdout
6 "can't open file" exit done)
8 appendChan stdout contents exit done))))