Skip to content

Commit e1318ea

Browse files
committed
Add example/test for it
1 parent 05e8a1e commit e1318ea

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

examples/24-exitcode.hell

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
main = do
2+
(code, out, err) <- ByteString.readProcess (Process.proc "ls" ["-al"])
3+
4+
-- Accessor style
5+
Exit.exitCode
6+
(Text.putStrLn "All good!")
7+
(\i -> IO.print i)
8+
code
9+
10+
-- Validation style
11+
if Eq.eq code Exit.ExitSuccess
12+
then Text.putStrLn "OK, good!"
13+
else Text.putStrLn "Oh, sad."

0 commit comments

Comments
 (0)