123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081open!CoremoduletypeIo=sigtype'attype'afmttypeout_channelincludeMonad.Swithtype'at:='atvaloutput_string:out_channel->string->unitvaloutput:out_channel->buf:bytes->pos:int->len:int->unitvalstderr:out_channelvalstdout:out_channelvalflush:out_channel->unittvalprint_string:string->unitvalfprintf:attrs:string->out_channel->'afmt->'avalfold_left:'aList.t->init:'b->f:('b->'a->'bt)->'btvalstdout_isatty:unit->booltvalcapable:unit->booltendmoduletypeS=sigtype'aiotype'aio_fmttypeout_channel(** Handling of ansi codes. *)moduleAnsi:sigvalkill_line:unit->unitvalerase_to_end_of_screen:unit->unitvalerase_to_start_of_screen:unit->unitvalerase_all:unit->unitvalbell:unit->unitvalhome:unit->unitvalhome_cursor:unit->unitvalcursor_up:unit->unitvalcursor_down:unit->unitvalcursor_backward:unit->unitvalcursor_forward:unit->unitvalsave_cursor:unit->unitvalunsave_cursor:unit->unittypeattr=Ansi_kernel.Attr.tvalprintf:attrlist->'aio_fmt->'avaleprintf:attrlist->'aio_fmt->'avaloutput_string:attrlist->out_channel->string->unitiovaloutput:attrlist->out_channel->Bytes.t->int->int->unitio(* Create string with embedded formatting codes *)valstring_with_attr:attrlist->string->stringendvalis_color_tty:unit->boolio(** The width in characters of the current output. Returns [`Not_a_tty] if
stdout is not connected to a tty.*)valwidth:unit->[`Colsofint|`Not_a_tty|`Not_available]io(** print a list in a columnize way (like the output of ls) *)valprint_list:out_channel->(string*Ansi.attrlist)list->unitioend(** Color printing in terminals *)moduletypeConsole=sigmoduletypeIo=IomoduletypeS=SmoduleMake(Io:Io):Swithtype'aio:='aIo.tandtype'aio_fmt:='aIo.fmtandtypeout_channel:=Io.out_channelincludeSwithtype'aio:='aandtype'aio_fmt:=('a,Out_channel.t,unit)formatandtypeout_channel:=Out_channel.tend