Skip to content

Instantly share code, notes, and snippets.

@ryuichiueda
Created January 16, 2015 06:26
Show Gist options
  • Save ryuichiueda/c2fab85a0d9c98ba985d to your computer and use it in GitHub Desktop.
Save ryuichiueda/c2fab85a0d9c98ba985d to your computer and use it in GitHub Desktop.
a demo at USP lab. (Jan 16, 2015)
import /usr/bin/ as ub
import /bin/ as b
# not a Haskell code but a glue code
# how to write a procedure (function of bash)
proc pppp =
import /usr/bin/ as ub
ub.seq 1 10
>>= ub.tail -r
# how to avoid stopping by an error (avoidacnce of -e of bash)
? b.echo 'aho' >>= ub.grep 'boke'
# if, else if, else
? ub.false
this.pppp
| ub.true
b.echo 'aho'
| otherwise
b.echo 'boke'
# output connection
str s = b.echo 'aho2' >> b.echo 'boke2'
b.echo s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment