summaryrefslogtreecommitdiff
path: root/lib/bio
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2018-01-01 21:09:50 -0800
committerOri Bernstein <ori@eigenstate.org>2018-01-11 22:16:11 -0800
commit90e26e0f687da28530b3b967df0cedf20407c071 (patch)
tree09c85ff396a5f235dbcbd5db2df911b5217bb472 /lib/bio
parent94448201527e0c47c2924219bf1a8d0c0c2406b7 (diff)
downloadmc-90e26e0f687da28530b3b967df0cedf20407c071.tar.gz
Move to new trait syntax.
Diffstat (limited to 'lib/bio')
-rw-r--r--lib/bio/bio.myr4
-rw-r--r--lib/bio/geti.myr24
-rw-r--r--lib/bio/puti.myr16
3 files changed, 22 insertions, 22 deletions
diff --git a/lib/bio/bio.myr b/lib/bio/bio.myr
index 4db8ec9..1f44bf8 100644
--- a/lib/bio/bio.myr
+++ b/lib/bio/bio.myr
@@ -283,7 +283,7 @@ const ensurecodepoint = {f
writes a single integer-like value to the output stream, in
little endian format
*/
-generic putle = {f, v : @a::(numeric,integral)
+generic putle = {f, v : @a :: numeric,integral @a
for var i = 0; i < sizeof(@a); i++
putb(f, (v & 0xff : byte))
v >>= 8
@@ -295,7 +295,7 @@ generic putle = {f, v : @a::(numeric,integral)
writes a single integer-like value to the output stream, in
big endian format
*/
-generic putbe = {f, v : @a::(numeric,integral)
+generic putbe = {f, v : @a :: numeric,integral @a
for var i = sizeof(@a); i != 0; i--
putb(f, ((v >> ((i-1)*8)) & 0xff : byte))
;;
diff --git a/lib/bio/geti.myr b/lib/bio/geti.myr
index ee9a631..4e9faca 100644
--- a/lib/bio/geti.myr
+++ b/lib/bio/geti.myr
@@ -5,23 +5,23 @@ use "types"
pkg bio =
/* unsigned big endian */
- generic getbe8 : (f : file# -> std.result(@a::(numeric,integral), err))
- generic getbe16 : (f : file# -> std.result(@a::(numeric,integral), err))
- generic getbe32 : (f : file# -> std.result(@a::(numeric,integral), err))
- generic getbe64 : (f : file# -> std.result(@a::(numeric,integral), err))
+ generic getbe8 : (f : file# -> std.result(@a, err)) :: numeric,integral @a
+ generic getbe16 : (f : file# -> std.result(@a, err)) :: numeric,integral @a
+ generic getbe32 : (f : file# -> std.result(@a, err)) :: numeric,integral @a
+ generic getbe64 : (f : file# -> std.result(@a, err)) :: numeric,integral @a
/* signed big endian */
- generic getle8 : (f : file# -> std.result(@a::(numeric,integral), err))
- generic getle16 : (f : file# -> std.result(@a::(numeric,integral), err))
- generic getle32 : (f : file# -> std.result(@a::(numeric,integral), err))
- generic getle64 : (f : file# -> std.result(@a::(numeric,integral), err))
+ generic getle8 : (f : file# -> std.result(@a, err)) :: numeric,integral @a
+ generic getle16 : (f : file# -> std.result(@a, err)) :: numeric,integral @a
+ generic getle32 : (f : file# -> std.result(@a, err)) :: numeric,integral @a
+ generic getle64 : (f : file# -> std.result(@a, err)) :: numeric,integral @a
;;
/*
reads a single integer-like value to the output stream, in
little endian format
*/
-generic getle = {f, n -> std.result(@a::(numeric,integral), err)
+generic getle = {f, n -> std.result(@a, err) :: numeric,integral @a
match ensureread(f, n)
| `std.Err e : -> `std.Err e
| `std.Ok _:
@@ -29,7 +29,7 @@ generic getle = {f, n -> std.result(@a::(numeric,integral), err)
for var i = 0; i < n; i++
v |= (f.rbuf[f.rstart++] : uint64) << (8*(i : uint64))
;;
- -> `std.Ok (v : @a::(numeric,integral))
+ -> `std.Ok (v : @a)
;;
}
@@ -37,7 +37,7 @@ generic getle = {f, n -> std.result(@a::(numeric,integral), err)
reads a single integer-like value to the output stream, in
big endian format
*/
-generic getbe = {f, n -> std.result(@a::(numeric,integral), err)
+generic getbe = {f, n -> std.result(@a, err) :: numeric,integral @a
match ensureread(f, n)
| `std.Err e : -> `std.Err e
| `std.Ok _:
@@ -46,7 +46,7 @@ generic getbe = {f, n -> std.result(@a::(numeric,integral), err)
v <<= 8
v |= (f.rbuf[f.rstart++] : uint64)
;;
- -> `std.Ok (v : @a::(numeric,integral))
+ -> `std.Ok (v : @a)
;;
}
diff --git a/lib/bio/puti.myr b/lib/bio/puti.myr
index 2f07414..38fddcd 100644
--- a/lib/bio/puti.myr
+++ b/lib/bio/puti.myr
@@ -5,16 +5,16 @@ use "types"
pkg bio =
/* unsigned big endian */
- generic putbe8 : (f : file#, v : @a::(numeric,integral) -> std.result(std.size, err))
- generic putbe16 : (f : file#, v : @a::(numeric,integral) -> std.result(std.size, err))
- generic putbe32 : (f : file#, v : @a::(numeric,integral) -> std.result(std.size, err))
- generic putbe64 : (f : file#, v : @a::(numeric,integral) -> std.result(std.size, err))
+ generic putbe8 : (f : file#, v : @a -> std.result(std.size, err)) :: numeric,integral @a
+ generic putbe16 : (f : file#, v : @a -> std.result(std.size, err)) :: numeric,integral @a
+ generic putbe32 : (f : file#, v : @a -> std.result(std.size, err)) :: numeric,integral @a
+ generic putbe64 : (f : file#, v : @a -> std.result(std.size, err)) :: numeric,integral @a
/* unsigned little endian */
- generic putle8 : (f : file#, v : @a::(numeric,integral) -> std.result(std.size, err))
- generic putle16 : (f : file#, v : @a::(numeric,integral) -> std.result(std.size, err))
- generic putle32 : (f : file#, v : @a::(numeric,integral) -> std.result(std.size, err))
- generic putle64 : (f : file#, v : @a::(numeric,integral) -> std.result(std.size, err))
+ generic putle8 : (f : file#, v : @a -> std.result(std.size, err)) :: numeric,integral @a
+ generic putle16 : (f : file#, v : @a -> std.result(std.size, err)) :: numeric,integral @a
+ generic putle32 : (f : file#, v : @a -> std.result(std.size, err)) :: numeric,integral @a
+ generic putle64 : (f : file#, v : @a -> std.result(std.size, err)) :: numeric,integral @a
;;
generic putbe8 = {f, v; -> putbe(f, (v : uint64), 1)}