123456789101112131415161718192021222324252627282930(** Collection of decoders for convert from [Header.Entry.value] to user type. *)openHeader.Entrytype'adecoder=value->'aexceptionErrorofstringletfailmessage=raise(Errormessage)letstring=functionStrings->s|_->fail"expected string"letbinary=functionBinarys->s|_->fail"expected binary"letany=Fun.idletchar=functionCharx->x|_->fail"expected char"letint=functionIntx->x|_->fail"expected int"letint32=functionInt32x->x|_->fail"expected int32"letint64=functionInt64x->x|_->fail"expected int64"letnative_int=function|Intx->x|Int32x->Int32.to_intx|Int64x->Int64.to_intx|_->fail"expected any int"letstring_array=function|StringArrays->s|_->fail"expected string array"letarrayf=functionArrayxs->List.mapfxs|_->fail"expected array"letarray'=arrayFun.idlet(<<)fafbv=fa(fbv)