Axiom wire_serialize : IOStreamWriter.wire -> IOStreamWriter.t.Axiom wire_deserialize : ByteListReader.t IOStreamWriter.wire.Axiom wire_serialize_deserialize_id :
  serialize_deserialize_id_spec wire_serialize wire_deserialize.Instance wire_Serializer : Serializer IOStreamWriter.wire.(* top-level interface for output and input channels *)

Definition to_channel : IOStreamWriter.t -> IOStreamWriter.out_channel :=
  IOStreamWriter.out_channel_wrap.Definition from_channel {A} (d : ByteListReader.t A) (i : IOStreamWriter.in_channel) :=
  match ByteListReader.unwrap d (IOStreamWriter.in_channel_unwrap i) with
  | Some (a, []) => Some a
  | _ => None
  end.

(* Specifications: *)
Theorem serialize_deserialize_channel_id : forall {A} {sA : Serializer A} a, from_channel deserialize (IOStreamWriter.channel_send (to_channel (serialize a))) = Some a.