1234567891011121314151617181920212223242526272829303132333435363738394041424344454647typet=|Countofint(* The specified tracks should be repeated exactly N times *)|Auto_fill(* Auto-repeating tracks should be generated to fill the container *)|Auto_fit(* Auto-repeating tracks should be generated to fit the container *)letcountn=ifn<=0theninvalid_arg"Repetition_count.count: repetition count must be positive"elseCountnletauto_fill=Auto_fillletauto_fit=Auto_fitletto_string=function|Countn->string_of_intn|Auto_fill->"auto-fill"|Auto_fit->"auto-fit"letequalab=match(a,b)with|Countn1,Countn2->n1=n2|Auto_fill,Auto_fill->true|Auto_fit,Auto_fit->true|_->falseletcompareab=match(a,b)with|Countn1,Countn2->Int.comparen1n2|Count_,_->-1|_,Count_->1|Auto_fill,Auto_fill->0|Auto_fill,_->-1|_,Auto_fill->1|Auto_fit,Auto_fit->0letppfmtt=Format.pp_print_stringfmt(to_stringt)letis_auto=functionAuto_fill|Auto_fit->true|Count_->falseletof_string=function|"auto-fit"->OkAuto_fit|"auto-fill"->OkAuto_fill|s->(matchint_of_string_optswith|Somenwhenn>0->Ok(Countn)|_->Error"Invalid repetition count")