Skip to content

Instantly share code, notes, and snippets.

@aav
Created February 13, 2017 19:41
type InvalidProtobuf is (UnexpectedEOF, InvalidVarint)
type PBSInt32 is I32
primitive PBSInt32IO is ZigZag
fun read(reader: WireReader ref): (PBSInt32 | InvailidProtobuf) =>
match reader.readVariantU32()
| let u32: U32 => _decodeZigZag32(u32)
| let e: InvalidVariant => e
else
// what to return here??
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment