Proof using.
intros.
unfold option_serialize, option_deserialize.
destruct a;
repeat (cheerios_crush; simpl).
Qed.
Global Instance option_Serializer : Serializer (option A).
Definition pair_serialize (x : A * B) : IOStreamWriter.t :=
let (a, b) := x in IOStreamWriter.append (fun _ => serialize a)
(fun _ => serialize b).
Definition pair_deserialize : ByteListReader.t (A * B) :=
a <- deserialize ;;
b <- deserialize ;;
ByteListReader.ret (a, b).

(* Specifications: *)
Lemma pair_serialize_deserialize_id :
serialize_deserialize_id_spec pair_serialize pair_deserialize.