diff options
Diffstat (limited to 'samples/io')
-rw-r--r-- | samples/io/echo.bruijn | 5 | ||||
-rw-r--r-- | samples/io/reverse.bruijn | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/samples/io/echo.bruijn b/samples/io/echo.bruijn index 192bab1..b17bda1 100644 --- a/samples/io/echo.bruijn +++ b/samples/io/echo.bruijn @@ -1,4 +1,9 @@ # "echo text | bruijn echo.bruijn" +:import std/Monad . + # returning the binary encoded argument ⇒ echo main [0] + +# alternative using monads +main* read >>= return diff --git a/samples/io/reverse.bruijn b/samples/io/reverse.bruijn index 7a3553f..d5a0597 100644 --- a/samples/io/reverse.bruijn +++ b/samples/io/reverse.bruijn @@ -1,6 +1,8 @@ # "echo tacocat | bruijn reverse.bruijn" :import std/List . +:import std/Combinator . +:import std/Monad . # stdin is encoded as binary numbers in a list # reversing the list reverses the input! |