summaryrefslogtreecommitdiff
path: root/lib/bio
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-02-01 00:19:20 -0800
committerOri Bernstein <ori@eigenstate.org>2017-02-01 00:19:20 -0800
commit6368976a9e8e4121c5867ec81842e1d4bac55351 (patch)
tree76c54a64c3ef66d83551e62cbd34b2f0a78f0457 /lib/bio
parenta57d9fd3e0a6dd268872ed89d6a41c723d909b2e (diff)
downloadmc-6368976a9e8e4121c5867ec81842e1d4bac55351.tar.gz
Readability improvements.
Compress the match statement.
Diffstat (limited to 'lib/bio')
-rw-r--r--lib/bio/iter.myr22
1 files changed, 8 insertions, 14 deletions
diff --git a/lib/bio/iter.myr b/lib/bio/iter.myr
index c54b342..dbdd025 100644
--- a/lib/bio/iter.myr
+++ b/lib/bio/iter.myr
@@ -18,14 +18,11 @@ const byline = {f
impl iterable lineiter -> byte[:] =
__iternext__ = {itp, outp
match bio.readln((itp# : file#))
- | `Ok ln:
- outp# = ln
- -> true
- | `Eof:
- -> false
- | `Err _:
- -> false
+ | `Ok ln: outp# = ln
+ | `Err _: -> false
+ | `Eof: -> false
;;
+ -> true
}
__iterfin__ = {itp, outp
@@ -40,14 +37,11 @@ const bychar = {f
impl iterable chariter -> char =
__iternext__ = {itp, outp : char#
match bio.getc((itp# : file#))
- | `Ok c:
- outp# = c
- -> true
- | `Eof:
- -> false
- | `Err _:
- -> false
+ | `Ok c: outp# = c
+ | `Err _: -> false
+ | `Eof: -> false
;;
+ -> true
}
__iterfin__ = {itp, outp