summaryrefslogtreecommitdiff
path: root/ghc/misc/examples/cats/hcat2.hs
diff options
context:
space:
mode:
Diffstat (limited to 'ghc/misc/examples/cats/hcat2.hs')
-rw-r--r--ghc/misc/examples/cats/hcat2.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/ghc/misc/examples/cats/hcat2.hs b/ghc/misc/examples/cats/hcat2.hs
new file mode 100644
index 0000000000..3323ae8301
--- /dev/null
+++ b/ghc/misc/examples/cats/hcat2.hs
@@ -0,0 +1,10 @@
+module Main (main) where
+
+main :: IO ()
+main
+ = try getChar >>=
+ {-then-}either (\ _ -> return ())
+ {-or-} (\ c -> putChar c >>
+ main)
+
+-- 51,156 bytes/sec (600KB input)