Skip to content

Instantly share code, notes, and snippets.

@aav
Created February 13, 2017 19:41
Show Gist options
  • Save aav/4b7c72034b983360540cbe046753cc2e to your computer and use it in GitHub Desktop.
Save aav/4b7c72034b983360540cbe046753cc2e to your computer and use it in GitHub Desktop.
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