1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127(* This file was automatically generated, do not edit.*)(* Edit file v0.in.ml instead. *)# 1 "v0.in.ml"moduletypeT=sigmoduleCamlinternalFormatBasics:moduletypeofstructincludeTezos_protocol_environment_sigs_internals.CamlinternalFormatBasicsendmodulePervasives:sig# 1 "v0/pervasives.mli"(**************************************************************************)(* *)(* OCaml *)(* *)(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)(* *)(* Copyright 1996 Institut National de Recherche en Informatique et *)(* en Automatique. *)(* *)(* All rights reserved. This file is distributed under the terms of *)(* the GNU Lesser General Public License version 2.1, with the *)(* special exception on linking described in the file LICENSE. *)(* *)(**************************************************************************)(* TEZOS CHANGES
* Import version 4.06.1
* Remove [channel], [exit], ...
* Remove polymorphic comparisons
* Remove floating-point arithmetic
* Remove string conversion functions for float
* Remove deprecated functions
*)(** The initially opened module.
This module provides the basic operations over the built-in types
(numbers, booleans, byte sequences, strings, exceptions, references,
lists, arrays, input-output channels, ...).
This module is automatically opened at the beginning of each compilation.
All components of this module can therefore be referred by their short
name, without prefixing them by [Pervasives].
*)(** {1 Exceptions} *)(** Raise the given exception value *)externalraise:exn->'a="%raise"(** A faster version [raise] which does not record the backtrace.
@since 4.02.0
*)externalraise_notrace:exn->'a="%raise_notrace"(** Raise exception [Invalid_argument] with the given string. *)valinvalid_arg:string->'a(** Raise exception [Failure] with the given string. *)valfailwith:string->'a(** The [Exit] exception is not raised by any library function. It is
provided for use in your programs. *)exceptionExit(** {1 Boolean operations} *)(** The boolean negation. *)externalnot:bool->bool="%boolnot"(** The boolean 'and'. Evaluation is sequential, left-to-right:
in [e1 && e2], [e1] is evaluated first, and if it returns [false],
[e2] is not evaluated at all.
Right-associative operator at precedence level 3/11. *)external(&&):bool->bool->bool="%sequand"(** The boolean 'or'. Evaluation is sequential, left-to-right:
in [e1 || e2], [e1] is evaluated first, and if it returns [true],
[e2] is not evaluated at all.
Right-associative operator at precedence level 2/11.
*)external(||):bool->bool->bool="%sequor"(** {1 Debugging} *)(** [__LOC__] returns the location at which this expression appears in
the file currently being parsed by the compiler, with the standard
error format of OCaml: "File %S, line %d, characters %d-%d".
@since 4.02.0
*)external__LOC__:string="%loc_LOC"(** [__FILE__] returns the name of the file currently being
parsed by the compiler.
@since 4.02.0
*)external__FILE__:string="%loc_FILE"(** [__LINE__] returns the line number at which this expression
appears in the file currently being parsed by the compiler.
@since 4.02.0
*)external__LINE__:int="%loc_LINE"(** [__MODULE__] returns the module name of the file being
parsed by the compiler.
@since 4.02.0
*)external__MODULE__:string="%loc_MODULE"(** [__POS__] returns a tuple [(file,lnum,cnum,enum)], corresponding
to the location at which this expression appears in the file
currently being parsed by the compiler. [file] is the current
filename, [lnum] the line number, [cnum] the character position in
the line and [enum] the last character position in the line.
@since 4.02.0
*)external__POS__:string*int*int*int="%loc_POS"(** [__LOC_OF__ expr] returns a pair [(loc, expr)] where [loc] is the
location of [expr] in the file currently being parsed by the
compiler, with the standard error format of OCaml: "File %S, line
%d, characters %d-%d".
@since 4.02.0
*)external__LOC_OF__:'a->string*'a="%loc_LOC"(** [__LINE__ expr] returns a pair [(line, expr)], where [line] is the
line number at which the expression [expr] appears in the file
currently being parsed by the compiler.
@since 4.02.0
*)external__LINE_OF__:'a->int*'a="%loc_LINE"(** [__POS_OF__ expr] returns a pair [(loc,expr)], where [loc] is a
tuple [(file,lnum,cnum,enum)] corresponding to the location at
which the expression [expr] appears in the file currently being
parsed by the compiler. [file] is the current filename, [lnum] the
line number, [cnum] the character position in the line and [enum]
the last character position in the line.
@since 4.02.0
*)external__POS_OF__:'a->(string*int*int*int)*'a="%loc_POS"(** {1 Composition operators} *)(** Reverse-application operator: [x |> f |> g] is exactly equivalent
to [g (f (x))].
Left-associative operator at precedence level 4/11.
@since 4.01
*)external(|>):'a->('a->'b)->'b="%revapply"(** Application operator: [g @@ f @@ x] is exactly equivalent to
[g (f (x))].
Right-associative operator at precedence level 5/11.
@since 4.01
*)external(@@):('a->'b)->'a->'b="%apply"(** {1 Integer arithmetic} *)(** Integers are 31 bits wide (or 63 bits on 64-bit processors).
All operations are taken modulo 2{^31} (or 2{^63}).
They do not fail on overflow. *)(** Unary negation. You can also write [- e] instead of [~- e].
Unary operator at precedence level 9/11 for [- e]
and 11/11 for [~- e]. *)external(~-):int->int="%negint"(** Unary addition. You can also write [+ e] instead of [~+ e].
Unary operator at precedence level 9/11 for [+ e]
and 11/11 for [~+ e].
@since 3.12.0
*)external(~+):int->int="%identity"(** [succ x] is [x + 1]. *)externalsucc:int->int="%succint"(** [pred x] is [x - 1]. *)externalpred:int->int="%predint"(** Integer addition.
Left-associative operator at precedence level 6/11. *)external(+):int->int->int="%addint"(** Integer subtraction.
Left-associative operator at precedence level 6/11. *)external(-):int->int->int="%subint"(** Integer multiplication.
Left-associative operator at precedence level 7/11. *)external(*):int->int->int="%mulint"(** Integer division.
Raise [Division_by_zero] if the second argument is 0.
Integer division rounds the real quotient of its arguments towards zero.
More precisely, if [x >= 0] and [y > 0], [x / y] is the greatest integer
less than or equal to the real quotient of [x] by [y]. Moreover,
[(- x) / y = x / (- y) = - (x / y)].
Left-associative operator at precedence level 7/11. *)external(/):int->int->int="%divint"(** Integer remainder. If [y] is not zero, the result
of [x mod y] satisfies the following properties:
[x = (x / y) * y + x mod y] and
[abs(x mod y) <= abs(y) - 1].
If [y = 0], [x mod y] raises [Division_by_zero].
Note that [x mod y] is negative only if [x < 0].
Raise [Division_by_zero] if [y] is zero.
Left-associative operator at precedence level 7/11. *)external(mod):int->int->int="%modint"(** Return the absolute value of the argument. Note that this may be
negative if the argument is [min_int]. *)valabs:int->int(** The greatest representable integer. *)valmax_int:int(** The smallest representable integer. *)valmin_int:int(** {2 Bitwise operations} *)(** Bitwise logical and.
Left-associative operator at precedence level 7/11. *)external(land):int->int->int="%andint"(** Bitwise logical or.
Left-associative operator at precedence level 7/11. *)external(lor):int->int->int="%orint"(** Bitwise logical exclusive or.
Left-associative operator at precedence level 7/11. *)external(lxor):int->int->int="%xorint"(** Bitwise logical negation. *)vallnot:int->int(** [n lsl m] shifts [n] to the left by [m] bits.
The result is unspecified if [m < 0] or [m >= bitsize],
where [bitsize] is [32] on a 32-bit platform and
[64] on a 64-bit platform.
Right-associative operator at precedence level 8/11. *)external(lsl):int->int->int="%lslint"(** [n lsr m] shifts [n] to the right by [m] bits.
This is a logical shift: zeroes are inserted regardless of
the sign of [n].
The result is unspecified if [m < 0] or [m >= bitsize].
Right-associative operator at precedence level 8/11. *)external(lsr):int->int->int="%lsrint"(** [n asr m] shifts [n] to the right by [m] bits.
This is an arithmetic shift: the sign bit of [n] is replicated.
The result is unspecified if [m < 0] or [m >= bitsize].
Right-associative operator at precedence level 8/11. *)external(asr):int->int->int="%asrint"(** {1 String operations}
More string operations are provided in module {!String}.
*)(** String concatenation.
Right-associative operator at precedence level 5/11. *)val(^):string->string->string(** {1 Character operations}
More character operations are provided in module {!Char}.
*)(** Return the ASCII code of the argument. *)externalint_of_char:char->int="%identity"(** Return the character with the given ASCII code.
Raise [Invalid_argument "char_of_int"] if the argument is
outside the range 0--255. *)valchar_of_int:int->char(** {1 Unit operations} *)(** Discard the value of its argument and return [()].
For instance, [ignore(f x)] discards the result of
the side-effecting function [f]. It is equivalent to
[f x; ()], except that the latter may generate a
compiler warning; writing [ignore(f x)] instead
avoids the warning. *)externalignore:'a->unit="%ignore"(** {1 String conversion functions} *)(** Return the string representation of a boolean. As the returned values
may be shared, the user should not modify them directly.
*)valstring_of_bool:bool->string(** Convert the given string to a boolean.
Return [None] if the string is not
["true"] or ["false"].
@since 4.05
*)valbool_of_string_opt:string->booloption(** Return the string representation of an integer, in decimal. *)valstring_of_int:int->string(** Convert the given string to an integer.
The string is read in decimal (by default, or if the string
begins with [0u]), in hexadecimal (if it begins with [0x] or
[0X]), in octal (if it begins with [0o] or [0O]), or in binary
(if it begins with [0b] or [0B]).
The [0u] prefix reads the input as an unsigned integer in the range
[[0, 2*max_int+1]]. If the input exceeds {!max_int}
it is converted to the signed integer
[min_int + input - max_int - 1].
The [_] (underscore) character can appear anywhere in the string
and is ignored.
Return [None] if the given string is not a valid representation of
an integer, or if the integer represented exceeds the range of
integers representable in type [int].
@since 4.05
*)valint_of_string_opt:string->intoption(** {1 Pair operations} *)(** Return the first component of a pair. *)externalfst:'a*'b->'a="%field0"(** Return the second component of a pair. *)externalsnd:'a*'b->'b="%field1"(** {1 List operations}
More list operations are provided in module {!List}.
*)(** List concatenation. Not tail-recursive (length of the first argument).
Right-associative operator at precedence level 5/11. *)val(@):'alist->'alist->'alist(** {1 References} *)(** The type of references (mutable indirection cells) containing
a value of type ['a]. *)type'aref={mutablecontents:'a}(** Return a fresh reference containing the given value. *)externalref:'a->'aref="%makemutable"(** [!r] returns the current contents of reference [r].
Equivalent to [fun r -> r.contents].
Unary operator at precedence level 11/11.*)external(!):'aref->'a="%field0"(** [r := a] stores the value of [a] in reference [r].
Equivalent to [fun r v -> r.contents <- v].
Right-associative operator at precedence level 1/11. *)external(:=):'aref->'a->unit="%setfield0"(** Increment the integer contained in the given reference.
Equivalent to [fun r -> r := succ !r]. *)externalincr:intref->unit="%incr"(** Decrement the integer contained in the given reference.
Equivalent to [fun r -> r := pred !r]. *)externaldecr:intref->unit="%decr"(** {1 Result type} *)(** @since 4.03.0 *)type('a,'b)result=Okof'a|Errorof'b(** {1 Operations on format strings} *)(** Format strings are character strings with special lexical conventions
that defines the functionality of formatted input/output functions. Format
strings are used to read data with formatted input functions from module
{!Scanf} and to print data with formatted output functions from modules
{!Printf} and {!Format}.
Format strings are made of three kinds of entities:
- {e conversions specifications}, introduced by the special character ['%']
followed by one or more characters specifying what kind of argument to
read or print,
- {e formatting indications}, introduced by the special character ['@']
followed by one or more characters specifying how to read or print the
argument,
- {e plain characters} that are regular characters with usual lexical
conventions. Plain characters specify string literals to be read in the
input or printed in the output.
There is an additional lexical rule to escape the special characters ['%']
and ['@'] in format strings: if a special character follows a ['%']
character, it is treated as a plain character. In other words, ["%%"] is
considered as a plain ['%'] and ["%@"] as a plain ['@'].
For more information about conversion specifications and formatting
indications available, read the documentation of modules {!Scanf},
{!Printf} and {!Format}.
*)(** Format strings have a general and highly polymorphic type
[('a, 'b, 'c, 'd, 'e, 'f) format6].
The two simplified types, [format] and [format4] below are
included for backward compatibility with earlier releases of
OCaml.
The meaning of format string type parameters is as follows:
- ['a] is the type of the parameters of the format for formatted output
functions ([printf]-style functions);
['a] is the type of the values read by the format for formatted input
functions ([scanf]-style functions).
- ['b] is the type of input source for formatted input functions and the
type of output target for formatted output functions.
For [printf]-style functions from module {!Printf}, ['b] is typically
[out_channel];
for [printf]-style functions from module {!Format}, ['b] is typically
{!Format.formatter};
for [scanf]-style functions from module {!Scanf}, ['b] is typically
{!Scanf.Scanning.in_channel}.
Type argument ['b] is also the type of the first argument given to
user's defined printing functions for [%a] and [%t] conversions,
and user's defined reading functions for [%r] conversion.
- ['c] is the type of the result of the [%a] and [%t] printing
functions, and also the type of the argument transmitted to the
first argument of [kprintf]-style functions or to the
[kscanf]-style functions.
- ['d] is the type of parameters for the [scanf]-style functions.
- ['e] is the type of the receiver function for the [scanf]-style functions.
- ['f] is the final result type of a formatted input/output function
invocation: for the [printf]-style functions, it is typically [unit];
for the [scanf]-style functions, it is typically the result type of the
receiver function.
*)type('a,'b,'c,'d,'e,'f)format6=('a,'b,'c,'d,'e,'f)CamlinternalFormatBasics.format6type('a,'b,'c,'d)format4=('a,'b,'c,'c,'c,'d)format6type('a,'b,'c)format=('a,'b,'c,'c)format4(** Converts a format string into a string. *)valstring_of_format:('a,'b,'c,'d,'e,'f)format6->string(** [format_of_string s] returns a format string read from the string
literal [s].
Note: [format_of_string] can not convert a string argument that is not a
literal. If you need this functionality, use the more general
{!Scanf.format_from_string} function.
*)externalformat_of_string:('a,'b,'c,'d,'e,'f)format6->('a,'b,'c,'d,'e,'f)format6="%identity"(** [f1 ^^ f2] catenates format strings [f1] and [f2]. The result is a
format string that behaves as the concatenation of format strings [f1] and
[f2]: in case of formatted output, it accepts arguments from [f1], then
arguments from [f2]; in case of formatted input, it returns results from
[f1], then results from [f2].
Right-associative operator at precedence level 5/11. *)val(^^):('a,'b,'c,'d,'e,'f)format6->('f,'b,'c,'e,'g,'h)format6->('a,'b,'c,'d,'g,'h)format6end# 6 "v0.in.ml"openPervasivesmoduleList:sig# 1 "v0/list.mli"(**************************************************************************)(* *)(* OCaml *)(* *)(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)(* *)(* Copyright 1996 Institut National de Recherche en Informatique et *)(* en Automatique. *)(* *)(* All rights reserved. This file is distributed under the terms of *)(* the GNU Lesser General Public License version 2.1, with the *)(* special exception on linking described in the file LICENSE. *)(* *)(**************************************************************************)(** List operations.
Some functions are flagged as not tail-recursive. A tail-recursive
function uses constant stack space, while a non-tail-recursive function
uses stack space proportional to the length of its list argument, which
can be a problem with very long lists. When the function takes several
list arguments, an approximate formula giving stack usage (in some
unspecified constant unit) is shown in parentheses.
The above considerations can usually be ignored if your lists are not
longer than about 10000 elements.
*)(** Return the length (number of elements) of the given list. *)vallength:'alist->int(** Compare the lengths of two lists. [compare_lengths l1 l2] is
equivalent to [compare (length l1) (length l2)], except that
the computation stops after itering on the shortest list.
@since 4.05.0
*)valcompare_lengths:'alist->'blist->int(** Compare the length of a list to an integer. [compare_length_with l n] is
equivalent to [compare (length l) n], except that
the computation stops after at most [n] iterations on the list.
@since 4.05.0
*)valcompare_length_with:'alist->int->int(** [cons x xs] is [x :: xs]
@since 4.03.0
*)valcons:'a->'alist->'alist(** Return the first element of the given list. Raise
[Failure "hd"] if the list is empty. *)valhd:'alist->'a(** Return the given list without its first element. Raise
[Failure "tl"] if the list is empty. *)valtl:'alist->'alist(** Return the [n]-th element of the given list.
The first element (head of the list) is at position 0.
Return [None] if the list is too short.
Raise [Invalid_argument "List.nth"] if [n] is negative.
@since 4.05
*)valnth_opt:'alist->int->'aoption(** List reversal. *)valrev:'alist->'alist(** [List.init len f] is [f 0; f 1; ...; f (len-1)], evaluated left to right.
@raise Invalid_argument if len < 0.
@since 4.06.0
*)valinit:int->(int->'a)->'alist(** Concatenate two lists. Same as the infix operator [@].
Not tail-recursive (length of the first argument). *)valappend:'alist->'alist->'alist(** [List.rev_append l1 l2] reverses [l1] and concatenates it to [l2].
This is equivalent to {!List.rev}[ l1 @ l2], but [rev_append] is
tail-recursive and more efficient. *)valrev_append:'alist->'alist->'alist(** Concatenate a list of lists. The elements of the argument are all
concatenated together (in the same order) to give the result.
Not tail-recursive
(length of the argument + length of the longest sub-list). *)valconcat:'alistlist->'alist(** An alias for [concat]. *)valflatten:'alistlist->'alist(** {1 Iterators} *)(** [List.iter f [a1; ...; an]] applies function [f] in turn to
[a1; ...; an]. It is equivalent to
[begin f a1; f a2; ...; f an; () end]. *)valiter:('a->unit)->'alist->unit(** Same as {!List.iter}, but the function is applied to the index of
the element as first argument (counting from 0), and the element
itself as second argument.
@since 4.00.0
*)valiteri:(int->'a->unit)->'alist->unit(** [List.map f [a1; ...; an]] applies function [f] to [a1, ..., an],
and builds the list [[f a1; ...; f an]]
with the results returned by [f]. Not tail-recursive. *)valmap:('a->'b)->'alist->'blist(** Same as {!List.map}, but the function is applied to the index of
the element as first argument (counting from 0), and the element
itself as second argument. Not tail-recursive.
@since 4.00.0
*)valmapi:(int->'a->'b)->'alist->'blist(** [List.rev_map f l] gives the same result as
{!List.rev}[ (]{!List.map}[ f l)], but is tail-recursive and
more efficient. *)valrev_map:('a->'b)->'alist->'blist(** [List.fold_left f a [b1; ...; bn]] is
[f (... (f (f a b1) b2) ...) bn]. *)valfold_left:('a->'b->'a)->'a->'blist->'a(** [List.fold_right f [a1; ...; an] b] is
[f a1 (f a2 (... (f an b) ...))]. Not tail-recursive. *)valfold_right:('a->'b->'b)->'alist->'b->'b(** {1 Iterators on two lists} *)(** [List.iter2 f [a1; ...; an] [b1; ...; bn]] calls in turn
[f a1 b1; ...; f an bn].
Raise [Invalid_argument] if the two lists are determined
to have different lengths. *)valiter2:('a->'b->unit)->'alist->'blist->unit(** [List.map2 f [a1; ...; an] [b1; ...; bn]] is
[[f a1 b1; ...; f an bn]].
Raise [Invalid_argument] if the two lists are determined
to have different lengths. Not tail-recursive. *)valmap2:('a->'b->'c)->'alist->'blist->'clist(** [List.rev_map2 f l1 l2] gives the same result as
{!List.rev}[ (]{!List.map2}[ f l1 l2)], but is tail-recursive and
more efficient. *)valrev_map2:('a->'b->'c)->'alist->'blist->'clist(** [List.fold_left2 f a [b1; ...; bn] [c1; ...; cn]] is
[f (... (f (f a b1 c1) b2 c2) ...) bn cn].
Raise [Invalid_argument] if the two lists are determined
to have different lengths. *)valfold_left2:('a->'b->'c->'a)->'a->'blist->'clist->'a(** [List.fold_right2 f [a1; ...; an] [b1; ...; bn] c] is
[f a1 b1 (f a2 b2 (... (f an bn c) ...))].
Raise [Invalid_argument] if the two lists are determined
to have different lengths. Not tail-recursive. *)valfold_right2:('a->'b->'c->'c)->'alist->'blist->'c->'c(** {1 List scanning} *)(** [for_all p [a1; ...; an]] checks if all elements of the list
satisfy the predicate [p]. That is, it returns
[(p a1) && (p a2) && ... && (p an)]. *)valfor_all:('a->bool)->'alist->bool(** [exists p [a1; ...; an]] checks if at least one element of
the list satisfies the predicate [p]. That is, it returns
[(p a1) || (p a2) || ... || (p an)]. *)valexists:('a->bool)->'alist->bool(** Same as {!List.for_all}, but for a two-argument predicate.
Raise [Invalid_argument] if the two lists are determined
to have different lengths. *)valfor_all2:('a->'b->bool)->'alist->'blist->bool(** Same as {!List.exists}, but for a two-argument predicate.
Raise [Invalid_argument] if the two lists are determined
to have different lengths. *)valexists2:('a->'b->bool)->'alist->'blist->bool(** [mem a l] is true if and only if [a] is equal
to an element of [l]. *)valmem:'a->'alist->bool(** Same as {!List.mem}, but uses physical equality instead of structural
equality to compare list elements. *)valmemq:'a->'alist->bool(** {1 List searching} *)(** [find_opt p l] returns the first element of the list [l] that
satisfies the predicate [p], or [None] if there is no value that
satisfies [p] in the list [l].
@since 4.05 *)valfind_opt:('a->bool)->'alist->'aoption(** [filter p l] returns all the elements of the list [l]
that satisfy the predicate [p]. The order of the elements
in the input list is preserved. *)valfilter:('a->bool)->'alist->'alist(** [find_all] is another name for {!List.filter}. *)valfind_all:('a->bool)->'alist->'alist(** [partition p l] returns a pair of lists [(l1, l2)], where
[l1] is the list of all the elements of [l] that
satisfy the predicate [p], and [l2] is the list of all the
elements of [l] that do not satisfy [p].
The order of the elements in the input list is preserved. *)valpartition:('a->bool)->'alist->'alist*'alist(** {1 Association lists} *)(** [assoc_opt a l] returns the value associated with key [a] in the list of
pairs [l]. That is,
[assoc_opt a [ ...; (a,b); ...] = b]
if [(a,b)] is the leftmost binding of [a] in list [l].
Returns [None] if there is no value associated with [a] in the
list [l].
@since 4.05 *)valassoc_opt:'a->('a*'b)list->'boption(** Same as {!List.assoc_opt}, but uses physical equality instead of structural
equality to compare keys.
@since 4.05 *)valassq_opt:'a->('a*'b)list->'boption(** Same as {!List.assoc}, but simply return true if a binding exists,
and false if no bindings exist for the given key. *)valmem_assoc:'a->('a*'b)list->bool(** Same as {!List.mem_assoc}, but uses physical equality instead of
structural equality to compare keys. *)valmem_assq:'a->('a*'b)list->bool(** [remove_assoc a l] returns the list of
pairs [l] without the first pair with key [a], if any.
Not tail-recursive. *)valremove_assoc:'a->('a*'b)list->('a*'b)list(** Same as {!List.remove_assoc}, but uses physical equality instead
of structural equality to compare keys. Not tail-recursive. *)valremove_assq:'a->('a*'b)list->('a*'b)list(** {1 Lists of pairs} *)(** Transform a list of pairs into a pair of lists:
[split [(a1,b1); ...; (an,bn)]] is [([a1; ...; an], [b1; ...; bn])].
Not tail-recursive.
*)valsplit:('a*'b)list->'alist*'blist(** Transform a pair of lists into a list of pairs:
[combine [a1; ...; an] [b1; ...; bn]] is
[[(a1,b1); ...; (an,bn)]].
Raise [Invalid_argument] if the two lists
have different lengths. Not tail-recursive. *)valcombine:'alist->'blist->('a*'b)list(** {1 Sorting} *)(** Sort a list in increasing order according to a comparison
function. The comparison function must return 0 if its arguments
compare as equal, a positive integer if the first is greater,
and a negative integer if the first is smaller (see Array.sort for
a complete specification). For example,
{!Stdlib.compare} is a suitable comparison function.
The resulting list is sorted in increasing order.
[List.sort] is guaranteed to run in constant heap space
(in addition to the size of the result list) and logarithmic
stack space.
The current implementation uses Merge Sort. It runs in constant
heap space and logarithmic stack space.
*)valsort:('a->'a->int)->'alist->'alist(** Same as {!List.sort}, but the sorting algorithm is guaranteed to
be stable (i.e. elements that compare equal are kept in their
original order) .
The current implementation uses Merge Sort. It runs in constant
heap space and logarithmic stack space.
*)valstable_sort:('a->'a->int)->'alist->'alist(** Same as {!List.sort} or {!List.stable_sort}, whichever is faster
on typical input. *)valfast_sort:('a->'a->int)->'alist->'alist(** Same as {!List.sort}, but also remove duplicates.
@since 4.02.0 *)valsort_uniq:('a->'a->int)->'alist->'alist(** Merge two lists:
Assuming that [l1] and [l2] are sorted according to the
comparison function [cmp], [merge cmp l1 l2] will return a
sorted list containing all the elements of [l1] and [l2].
If several elements compare equal, the elements of [l1] will be
before the elements of [l2].
Not tail-recursive (sum of the lengths of the arguments).
*)valmerge:('a->'a->int)->'alist->'alist->'alistend# 10 "v0.in.ml"moduleString:sig# 1 "v0/string.mli"(**************************************************************************)(* *)(* OCaml *)(* *)(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)(* *)(* Copyright 1996 Institut National de Recherche en Informatique et *)(* en Automatique. *)(* *)(* All rights reserved. This file is distributed under the terms of *)(* the GNU Lesser General Public License version 2.1, with the *)(* special exception on linking described in the file LICENSE. *)(* *)(**************************************************************************)(* TEZOS CHANGES
* Import version 4.06.1
* Remove unsafe functions
* Remove deprecated functions (enforcing string immutability)
* Add binary data extraction functions
*)(** String operations.
A string is an immutable data structure that contains a
fixed-length sequence of (single-byte) characters. Each character
can be accessed in constant time through its index.
Given a string [s] of length [l], we can access each of the [l]
characters of [s] via its index in the sequence. Indexes start at
[0], and we will call an index valid in [s] if it falls within the
range [[0...l-1]] (inclusive). A position is the point between two
characters or at the beginning or end of the string. We call a
position valid in [s] if it falls within the range [[0...l]]
(inclusive). Note that the character at index [n] is between
positions [n] and [n+1].
Two parameters [start] and [len] are said to designate a valid
substring of [s] if [len >= 0] and [start] and [start+len] are
valid positions in [s].
OCaml strings used to be modifiable in place, for instance via the
{!String.set} and {!String.blit} functions described below. This
usage is deprecated and only possible when the compiler is put in
"unsafe-string" mode by giving the [-unsafe-string] command-line
option (which is currently the default for reasons of backward
compatibility). This is done by making the types [string] and
[bytes] (see module {!Bytes}) interchangeable so that functions
expecting byte sequences can also accept strings as arguments and
modify them.
All new code should avoid this feature and be compiled with the
[-safe-string] command-line option to enforce the separation between
the types [string] and [bytes].
*)(** Return the length (number of characters) of the given string. *)externallength:string->int="%string_length"(** [String.get s n] returns the character at index [n] in string [s].
You can also write [s.[n]] instead of [String.get s n].
Raise [Invalid_argument] if [n] not a valid index in [s]. *)externalget:string->int->char="%string_safe_get"(** [String.make n c] returns a fresh string of length [n],
filled with the character [c].
Raise [Invalid_argument] if [n < 0] or [n > ]{!Sys.max_string_length}. *)valmake:int->char->string(** [String.init n f] returns a string of length [n], with character
[i] initialized to the result of [f i] (called in increasing
index order).
Raise [Invalid_argument] if [n < 0] or [n > ]{!Sys.max_string_length}.
@since 4.02.0
*)valinit:int->(int->char)->string(** [String.sub s start len] returns a fresh string of length [len],
containing the substring of [s] that starts at position [start] and
has length [len].
Raise [Invalid_argument] if [start] and [len] do not
designate a valid substring of [s]. *)valsub:string->int->int->string(** Same as {!Bytes.blit_string}. *)valblit:string->int->bytes->int->int->unit(** [String.concat sep sl] concatenates the list of strings [sl],
inserting the separator string [sep] between each.
Raise [Invalid_argument] if the result is longer than
{!Sys.max_string_length} bytes. *)valconcat:string->stringlist->string(** [String.iter f s] applies function [f] in turn to all
the characters of [s]. It is equivalent to
[f s.[0]; f s.[1]; ...; f s.[String.length s - 1]; ()]. *)valiter:(char->unit)->string->unit(** Same as {!String.iter}, but the
function is applied to the index of the element as first argument
(counting from 0), and the character itself as second argument.
@since 4.00.0 *)valiteri:(int->char->unit)->string->unit(** [String.map f s] applies function [f] in turn to all the
characters of [s] (in increasing index order) and stores the
results in a new string that is returned.
@since 4.00.0 *)valmap:(char->char)->string->string(** [String.mapi f s] calls [f] with each character of [s] and its
index (in increasing index order) and stores the results in a new
string that is returned.
@since 4.02.0 *)valmapi:(int->char->char)->string->string(** Return a copy of the argument, without leading and trailing
whitespace. The characters regarded as whitespace are: [' '],
['\012'], ['\n'], ['\r'], and ['\t']. If there is neither leading nor
trailing whitespace character in the argument, return the original
string itself, not a copy.
@since 4.00.0 *)valtrim:string->string(** Return a copy of the argument, with special characters
represented by escape sequences, following the lexical
conventions of OCaml.
All characters outside the ASCII printable range (32..126) are
escaped, as well as backslash and double-quote.
If there is no special character in the argument that needs
escaping, return the original string itself, not a copy.
Raise [Invalid_argument] if the result is longer than
{!Sys.max_string_length} bytes.
The function {!Scanf.unescaped} is a left inverse of [escaped],
i.e. [Scanf.unescaped (escaped s) = s] for any string [s] (unless
[escape s] fails). *)valescaped:string->string(** [String.index_opt s c] returns the index of the first
occurrence of character [c] in string [s], or
[None] if [c] does not occur in [s].
@since 4.05 *)valindex_opt:string->char->intoption(** [String.rindex_opt s c] returns the index of the last occurrence
of character [c] in string [s], or [None] if [c] does not occur in
[s].
@since 4.05 *)valrindex_opt:string->char->intoption(** [String.index_from_opt s i c] returns the index of the
first occurrence of character [c] in string [s] after position [i]
or [None] if [c] does not occur in [s] after position [i].
[String.index_opt s c] is equivalent to [String.index_from_opt s 0 c].
Raise [Invalid_argument] if [i] is not a valid position in [s].
@since 4.05
*)valindex_from_opt:string->int->char->intoption(** [String.rindex_from_opt s i c] returns the index of the
last occurrence of character [c] in string [s] before position [i+1]
or [None] if [c] does not occur in [s] before position [i+1].
[String.rindex_opt s c] is equivalent to
[String.rindex_from_opt s (String.length s - 1) c].
Raise [Invalid_argument] if [i+1] is not a valid position in [s].
@since 4.05
*)valrindex_from_opt:string->int->char->intoption(** [String.contains s c] tests if character [c]
appears in the string [s]. *)valcontains:string->char->bool(** [String.contains_from s start c] tests if character [c]
appears in [s] after position [start].
[String.contains s c] is equivalent to
[String.contains_from s 0 c].
Raise [Invalid_argument] if [start] is not a valid position in [s]. *)valcontains_from:string->int->char->bool(** [String.rcontains_from s stop c] tests if character [c]
appears in [s] before position [stop+1].
Raise [Invalid_argument] if [stop < 0] or [stop+1] is not a valid
position in [s]. *)valrcontains_from:string->int->char->bool(** Return a copy of the argument, with all lowercase letters
translated to uppercase, using the US-ASCII character set.
@since 4.03.0 *)valuppercase_ascii:string->string(** Return a copy of the argument, with all uppercase letters
translated to lowercase, using the US-ASCII character set.
@since 4.03.0 *)vallowercase_ascii:string->string(** Return a copy of the argument, with the first character set to uppercase,
using the US-ASCII character set.
@since 4.03.0 *)valcapitalize_ascii:string->string(** Return a copy of the argument, with the first character set to lowercase,
using the US-ASCII character set.
@since 4.03.0 *)valuncapitalize_ascii:string->string(** An alias for the type of strings. *)typet=string(** The comparison function for strings, with the same specification as
{!Stdlib.compare}. Along with the type [t], this function [compare]
allows the module [String] to be passed as argument to the functors
{!Set.Make} and {!Map.Make}. *)valcompare:t->t->int(** The equal function for strings.
@since 4.03.0 *)valequal:t->t->bool(** [String.split_on_char sep s] returns the list of all (possibly empty)
substrings of [s] that are delimited by the [sep] character.
The function's output is specified by the following invariants:
- The list is not empty.
- Concatenating its elements using [sep] as a separator returns a
string equal to the input ([String.concat (String.make 1 sep)
(String.split_on_char sep s) = s]).
- No string in the result contains the [sep] character.
@since 4.04.0
*)valsplit_on_char:char->string->stringlist(** Functions reading bytes *)(** [get_char buff i] reads 1 byte at offset i as a char *)valget_char:t->int->char(** [get_uint8 buff i] reads 1 byte at offset i as an unsigned int of 8
bits. i.e. It returns a value between 0 and 2^8-1 *)valget_uint8:t->int->int(** [get_int8 buff i] reads 1 byte at offset i as a signed int of 8
bits. i.e. It returns a value between -2^7 and 2^7-1 *)valget_int8:t->int->int(** Functions reading according to Big Endian byte order *)(** [get_uint16 buff i] reads 2 bytes at offset i as an unsigned int
of 16 bits. i.e. It returns a value between 0 and 2^16-1 *)valget_uint16:t->int->int(** [get_int16 buff i] reads 2 byte at offset i as a signed int of
16 bits. i.e. It returns a value between -2^15 and 2^15-1 *)valget_int16:t->int->int(** [get_int32 buff i] reads 4 bytes at offset i as an int32. *)valget_int32:t->int->int32(** [get_int64 buff i] reads 8 bytes at offset i as an int64. *)valget_int64:t->int->int64moduleLE:sig(** Functions reading according to Little Endian byte order *)(** [get_uint16 buff i] reads 2 bytes at offset i as an unsigned int
of 16 bits. i.e. It returns a value between 0 and 2^16-1 *)valget_uint16:t->int->int(** [get_int16 buff i] reads 2 byte at offset i as a signed int of
16 bits. i.e. It returns a value between -2^15 and 2^15-1 *)valget_int16:t->int->int(** [get_int32 buff i] reads 4 bytes at offset i as an int32. *)valget_int32:t->int->int32(** [get_int64 buff i] reads 8 bytes at offset i as an int64. *)valget_int64:t->int->int64endend# 12 "v0.in.ml"moduleInt32:sig# 1 "v0/int32.mli"(**************************************************************************)(* *)(* OCaml *)(* *)(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)(* *)(* Copyright 1996 Institut National de Recherche en Informatique et *)(* en Automatique. *)(* *)(* All rights reserved. This file is distributed under the terms of *)(* the GNU Lesser General Public License version 2.1, with the *)(* special exception on linking described in the file LICENSE. *)(* *)(**************************************************************************)(* TEZOS CHANGES
* Import version 4.06.1
* Remove deprecated functions
*)(** 32-bit integers.
This module provides operations on the type [int32]
of signed 32-bit integers. Unlike the built-in [int] type,
the type [int32] is guaranteed to be exactly 32-bit wide on all
platforms. All arithmetic operations over [int32] are taken
modulo 2{^32}.
Performance notice: values of type [int32] occupy more memory
space than values of type [int], and arithmetic operations on
[int32] are generally slower than those on [int]. Use [int32]
only when the application requires exact 32-bit arithmetic. *)(** The 32-bit integer 0. *)valzero:int32(** The 32-bit integer 1. *)valone:int32(** The 32-bit integer -1. *)valminus_one:int32(** Unary negation. *)externalneg:int32->int32="%int32_neg"(** Addition. *)externaladd:int32->int32->int32="%int32_add"(** Subtraction. *)externalsub:int32->int32->int32="%int32_sub"(** Multiplication. *)externalmul:int32->int32->int32="%int32_mul"(** Integer division. Raise [Division_by_zero] if the second
argument is zero. This division rounds the real quotient of
its arguments towards zero, as specified for {!Pervasives.(/)}. *)externaldiv:int32->int32->int32="%int32_div"(** Integer remainder. If [y] is not zero, the result
of [Int32.rem x y] satisfies the following property:
[x = Int32.add (Int32.mul (Int32.div x y) y) (Int32.rem x y)].
If [y = 0], [Int32.rem x y] raises [Division_by_zero]. *)externalrem:int32->int32->int32="%int32_mod"(** Successor. [Int32.succ x] is [Int32.add x Int32.one]. *)valsucc:int32->int32(** Predecessor. [Int32.pred x] is [Int32.sub x Int32.one]. *)valpred:int32->int32(** Return the absolute value of its argument. *)valabs:int32->int32(** The greatest representable 32-bit integer, 2{^31} - 1. *)valmax_int:int32(** The smallest representable 32-bit integer, -2{^31}. *)valmin_int:int32(** Bitwise logical and. *)externallogand:int32->int32->int32="%int32_and"(** Bitwise logical or. *)externallogor:int32->int32->int32="%int32_or"(** Bitwise logical exclusive or. *)externallogxor:int32->int32->int32="%int32_xor"(** Bitwise logical negation. *)vallognot:int32->int32(** [Int32.shift_left x y] shifts [x] to the left by [y] bits.
The result is unspecified if [y < 0] or [y >= 32]. *)externalshift_left:int32->int->int32="%int32_lsl"(** [Int32.shift_right x y] shifts [x] to the right by [y] bits.
This is an arithmetic shift: the sign bit of [x] is replicated
and inserted in the vacated bits.
The result is unspecified if [y < 0] or [y >= 32]. *)externalshift_right:int32->int->int32="%int32_asr"(** [Int32.shift_right_logical x y] shifts [x] to the right by [y] bits.
This is a logical shift: zeroes are inserted in the vacated bits
regardless of the sign of [x].
The result is unspecified if [y < 0] or [y >= 32]. *)externalshift_right_logical:int32->int->int32="%int32_lsr"(** Convert the given integer (type [int]) to a 32-bit integer
(type [int32]). *)externalof_int:int->int32="%int32_of_int"(** Convert the given 32-bit integer (type [int32]) to an
integer (type [int]). On 32-bit platforms, the 32-bit integer
is taken modulo 2{^31}, i.e. the high-order bit is lost
during the conversion. On 64-bit platforms, the conversion
is exact. *)externalto_int:int32->int="%int32_to_int"(** Convert the given floating-point number to a 32-bit integer,
discarding the fractional part (truncate towards 0).
The result of the conversion is undefined if, after truncation,
the number is outside the range \[{!Int32.min_int}, {!Int32.max_int}\]. *)externalof_float:float->int32="caml_int32_of_float""caml_int32_of_float_unboxed"[@@unboxed][@@noalloc](** Convert the given 32-bit integer to a floating-point number. *)externalto_float:int32->float="caml_int32_to_float""caml_int32_to_float_unboxed"[@@unboxed][@@noalloc](** Convert the given string to a 32-bit integer.
The string is read in decimal (by default, or if the string
begins with [0u]) or in hexadecimal, octal or binary if the
string begins with [0x], [0o] or [0b] respectively.
The [0u] prefix reads the input as an unsigned integer in the range
[[0, 2*Int32.max_int+1]]. If the input exceeds {!Int32.max_int}
it is converted to the signed integer
[Int32.min_int + input - Int32.max_int - 1].
The [_] (underscore) character can appear anywhere in the string
and is ignored.
Raise [Failure "Int32.of_string"] if the given string is not
a valid representation of an integer, or if the integer represented
exceeds the range of integers representable in type [int32]. *)externalof_string:string->int32="caml_int32_of_string"(** Same as [of_string], but return [None] instead of raising.
@since 4.05 *)valof_string_opt:string->int32option(** Return the string representation of its argument, in signed decimal. *)valto_string:int32->string(** Return the internal representation of the given float according
to the IEEE 754 floating-point 'single format' bit layout.
Bit 31 of the result represents the sign of the float;
bits 30 to 23 represent the (biased) exponent; bits 22 to 0
represent the mantissa. *)externalbits_of_float:float->int32="caml_int32_bits_of_float""caml_int32_bits_of_float_unboxed"[@@unboxed][@@noalloc](** Return the floating-point number whose internal representation,
according to the IEEE 754 floating-point 'single format' bit layout,
is the given [int32]. *)externalfloat_of_bits:int32->float="caml_int32_float_of_bits""caml_int32_float_of_bits_unboxed"[@@unboxed][@@noalloc](** An alias for the type of 32-bit integers. *)typet=int32(** The comparison function for 32-bit integers, with the same specification as
{!Stdlib.compare}. Along with the type [t], this function [compare]
allows the module [Int32] to be passed as argument to the functors
{!Set.Make} and {!Map.Make}. *)valcompare:t->t->int(** The equal function for int32s.
@since 4.03.0 *)valequal:t->t->boolend# 14 "v0.in.ml"moduleInt64:sig# 1 "v0/int64.mli"(**************************************************************************)(* *)(* OCaml *)(* *)(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)(* *)(* Copyright 1996 Institut National de Recherche en Informatique et *)(* en Automatique. *)(* *)(* All rights reserved. This file is distributed under the terms of *)(* the GNU Lesser General Public License version 2.1, with the *)(* special exception on linking described in the file LICENSE. *)(* *)(**************************************************************************)(* TEZOS CHANGES
* Import version 4.06.1
* Remove deprecated functions
*)(** 64-bit integers.
This module provides operations on the type [int64] of
signed 64-bit integers. Unlike the built-in [int] type,
the type [int64] is guaranteed to be exactly 64-bit wide on all
platforms. All arithmetic operations over [int64] are taken
modulo 2{^64}
Performance notice: values of type [int64] occupy more memory
space than values of type [int], and arithmetic operations on
[int64] are generally slower than those on [int]. Use [int64]
only when the application requires exact 64-bit arithmetic.
*)(** The 64-bit integer 0. *)valzero:int64(** The 64-bit integer 1. *)valone:int64(** The 64-bit integer -1. *)valminus_one:int64(** Unary negation. *)externalneg:int64->int64="%int64_neg"(** Addition. *)externaladd:int64->int64->int64="%int64_add"(** Subtraction. *)externalsub:int64->int64->int64="%int64_sub"(** Multiplication. *)externalmul:int64->int64->int64="%int64_mul"(** Integer division. Raise [Division_by_zero] if the second
argument is zero. This division rounds the real quotient of
its arguments towards zero, as specified for {!Pervasives.(/)}. *)externaldiv:int64->int64->int64="%int64_div"(** Integer remainder. If [y] is not zero, the result
of [Int64.rem x y] satisfies the following property:
[x = Int64.add (Int64.mul (Int64.div x y) y) (Int64.rem x y)].
If [y = 0], [Int64.rem x y] raises [Division_by_zero]. *)externalrem:int64->int64->int64="%int64_mod"(** Successor. [Int64.succ x] is [Int64.add x Int64.one]. *)valsucc:int64->int64(** Predecessor. [Int64.pred x] is [Int64.sub x Int64.one]. *)valpred:int64->int64(** Return the absolute value of its argument. *)valabs:int64->int64(** The greatest representable 64-bit integer, 2{^63} - 1. *)valmax_int:int64(** The smallest representable 64-bit integer, -2{^63}. *)valmin_int:int64(** Bitwise logical and. *)externallogand:int64->int64->int64="%int64_and"(** Bitwise logical or. *)externallogor:int64->int64->int64="%int64_or"(** Bitwise logical exclusive or. *)externallogxor:int64->int64->int64="%int64_xor"(** Bitwise logical negation. *)vallognot:int64->int64(** [Int64.shift_left x y] shifts [x] to the left by [y] bits.
The result is unspecified if [y < 0] or [y >= 64]. *)externalshift_left:int64->int->int64="%int64_lsl"(** [Int64.shift_right x y] shifts [x] to the right by [y] bits.
This is an arithmetic shift: the sign bit of [x] is replicated
and inserted in the vacated bits.
The result is unspecified if [y < 0] or [y >= 64]. *)externalshift_right:int64->int->int64="%int64_asr"(** [Int64.shift_right_logical x y] shifts [x] to the right by [y] bits.
This is a logical shift: zeroes are inserted in the vacated bits
regardless of the sign of [x].
The result is unspecified if [y < 0] or [y >= 64]. *)externalshift_right_logical:int64->int->int64="%int64_lsr"(** Convert the given integer (type [int]) to a 64-bit integer
(type [int64]). *)externalof_int:int->int64="%int64_of_int"(** Convert the given 64-bit integer (type [int64]) to an
integer (type [int]). On 64-bit platforms, the 64-bit integer
is taken modulo 2{^63}, i.e. the high-order bit is lost
during the conversion. On 32-bit platforms, the 64-bit integer
is taken modulo 2{^31}, i.e. the top 33 bits are lost
during the conversion. *)externalto_int:int64->int="%int64_to_int"(** Convert the given floating-point number to a 64-bit integer,
discarding the fractional part (truncate towards 0).
The result of the conversion is undefined if, after truncation,
the number is outside the range \[{!Int64.min_int}, {!Int64.max_int}\]. *)externalof_float:float->int64="caml_int64_of_float""caml_int64_of_float_unboxed"[@@unboxed][@@noalloc](** Convert the given 64-bit integer to a floating-point number. *)externalto_float:int64->float="caml_int64_to_float""caml_int64_to_float_unboxed"[@@unboxed][@@noalloc](** Convert the given 32-bit integer (type [int32])
to a 64-bit integer (type [int64]). *)externalof_int32:int32->int64="%int64_of_int32"(** Convert the given 64-bit integer (type [int64]) to a
32-bit integer (type [int32]). The 64-bit integer
is taken modulo 2{^32}, i.e. the top 32 bits are lost
during the conversion. *)externalto_int32:int64->int32="%int64_to_int32"(** Convert the given native integer (type [nativeint])
to a 64-bit integer (type [int64]). *)externalof_nativeint:nativeint->int64="%int64_of_nativeint"(** Convert the given 64-bit integer (type [int64]) to a
native integer. On 32-bit platforms, the 64-bit integer
is taken modulo 2{^32}. On 64-bit platforms,
the conversion is exact. *)externalto_nativeint:int64->nativeint="%int64_to_nativeint"(** Convert the given string to a 64-bit integer.
The string is read in decimal (by default, or if the string
begins with [0u]) or in hexadecimal, octal or binary if the
string begins with [0x], [0o] or [0b] respectively.
The [0u] prefix reads the input as an unsigned integer in the range
[[0, 2*Int64.max_int+1]]. If the input exceeds {!Int64.max_int}
it is converted to the signed integer
[Int64.min_int + input - Int64.max_int - 1].
The [_] (underscore) character can appear anywhere in the string
and is ignored.
Raise [Failure "Int64.of_string"] if the given string is not
a valid representation of an integer, or if the integer represented
exceeds the range of integers representable in type [int64]. *)externalof_string:string->int64="caml_int64_of_string"(** Same as [of_string], but return [None] instead of raising.
@since 4.05 *)valof_string_opt:string->int64option(** Return the string representation of its argument, in decimal. *)valto_string:int64->string(** Return the internal representation of the given float according
to the IEEE 754 floating-point 'double format' bit layout.
Bit 63 of the result represents the sign of the float;
bits 62 to 52 represent the (biased) exponent; bits 51 to 0
represent the mantissa. *)externalbits_of_float:float->int64="caml_int64_bits_of_float""caml_int64_bits_of_float_unboxed"[@@unboxed][@@noalloc](** Return the floating-point number whose internal representation,
according to the IEEE 754 floating-point 'double format' bit layout,
is the given [int64]. *)externalfloat_of_bits:int64->float="caml_int64_float_of_bits""caml_int64_float_of_bits_unboxed"[@@unboxed][@@noalloc](** An alias for the type of 64-bit integers. *)typet=int64(** The comparison function for 64-bit integers, with the same specification as
{!Stdlib.compare}. Along with the type [t], this function [compare]
allows the module [Int64] to be passed as argument to the functors
{!Set.Make} and {!Map.Make}. *)valcompare:t->t->int(** The equal function for int64s.
@since 4.03.0 *)valequal:t->t->boolend# 16 "v0.in.ml"moduleFormat:sig# 1 "v0/format.mli"(**************************************************************************)(* *)(* OCaml *)(* *)(* Pierre Weis, projet Cristal, INRIA Rocquencourt *)(* *)(* Copyright 1996 Institut National de Recherche en Informatique et *)(* en Automatique. *)(* *)(* All rights reserved. This file is distributed under the terms of *)(* the GNU Lesser General Public License version 2.1, with the *)(* special exception on linking described in the file LICENSE. *)(* *)(**************************************************************************)(* TEZOS CHANGES
* Import version 4.06.1
* Remove channel functions
* Remove toplevel effect based functions
* Remove deprecated functions
* Remove redirecting the standard formatter output
* Remove redefining formatter output and output functions
* Remove redefining semantic tag operations (too complex and
imperative for the need of error message generation)
* Remove defining formatters and symbolic pretty printing
*)(** Pretty-printing.
This module implements a pretty-printing facility to format values
within {{!boxes}'pretty-printing boxes'}
combined with a set of {{!fpp}printf-like functions}.
The pretty-printer splits lines at specified {{!breaks}break hints},
and indents lines according to the box structure.
This pretty-printing facility is implemented as an overlay on top of
abstract {{!section:formatter}formatters} which provide basic output
functions.
Some formatters are predefined, notably:
- {!std_formatter} outputs to {{!Pervasives.stdout}stdout}
- {!err_formatter} outputs to {{!Pervasives.stderr}stderr}
Most functions in the {!Format} module come in two variants:
a short version that operates on {!std_formatter} and the
generic version prefixed by [pp_] that takes a formatter
as its first argument.
More formatters can be created with {!formatter_of_out_channel},
{!formatter_of_buffer}, {!formatter_of_symbolic_output_buffer}
or using {{!section:formatter}custom formatters}.
*)(** {1 Introduction}
For a gentle introduction to the basics of pretty-printing using
[Format], read
{{:http://caml.inria.fr/resources/doc/guides/format.en.html}
http://caml.inria.fr/resources/doc/guides/format.en.html}.
You may consider this module as providing an extension to the
[printf] facility to provide automatic line splitting. The addition of
pretty-printing annotations to your regular [printf] format strings gives
you fancy indentation and line breaks.
Pretty-printing annotations are described below in the documentation of
the function {!Format.fprintf}.
You may also use the explicit pretty-printing box management and printing
functions provided by this module. This style is more basic but more
verbose than the concise [fprintf] format strings.
For instance, the sequence
[open_box 0; print_string "x ="; print_space ();
print_int 1; close_box (); print_newline ()]
that prints [x = 1] within a pretty-printing box, can be
abbreviated as [printf "@[%s@ %i@]@." "x =" 1], or even shorter
[printf "@[x =@ %i@]@." 1].
Rule of thumb for casual users of this library:
- use simple pretty-printing boxes (as obtained by [open_box 0]);
- use simple break hints as obtained by [print_cut ()] that outputs a
simple break hint, or by [print_space ()] that outputs a space
indicating a break hint;
- once a pretty-printing box is open, display its material with basic
printing functions (e. g. [print_int] and [print_string]);
- when the material for a pretty-printing box has been printed, call
[close_box ()] to close the box;
- at the end of pretty-printing, flush the pretty-printer to display all
the remaining material, e.g. evaluate [print_newline ()].
The behavior of pretty-printing commands is unspecified
if there is no open pretty-printing box. Each box opened by
one of the [open_] functions below must be closed using [close_box]
for proper formatting. Otherwise, some of the material printed in the
boxes may not be output, or may be formatted incorrectly.
In case of interactive use, each phrase is executed in the initial state
of the standard pretty-printer: after each phrase execution, the
interactive system closes all open pretty-printing boxes, flushes all
pending text, and resets the standard pretty-printer.
Warning: mixing calls to pretty-printing functions of this module with
calls to {!Pervasives} low level output functions is error prone.
The pretty-printing functions output material that is delayed in the
pretty-printer queue and stacks in order to compute proper line
splitting. In contrast, basic I/O output functions write directly in
their output device. As a consequence, the output of a basic I/O function
may appear before the output of a pretty-printing function that has been
called before. For instance,
[
Pervasives.print_string "<";
Format.print_string "PRETTY";
Pervasives.print_string ">";
Format.print_string "TEXT";
]
leads to output [<>PRETTYTEXT].
*)(** Abstract data corresponding to a pretty-printer (also called a
formatter) and all its machinery. See also {!section:formatter}. *)typeformatter(** {1:boxes Pretty-printing boxes} *)(** The pretty-printing engine uses the concepts of pretty-printing box and
break hint to drive indentation and line splitting behavior of the
pretty-printer.
Each different pretty-printing box kind introduces a specific line splitting
policy:
- within an {e horizontal} box, break hints never split the line (but the
line may be split in a box nested deeper),
- within a {e vertical} box, break hints always split the line,
- within an {e horizontal/vertical} box, if the box fits on the current line
then break hints never split the line, otherwise break hint always split
the line,
- within a {e compacting} box, a break hint never splits the line,
unless there is no more room on the current line.
Note that line splitting policy is box specific: the policy of a box does
not rule the policy of inner boxes. For instance, if a vertical box is
nested in an horizontal box, all break hints within the vertical box will
split the line.
*)(** [pp_open_box ppf d] opens a new compacting pretty-printing box with
offset [d] in the formatter [ppf].
Within this box, the pretty-printer prints as much as possible material on
every line.
A break hint splits the line if there is no more room on the line to
print the remainder of the box.
Within this box, the pretty-printer emphasizes the box structure: a break
hint also splits the line if the splitting ``moves to the left''
(i.e. the new line gets an indentation smaller than the one of the current
line).
This box is the general purpose pretty-printing box.
If the pretty-printer splits the line in the box, offset [d] is added to
the current indentation.
*)valpp_open_box:formatter->int->unit(** Closes the most recently open pretty-printing box. *)valpp_close_box:formatter->unit->unit(** [pp_open_hbox ppf ()] opens a new 'horizontal' pretty-printing box.
This box prints material on a single line.
Break hints in a horizontal box never split the line.
(Line splitting may still occur inside boxes nested deeper).
*)valpp_open_hbox:formatter->unit->unit(** [pp_open_vbox ppf d] opens a new 'vertical' pretty-printing box
with offset [d].
This box prints material on as many lines as break hints in the box.
Every break hint in a vertical box splits the line.
If the pretty-printer splits the line in the box, [d] is added to the
current indentation.
*)valpp_open_vbox:formatter->int->unit(** [pp_open_hvbox ppf d] opens a new 'horizontal/vertical' pretty-printing box
with offset [d].
This box behaves as an horizontal box if it fits on a single line,
otherwise it behaves as a vertical box.
If the pretty-printer splits the line in the box, [d] is added to the
current indentation.
*)valpp_open_hvbox:formatter->int->unit(** [pp_open_hovbox ppf d] opens a new 'horizontal-or-vertical'
pretty-printing box with offset [d].
This box prints material as much as possible on every line.
A break hint splits the line if there is no more room on the line to
print the remainder of the box.
If the pretty-printer splits the line in the box, [d] is added to the
current indentation.
*)valpp_open_hovbox:formatter->int->unit(** {1 Formatting functions} *)(** [pp_print_string ppf s] prints [s] in the current pretty-printing box. *)valpp_print_string:formatter->string->unit(** [pp_print_as ppf len s] prints [s] in the current pretty-printing box.
The pretty-printer formats [s] as if it were of length [len].
*)valpp_print_as:formatter->int->string->unit(** Print an integer in the current pretty-printing box. *)valpp_print_int:formatter->int->unit(** Print a floating point number in the current pretty-printing box. *)valpp_print_float:formatter->float->unit(** Print a character in the current pretty-printing box. *)valpp_print_char:formatter->char->unit(** Print a boolean in the current pretty-printing box. *)valpp_print_bool:formatter->bool->unit(** {1:breaks Break hints} *)(** A 'break hint' tells the pretty-printer to output some space or split the
line whichever way is more appropriate to the current pretty-printing box
splitting rules.
Break hints are used to separate printing items and are mandatory to let
the pretty-printer correctly split lines and indent items.
Simple break hints are:
- the 'space': output a space or split the line if appropriate,
- the 'cut': split the line if appropriate.
Note: the notions of space and line splitting are abstract for the
pretty-printing engine, since those notions can be completely redefined
by the programmer.
However, in the pretty-printer default setting, ``output a space'' simply
means printing a space character (ASCII code 32) and ``split the line''
means printing a newline character (ASCII code 10).
*)(** [pp_print_space ppf ()] emits a 'space' break hint:
the pretty-printer may split the line at this point,
otherwise it prints one space.
[pp_print_space ppf ()] is equivalent to [pp_print_break ppf 1 0].
*)valpp_print_space:formatter->unit->unit(** [pp_print_cut ppf ()] emits a 'cut' break hint:
the pretty-printer may split the line at this point,
otherwise it prints nothing.
[pp_print_cut ppf ()] is equivalent to [pp_print_break ppf 0 0].
*)valpp_print_cut:formatter->unit->unit(** [pp_print_break ppf nspaces offset] emits a 'full' break hint:
the pretty-printer may split the line at this point,
otherwise it prints [nspaces] spaces.
If the pretty-printer splits the line, [offset] is added to
the current indentation.
*)valpp_print_break:formatter->int->int->unit(** Force a new line in the current pretty-printing box.
The pretty-printer must split the line at this point,
Not the normal way of pretty-printing, since imperative line splitting may
interfere with current line counters and box size calculation.
Using break hints within an enclosing vertical box is a better
alternative.
*)valpp_force_newline:formatter->unit->unit(** Execute the next formatting command if the preceding line
has just been split. Otherwise, ignore the next formatting
command.
*)valpp_print_if_newline:formatter->unit->unit(** {1 Pretty-printing termination} *)(** End of pretty-printing: resets the pretty-printer to initial state.
All open pretty-printing boxes are closed, all pending text is printed.
In addition, the pretty-printer low level output device is flushed to
ensure that all pending text is really displayed.
Note: never use [print_flush] in the normal course of a pretty-printing
routine, since the pretty-printer uses a complex buffering machinery to
properly indent the output; manually flushing those buffers at random
would conflict with the pretty-printer strategy and result to poor
rendering.
Only consider using [print_flush] when displaying all pending material is
mandatory (for instance in case of interactive use when you want the user
to read some text) and when resetting the pretty-printer state will not
disturb further pretty-printing.
Warning: If the output device of the pretty-printer is an output channel,
repeated calls to [print_flush] means repeated calls to {!Pervasives.flush}
to flush the out channel; these explicit flush calls could foil the
buffering strategy of output channels and could dramatically impact
efficiency.
*)valpp_print_flush:formatter->unit->unit(** End of pretty-printing: resets the pretty-printer to initial state.
All open pretty-printing boxes are closed, all pending text is printed.
Equivalent to {!print_flush} followed by a new line.
See corresponding words of caution for {!print_flush}.
Note: this is not the normal way to output a new line;
the preferred method is using break hints within a vertical pretty-printing
box.
*)valpp_print_newline:formatter->unit->unit(** {1 Margin} *)(** [pp_set_margin ppf d] sets the right margin to [d] (in characters):
the pretty-printer splits lines that overflow the right margin according to
the break hints given.
Nothing happens if [d] is smaller than 2.
If [d] is too large, the right margin is set to the maximum
admissible value (which is greater than [10 ^ 9]).
If [d] is less than the current maximum indentation limit, the
maximum indentation limit is decreased while trying to preserve
a minimal ratio [max_indent/margin>=50%] and if possible
the current difference [margin - max_indent].
*)valpp_set_margin:formatter->int->unit(** Returns the position of the right margin. *)valpp_get_margin:formatter->unit->int(** {1 Maximum indentation limit} *)(** [pp_set_max_indent ppf d] sets the maximum indentation limit of lines
to [d] (in characters):
once this limit is reached, new pretty-printing boxes are rejected to the
left, if they do not fit on the current line.
Nothing happens if [d] is smaller than 2.
If [d] is too large, the limit is set to the maximum
admissible value (which is greater than [10 ^ 9]).
If [d] is greater or equal than the current margin, it is ignored,
and the current maximum indentation limit is kept.
*)valpp_set_max_indent:formatter->int->unit(** Return the maximum indentation limit (in characters). *)valpp_get_max_indent:formatter->unit->int(** {1 Maximum formatting depth} *)(** The maximum formatting depth is the maximum number of pretty-printing
boxes simultaneously open.
Material inside boxes nested deeper is printed as an ellipsis (more
precisely as the text returned by {!get_ellipsis_text} [()]).
*)(** [pp_set_max_boxes ppf max] sets the maximum number of pretty-printing
boxes simultaneously open.
Material inside boxes nested deeper is printed as an ellipsis (more
precisely as the text returned by {!get_ellipsis_text} [()]).
Nothing happens if [max] is smaller than 2.
*)valpp_set_max_boxes:formatter->int->unit(** Returns the maximum number of pretty-printing boxes allowed before
ellipsis.
*)valpp_get_max_boxes:formatter->unit->int(** Tests if the maximum number of pretty-printing boxes allowed have already
been opened.
*)valpp_over_max_boxes:formatter->unit->bool(** {1 Tabulation boxes} *)(**
A {e tabulation box} prints material on lines divided into cells of fixed
length. A tabulation box provides a simple way to display vertical columns
of left adjusted text.
This box features command [set_tab] to define cell boundaries, and command
[print_tab] to move from cell to cell and split the line when there is no
more cells to print on the line.
Note: printing within tabulation box is line directed, so arbitrary line
splitting inside a tabulation box leads to poor rendering. Yet, controlled
use of tabulation boxes allows simple printing of columns within
module {!Format}.
*)(** [open_tbox ()] opens a new tabulation box.
This box prints lines separated into cells of fixed width.
Inside a tabulation box, special {e tabulation markers} defines points of
interest on the line (for instance to delimit cell boundaries).
Function {!Format.set_tab} sets a tabulation marker at insertion point.
A tabulation box features specific {e tabulation breaks} to move to next
tabulation marker or split the line. Function {!Format.print_tbreak} prints
a tabulation break.
*)valpp_open_tbox:formatter->unit->unit(** Closes the most recently opened tabulation box. *)valpp_close_tbox:formatter->unit->unit(** Sets a tabulation marker at current insertion point. *)valpp_set_tab:formatter->unit->unit(** [print_tab ()] emits a 'next' tabulation break hint: if not already set on
a tabulation marker, the insertion point moves to the first tabulation
marker on the right, or the pretty-printer splits the line and insertion
point moves to the leftmost tabulation marker.
It is equivalent to [print_tbreak 0 0]. *)valpp_print_tab:formatter->unit->unit(** [print_tbreak nspaces offset] emits a 'full' tabulation break hint.
If not already set on a tabulation marker, the insertion point moves to the
first tabulation marker on the right and the pretty-printer prints
[nspaces] spaces.
If there is no next tabulation marker on the right, the pretty-printer
splits the line at this point, then insertion point moves to the leftmost
tabulation marker of the box.
If the pretty-printer splits the line, [offset] is added to
the current indentation.
*)valpp_print_tbreak:formatter->int->int->unit(** {1 Ellipsis} *)(** Set the text of the ellipsis printed when too many pretty-printing boxes
are open (a single dot, [.], by default).
*)valpp_set_ellipsis_text:formatter->string->unit(** Return the text of the ellipsis. *)valpp_get_ellipsis_text:formatter->unit->string(** {1 Convenience formatting functions.} *)(** [pp_print_list ?pp_sep pp_v ppf l] prints items of list [l],
using [pp_v] to print each item, and calling [pp_sep]
between items ([pp_sep] defaults to {!pp_print_cut}.
Does nothing on empty lists.
@since 4.02.0
*)valpp_print_list:?pp_sep:(formatter->unit->unit)->(formatter->'a->unit)->formatter->'alist->unit(** [pp_print_text ppf s] prints [s] with spaces and newlines respectively
printed using {!pp_print_space} and {!pp_force_newline}.
@since 4.02.0
*)valpp_print_text:formatter->string->unit(** {1:fpp Formatted pretty-printing} *)(**
Module [Format] provides a complete set of [printf] like functions for
pretty-printing using format string specifications.
Specific annotations may be added in the format strings to give
pretty-printing commands to the pretty-printing engine.
Those annotations are introduced in the format strings using the [@]
character. For instance, [@ ] means a space break, [@,] means a cut,
[@\[] opens a new box, and [@\]] closes the last open box.
*)valfprintf:formatter->('a,formatter,unit)format->'a(** [fprintf ff fmt arg1 ... argN] formats the arguments [arg1] to [argN]
according to the format string [fmt], and outputs the resulting string on
the formatter [ff].
The format string [fmt] is a character string which contains three types of
objects: plain characters and conversion specifications as specified in
the {!Printf} module, and pretty-printing indications specific to the
[Format] module.
The pretty-printing indication characters are introduced by
a [@] character, and their meanings are:
- [@\[]: open a pretty-printing box. The type and offset of the
box may be optionally specified with the following syntax:
the [<] character, followed by an optional box type indication,
then an optional integer offset, and the closing [>] character.
Pretty-printing box type is one of [h], [v], [hv], [b], or [hov].
'[h]' stands for an 'horizontal' pretty-printing box,
'[v]' stands for a 'vertical' pretty-printing box,
'[hv]' stands for an 'horizontal/vertical' pretty-printing box,
'[b]' stands for an 'horizontal-or-vertical' pretty-printing box
demonstrating indentation,
'[hov]' stands a simple 'horizontal-or-vertical' pretty-printing box.
For instance, [@\[<hov 2>] opens an 'horizontal-or-vertical'
pretty-printing box with indentation 2 as obtained with [open_hovbox 2].
For more details about pretty-printing boxes, see the various box opening
functions [open_*box].
- [@\]]: close the most recently opened pretty-printing box.
- [@,]: output a 'cut' break hint, as with [print_cut ()].
- [@ ]: output a 'space' break hint, as with [print_space ()].
- [@;]: output a 'full' break hint as with [print_break]. The
[nspaces] and [offset] parameters of the break hint may be
optionally specified with the following syntax:
the [<] character, followed by an integer [nspaces] value,
then an integer [offset], and a closing [>] character.
If no parameters are provided, the good break defaults to a
'space' break hint.
- [@.]: flush the pretty-printer and split the line, as with
[print_newline ()].
- [@<n>]: print the following item as if it were of length [n].
Hence, [printf "@<0>%s" arg] prints [arg] as a zero length string.
If [@<n>] is not followed by a conversion specification,
then the following character of the format is printed as if
it were of length [n].
- [@?]: flush the pretty-printer as with [print_flush ()].
This is equivalent to the conversion [%!].
- [@\n]: force a newline, as with [force_newline ()], not the normal way
of pretty-printing, you should prefer using break hints inside a vertical
pretty-printing box.
Note: To prevent the interpretation of a [@] character as a
pretty-printing indication, escape it with a [%] character.
Old quotation mode [@@] is deprecated since it is not compatible with
formatted input interpretation of character ['@'].
Example: [printf "@[%s@ %d@]@." "x =" 1] is equivalent to
[open_box (); print_string "x ="; print_space ();
print_int 1; close_box (); print_newline ()].
It prints [x = 1] within a pretty-printing 'horizontal-or-vertical' box.
*)(** Same as [printf] above, but instead of printing on a formatter,
returns a string containing the result of formatting the arguments.
Note that the pretty-printer queue is flushed at the end of {e each
call} to [sprintf].
In case of multiple and related calls to [sprintf] to output
material on a single string, you should consider using [fprintf]
with the predefined formatter [str_formatter] and call
[flush_str_formatter ()] to get the final result.
Alternatively, you can use [Format.fprintf] with a formatter writing to a
buffer of your own: flushing the formatter and the buffer at the end of
pretty-printing returns the desired string.
*)valsprintf:('a,unit,string)format->'a(** Same as [printf] above, but instead of printing on a formatter,
returns a string containing the result of formatting the arguments.
The type of [asprintf] is general enough to interact nicely with [%a]
conversions.
@since 4.01.0
*)valasprintf:('a,formatter,unit,string)format4->'a(** Same as [fprintf] above, but does not print anything.
Useful to ignore some material when conditionally printing.
@since 3.10.0
*)valifprintf:formatter->('a,formatter,unit)format->'a(** Formatted Pretty-Printing with continuations. *)(** Same as [fprintf] above, but instead of returning immediately,
passes the formatter to its first argument at the end of printing. *)valkfprintf:(formatter->'a)->formatter->('b,formatter,unit,'a)format4->'b(** Same as [kfprintf] above, but does not print anything.
Useful to ignore some material when conditionally printing.
@since 3.12.0
*)valikfprintf:(formatter->'a)->formatter->('b,formatter,unit,'a)format4->'b(** Same as [sprintf] above, but instead of returning the string,
passes it to the first argument. *)valksprintf:(string->'a)->('b,unit,string,'a)format4->'b(** Same as [asprintf] above, but instead of returning the string,
passes it to the first argument.
@since 4.03
*)valkasprintf:(string->'a)->('b,formatter,unit,'a)format4->'bend# 18 "v0.in.ml"moduleMBytes:sig# 1 "v0/mBytes.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)typetvalcreate:int->tvallength:t->intvalcopy:t->t(** [sub src ofs len] extract a sub-array of [src] starting at [ofs]
and of length [len]. No copying of elements is involved: the
sub-array and the original array share the same storage space. *)valsub:t->int->int->t(** [blit src ofs_src dst ofs_dst len] copy [len] bytes from [src]
starting at [ofs_src] into [dst] starting at [ofs_dst]. *)valblit:t->int->t->int->int->unit(** See [blit] *)valblit_of_string:string->int->t->int->int->unit(** See [blit] *)valblit_to_bytes:t->int->bytes->int->int->unit(** [of_string s] create an byte array filled with the same content than [s]. *)valof_string:string->t(** [to_string b] dump the array content in a [string]. *)valto_string:t->string(** [sub_string b ofs len] is equivalent to [to_string (sub b ofs len)]. *)valsub_string:t->int->int->string(** Functions reading and writing bytes *)(** [get_char buff i] reads 1 byte at offset i as a char *)valget_char:t->int->char(** [get_uint8 buff i] reads 1 byte at offset i as an unsigned int of 8
bits. i.e. It returns a value between 0 and 2^8-1 *)valget_uint8:t->int->int(** [get_int8 buff i] reads 1 byte at offset i as a signed int of 8
bits. i.e. It returns a value between -2^7 and 2^7-1 *)valget_int8:t->int->int(** [set_char buff i v] writes [v] to [buff] at offset [i] *)valset_char:t->int->char->unit(** [set_int8 buff i v] writes the least significant 8 bits of [v]
to [buff] at offset [i] *)valset_int8:t->int->int->unit(** Functions reading according to Big Endian byte order *)(** [get_uint16 buff i] reads 2 bytes at offset i as an unsigned int
of 16 bits. i.e. It returns a value between 0 and 2^16-1 *)valget_uint16:t->int->int(** [get_int16 buff i] reads 2 byte at offset i as a signed int of
16 bits. i.e. It returns a value between -2^15 and 2^15-1 *)valget_int16:t->int->int(** [get_int32 buff i] reads 4 bytes at offset i as an int32. *)valget_int32:t->int->int32(** [get_int64 buff i] reads 8 bytes at offset i as an int64. *)valget_int64:t->int->int64(** [set_int16 buff i v] writes the least significant 16 bits of [v]
to [buff] at offset [i] *)valset_int16:t->int->int->unit(** [set_int32 buff i v] writes [v] to [buff] at offset [i] *)valset_int32:t->int->int32->unit(** [set_int64 buff i v] writes [v] to [buff] at offset [i] *)valset_int64:t->int->int64->unitmoduleLE:sig(** Functions reading according to Little Endian byte order *)(** [get_uint16 buff i] reads 2 bytes at offset i as an unsigned int
of 16 bits. i.e. It returns a value between 0 and 2^16-1 *)valget_uint16:t->int->int(** [get_int16 buff i] reads 2 byte at offset i as a signed int of
16 bits. i.e. It returns a value between -2^15 and 2^15-1 *)valget_int16:t->int->int(** [get_int32 buff i] reads 4 bytes at offset i as an int32. *)valget_int32:t->int->int32(** [get_int64 buff i] reads 8 bytes at offset i as an int64. *)valget_int64:t->int->int64(** [set_int16 buff i v] writes the least significant 16 bits of [v]
to [buff] at offset [i] *)valset_int16:t->int->int->unit(** [set_int32 buff i v] writes [v] to [buff] at offset [i] *)valset_int32:t->int->int32->unit(** [set_int64 buff i v] writes [v] to [buff] at offset [i] *)valset_int64:t->int->int64->unitendval(=):t->t->boolval(<>):t->t->boolval(<):t->t->boolval(<=):t->t->boolval(>=):t->t->boolval(>):t->t->boolvalcompare:t->t->intvalconcat:string->tlist->tvalto_hex:t->[`Hexofstring]valof_hex:[`Hexofstring]->tend# 20 "v0.in.ml"moduleZ:sig# 1 "v0/z.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)(** Tezos Protocol Environment - Arbitrary precision arithmetic. *)typetvalzero:tvalone:t(** Returns its argument plus one. *)valsucc:t->t(** Absolute value. *)valabs:t->t(** Unary negation. *)valneg:t->t(** Addition. *)valadd:t->t->t(** Subtraction. *)valsub:t->t->t(** Multiplication. *)valmul:t->t->t(** Euclidean division and remainder. [ediv_rem a b] returns a pair [(q, r)]
such that [a = b * q + r] and [0 <= r < |b|].
Raises [Division_by_zero] if [b = 0].
*)valediv_rem:t->t->t*t(** Bitwise logical and. *)vallogand:t->t->t(** Bitwise logical or. *)vallogor:t->t->t(** Bitwise logical exclusive or. *)vallogxor:t->t->t(** Bitwise logical negation.
The identity [lognot a]=[-a-1] always hold.
*)vallognot:t->t(** Shifts to the left.
Equivalent to a multiplication by a power of 2.
The second argument must be non-negative.
*)valshift_left:t->int->t(** Shifts to the right.
This is an arithmetic shift,
equivalent to a division by a power of 2 with rounding towards -oo.
The second argument must be non-negative.
*)valshift_right:t->int->t(** Gives a human-readable, decimal string representation of the argument. *)valto_string:t->string(** Converts a string to an integer.
An optional [-] prefix indicates a negative number, while a [+]
prefix is ignored.
An optional prefix [0x], [0o], or [0b] (following the optional [-]
or [+] prefix) indicates that the number is,
represented, in hexadecimal, octal, or binary, respectively.
Otherwise, base 10 is assumed.
(Unlike C, a lone [0] prefix does not denote octal.)
Raises an [Invalid_argument] exception if the string is not a
syntactically correct representation of an integer.
*)valof_string:string->t(** Converts to a 64-bit integer. May raise [Overflow]. *)valto_int64:t->int64(** Converts from a 64-bit integer. *)valof_int64:int64->t(** Converts to a base integer. May raise an [Overflow]. *)valto_int:t->int(** Converts from a base integer. *)valof_int:int->tvalto_bits:?pad_to:int->t->MBytes.tvalof_bits:MBytes.t->tvalequal:t->t->boolvalcompare:t->t->int(** Returns the number of significant bits in the given number.
If [x] is zero, [numbits x] returns 0. Otherwise,
[numbits x] returns a positive integer [n] such that
[2^{n-1} <= |x| < 2^n]. Note that [numbits] is defined
for negative arguments, and that [numbits (-x) = numbits x]. *)valnumbits:t->intend# 22 "v0.in.ml"moduleLwt:sig# 1 "v0/lwt.mli"(* Lightweight thread library for OCaml
* http://www.ocsigen.org/lwt
* Interface Lwt
* Copyright (C) 2005-2008 J�r�me Vouillon
* Laboratoire PPS - CNRS Universit� Paris Diderot
* 2009-2012 J�r�mie Dimino
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, with linking exceptions;
* either version 2.1 of the License, or (at your option) any later
* version. See COPYING file for details.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*)(* TEZOS CHANGES
* import version 2.4.5
* Comment a few function that shouldn't be used in the protocol:
* choose: scheduling may be system dependent.
* wait/wakeup
* state
* cancel
* pause
* async
* thread storage
* lwt exceptions
*)(** Module [Lwt]: cooperative light-weight threads. *)(** This module defines {e cooperative light-weight threads} with
their primitives. A {e light-weight thread} represent a
computation that may be not terminated, for example because it is
waiting for some event to happen.
Lwt threads are cooperative in the sense that switching to another
thread is always explicit (with {!wakeup} or {!wakeup_exn}). When a
thread is running, it executes as much as possible, and then
returns (a value or an error) or sleeps.
Note that inside a Lwt thread, exceptions must be raised with
{!fail} instead of [raise]. Also the [try ... with ...]
construction will not catch Lwt errors. You must use {!catch}
instead. You can also use {!wrap} for functions that may raise
normal exception.
Lwt also provides the syntax extension {!Pa_lwt} to make code
using Lwt more readable.
*)(** {2 Definitions and basics} *)(** The type of threads returning a result of type ['a]. *)type+'at(** [return e] is a thread whose return value is the value of the
expression [e]. *)valreturn:'a->'at(* val fail : exn -> 'a t *)(* (\** [fail e] is a thread that fails with the exception [e]. *\) *)(** [bind t f] is a thread which first waits for the thread [t] to
terminate and then, if the thread succeeds, behaves as the
application of function [f] to the return value of [t]. If the
thread [t] fails, [bind t f] also fails, with the same
exception.
The expression [bind t (fun x -> t')] can intuitively be read as
[let x = t in t'], and if you use the {e lwt.syntax} syntax
extension, you can write a bind operation like that: [lwt x = t in t'].
Note that [bind] is also often used just for synchronization
purpose: [t'] will not execute before [t] is terminated.
The result of a thread can be bound several time. *)valbind:'at->('a->'bt)->'bt(** [t >>= f] is an alternative notation for [bind t f]. *)val(>>=):'at->('a->'bt)->'bt(** [f =<< t] is [t >>= f] *)val(=<<):('a->'bt)->'at->'bt(** [map f m] map the result of a thread. This is the same as [bind
m (fun x -> return (f x))] *)valmap:('a->'b)->'at->'bt(** [m >|= f] is [map f m] *)val(>|=):'at->('a->'b)->'bt(** [f =|< m] is [map f m] *)val(=|<):('a->'b)->'at->'bt(** {3 Pre-allocated threads} *)(** [return_unit = return ()] *)valreturn_unit:unitt(** [return_none = return None] *)valreturn_none:'aoptiont(** [return_nil = return \[\]] *)valreturn_nil:'alistt(** [return_true = return true] *)valreturn_true:boolt(** [return_false = return false] *)valreturn_false:boolt(* (\** {2 Thread storage} *\) *)(* type 'a key *)(* (\** Type of a key. Keys are used to store local values into *)(* threads *\) *)(* val new_key : unit -> 'a key *)(* (\** [new_key ()] creates a new key. *\) *)(* val get : 'a key -> 'a option *)(* (\** [get key] returns the value associated with [key] in the current *)(* thread. *\) *)(* val with_value : 'a key -> 'a option -> (unit -> 'b) -> 'b *)(* (\** [with_value key value f] executes [f] with [value] associated to *)(* [key]. The previous value associated to [key] is restored after *)(* [f] terminates. *\) *)(* (\** {2 Exceptions handling} *\) *)(* val catch : (unit -> 'a t) -> (exn -> 'a t) -> 'a t *)(* (\** [catch t f] is a thread that behaves as the thread [t ()] if *)(* this thread succeeds. If the thread [t ()] fails with some *)(* exception, [catch t f] behaves as the application of [f] to this *)(* exception. *\) *)(* val try_bind : (unit -> 'a t) -> ('a -> 'b t) -> (exn -> 'b t) -> 'b t *)(* (\** [try_bind t f g] behaves as [bind (t ()) f] if [t] does not *)(* fail. Otherwise, it behaves as the application of [g] to the *)(* exception associated to [t ()]. *\) *)(* val finalize : (unit -> 'a t) -> (unit -> unit t) -> 'a t *)(* (\** [finalize f g] returns the same result as [f ()] whether it *)(* fails or not. In both cases, [g ()] is executed after [f]. *\) *)(* val wrap : (unit -> 'a) -> 'a t *)(* (\** [wrap f] calls [f] and transform the result into a monad. If [f] *)(* raise an exception, it is caught by Lwt. *)(* This is actually the same as: *)(* {[ *)(* try *)(* return (f ()) *)(* with exn -> *)(* fail exn *)(* ]} *)(* *\) *)(* val wrap1 : ('a -> 'b) -> 'a -> 'b t *)(* (\** [wrap1 f x] applies [f] on [x] and returns the result as a *)(* thread. If the application of [f] to [x] raise an exception it *)(* is caught and a thread is returned. *)(* Note that you must use {!wrap} instead of {!wrap1} if the *)(* evaluation of [x] may raise an exception. *)(* for example the following code is not ok: *)(* {[ *)(* wrap1 f (Hashtbl.find table key) *)(* ]} *)(* you should write instead: *)(* {[ *)(* wrap (fun () -> f (Hashtbl.find table key)) *)(* ]} *)(* *\) *)(* val wrap2 : ('a -> 'b -> 'c) -> 'a -> 'b -> 'c t *)(* val wrap3 : ('a -> 'b -> 'c -> 'd) -> 'a -> 'b -> 'c -> 'd t *)(* val wrap4 : ('a -> 'b -> 'c -> 'd -> 'e) -> 'a -> 'b -> 'c -> 'd -> 'e t *)(* val wrap5 : ('a -> 'b -> 'c -> 'd -> 'e -> 'f) -> 'a -> 'b -> 'c -> 'd -> 'e -> 'f t *)(* val wrap6 : ('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g) -> 'a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g t *)(* val wrap7 : ('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'h) -> 'a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'h t *)(** {2 Multi-threads composition} *)(* we shouldn't use choose: the scheduling may be system dependent *)(* val choose : 'a t list -> 'a t *)(* (\** [choose l] behaves as the first thread in [l] to terminate. If *)(* several threads are already terminated, one is chosen at *)(* random. *)(* Note: {!choose} leaves the local values of the current thread *)(* unchanged. *\) *)(* val nchoose : 'a t list -> 'a list t *)(* (\** [nchoose l] returns the value of all that have successfully *)(* terminated. If all threads are sleeping, it waits for at least *)(* one to terminates. If one the threads of [l] fails, [nchoose] *)(* fails with the same exception. *)(* Note: {!nchoose} leaves the local values of the current thread *)(* unchanged. *\) *)(* val nchoose_split : 'a t list -> ('a list * 'a t list) t *)(* (\** [nchoose_split l] does the same as {!nchoose} but also returns *)(* the list of threads that have not yet terminated. *\) *)(** [join l] waits for all threads in [l] to terminate. If one of
the threads fails, then [join l] will fails with the same
exception as the first one to terminate.
Note: {!join} leaves the local values of the current thread
unchanged. *)valjoin:unittlist->unitt(* val ( <?> ) : 'a t -> 'a t -> 'a t *)(* (\** [t <?> t'] is the same as [choose [t; t']] *\) *)(** [t <&> t'] is the same as [join [t; t']] *)val(<&>):unitt->unitt->unitt(* val async : (unit -> 'a t) -> unit *)(* (\** [async f] starts a thread without waiting for the result. If it *)(* fails (now or later), the exception is given to *)(* {!async_exception_hook}. *)(* You should use this function if you want to start a thread that *)(* might fail and don't care what its return value is, nor when it *)(* terminates (for instance, because it is looping). *\) *)(* val ignore_result : 'a t -> unit *)(* (\** [ignore_result t] is like [Pervasives.ignore t] except that: *)(* - if [t] already failed, it raises the exception now, *)(* - if [t] is sleeping and fails later, the exception will be *)(* given to {!async_exception_hook}. *\) *)(* val async_exception_hook : (exn -> unit) ref *)(* (\** Function called when a asynchronous exception is thrown. *)(* The default behavior is to print an error message with a *)(* backtrace if available and to exit the program. *)(* The behavior is undefined if this function raise an *)(* exception. *\) *)(* (\** {2 Sleeping and resuming} *\) *)(* type 'a u *)(* (\** The type of thread wakeners. *\) *)(* val wait : unit -> 'a t * 'a u *)(* (\** [wait ()] is a pair of a thread which sleeps forever (unless it *)(* is resumed by one of the functions [wakeup], [wakeup_exn] below) *)(* and the corresponding wakener. This thread does not block the *)(* execution of the remainder of the program (except of course, if *)(* another thread tries to wait for its termination). *\) *)(* val wakeup : 'a u -> 'a -> unit *)(* (\** [wakeup t e] makes the sleeping thread [t] terminate and return *)(* the value of the expression [e]. *\) *)(* val wakeup_exn : 'a u -> exn -> unit *)(* (\** [wakeup_exn t e] makes the sleeping thread [t] fail with the *)(* exception [e]. *\) *)(* val wakeup_later : 'a u -> 'a -> unit *)(* (\** Same as {!wakeup} but it is not guaranteed that the thread will *)(* be woken up immediately. *\) *)(* val wakeup_later_exn : 'a u -> exn -> unit *)(* (\** Same as {!wakeup_exn} but it is not guaranteed that the thread *)(* will be woken up immediately. *\) *)(* val waiter_of_wakener : 'a u -> 'a t *)(* (\** Returns the thread associated to a wakener. *\) *)(* type +'a result *)(* (\** Either a value of type ['a], either an exception. *\) *)(* val make_value : 'a -> 'a result *)(* (\** [value x] creates a result containing the value [x]. *\) *)(* val make_error : exn -> 'a result *)(* (\** [error e] creates a result containing the exception [e]. *\) *)(* val of_result : 'a result -> 'a t *)(* (\** Returns a thread from a result. *\) *)(* val wakeup_result : 'a u -> 'a result -> unit *)(* (\** [wakeup_result t r] makes the sleeping thread [t] terminate with *)(* the result [r]. *\) *)(* val wakeup_later_result : 'a u -> 'a result -> unit *)(* (\** Same as {!wakeup_result} but it is not guaranteed that the *)(* thread will be woken up immediately. *\) *)(* (\** {2 Threads state} *\) *)(* (\** State of a thread *\) *)(* type 'a state = *)(* | Return of 'a *)(* (\** The thread which has successfully terminated *\) *)(* | Fail of exn *)(* (\** The thread raised an exception *\) *)(* | Sleep *)(* (\** The thread is sleeping *\) *)(* val state : 'a t -> 'a state *)(* (\** [state t] returns the state of a thread *\) *)(* val is_sleeping : 'a t -> bool *)(* (\** [is_sleeping t] returns [true] iff [t] is sleeping. *\) *)(* (\** {2 Cancelable threads} *\) *)(* (\** Cancelable threads are the same as regular threads except that *)(* they can be canceled. *\) *)(* exception Canceled *)(* (\** Canceled threads fails with this exception *\) *)(* val task : unit -> 'a t * 'a u *)(* (\** [task ()] is the same as [wait ()] except that threads created *)(* with [task] can be canceled. *\) *)(* val on_cancel : 'a t -> (unit -> unit) -> unit *)(* (\** [on_cancel t f] executes [f] when [t] is canceled. [f] will be *)(* executed before all other threads waiting on [t]. *)(* If [f] raises an exception it is given to *)(* {!async_exception_hook}. *\) *)(* val add_task_r : 'a u Lwt_sequence.t -> 'a t *)(* (\** [add_task_r seq] creates a sleeping thread, adds its wakener to *)(* the right of [seq] and returns its waiter. When the thread is *)(* canceled, it is removed from [seq]. *\) *)(* val add_task_l : 'a u Lwt_sequence.t -> 'a t *)(* (\** [add_task_l seq] creates a sleeping thread, adds its wakener to *)(* the left of [seq] and returns its waiter. When the thread is *)(* canceled, it is removed from [seq]. *\) *)(* val cancel : 'a t -> unit *)(* (\** [cancel t] cancels the threads [t]. This means that the deepest *)(* sleeping thread created with [task] and connected to [t] is *)(* woken up with the exception {!Canceled}. *)(* For example, in the following code: *)(* {[ *)(* let waiter, wakener = task () in *)(* cancel (waiter >> printl "plop") *)(* ]} *)(* [waiter] will be woken up with {!Canceled}. *)(* *\) *)(* val pick : 'a t list -> 'a t *)(* (\** [pick l] is the same as {!choose}, except that it cancels all *)(* sleeping threads when one terminates. *)(* Note: {!pick} leaves the local values of the current thread *)(* unchanged. *\) *)(* val npick : 'a t list -> 'a list t *)(* (\** [npick l] is the same as {!nchoose}, except that it cancels all *)(* sleeping threads when one terminates. *)(* Note: {!npick} leaves the local values of the current thread *)(* unchanged. *\) *)(* val protected : 'a t -> 'a t *)(* (\** [protected thread] creates a new cancelable thread which behave *)(* as [thread] except that cancelling it does not cancel *)(* [thread]. *\) *)(* val no_cancel : 'a t -> 'a t *)(* (\** [no_cancel thread] creates a thread which behave as [thread] *)(* except that it cannot be canceled. *\) *)(* (\** {2 Pause} *\) *)(* val pause : unit -> unit t *)(* (\** [pause ()] is a sleeping thread which is wake up on the next *)(* call to {!wakeup_paused}. A thread created with [pause] can be *)(* canceled. *\) *)(* val wakeup_paused : unit -> unit *)(* (\** [wakeup_paused ()] wakes up all threads which suspended *)(* themselves with {!pause}. *)(* This function is called by the scheduler, before entering the *)(* main loop. You usually do not have to call it directly, except *)(* if you are writing a custom scheduler. *)(* Note that if a paused thread resumes and pauses again, it will not *)(* be woken up at this point. *\) *)(* val paused_count : unit -> int *)(* (\** [paused_count ()] returns the number of currently paused *)(* threads. *\) *)(* val register_pause_notifier : (int -> unit) -> unit *)(* (\** [register_pause_notifier f] register a function [f] that will be *)(* called each time pause is called. The parameter passed to [f] is *)(* the new number of threads paused. It is useful to be able to *)(* call {!wakeup_paused} when there is no scheduler *\) *)(* (\** {2 Misc} *\) *)(* val on_success : 'a t -> ('a -> unit) -> unit *)(* (\** [on_success t f] executes [f] when [t] terminates without *)(* failing. If [f] raises an exception it is given to *)(* {!async_exception_hook}. *\) *)(* val on_failure : 'a t -> (exn -> unit) -> unit *)(* (\** [on_failure t f] executes [f] when [t] terminates and fails. If *)(* [f] raises an exception it is given to *)(* {!async_exception_hook}. *\) *)(* val on_termination : 'a t -> (unit -> unit) -> unit *)(* (\** [on_termination t f] executes [f] when [t] terminates. If [f] *)(* raises an exception it is given to {!async_exception_hook}. *\) *)(* val on_any : 'a t -> ('a -> unit) -> (exn -> unit) -> unit *)(* (\** [on_any t f g] executes [f] or [g] when [t] terminates. If [f] *)(* or [g] raises an exception it is given to *)(* {!async_exception_hook}. *\) *)(* (\**/**\) *)(* (\* The functions below are probably not useful for the casual user. *)(* They provide the basic primitives on which can be built multi- *)(* threaded libraries such as Lwt_unix. *\) *)(* val poll : 'a t -> 'a option *)(* (\* [poll e] returns [Some v] if the thread [e] is terminated and *)(* returned the value [v]. If the thread failed with some *)(* exception, this exception is raised. If the thread is still *)(* running, [poll e] returns [None] without blocking. *\) *)(* val apply : ('a -> 'b t) -> 'a -> 'b t *)(* (\* [apply f e] apply the function [f] to the expression [e]. If *)(* an exception is raised during this application, it is caught *)(* and the resulting thread fails with this exception. *\) *)(* (\* Q: Could be called 'glue' or 'trap' or something? *\) *)(* val backtrace_bind : (exn -> exn) -> 'a t -> ('a -> 'b t) -> 'b t *)(* val backtrace_catch : (exn -> exn) -> (unit -> 'a t) -> (exn -> 'a t) -> 'a t *)(* val backtrace_try_bind : (exn -> exn) -> (unit -> 'a t) -> ('a -> 'b t) -> (exn -> 'b t) -> 'b t *)(* val backtrace_finalize : (exn -> exn) -> (unit -> 'a t) -> (unit -> unit t) -> 'a t *)end# 24 "v0.in.ml"moduleLwt_list:sig# 1 "v0/lwt_list.mli"(* Lightweight thread library for OCaml
* http://www.ocsigen.org/lwt
* Interface Lwt_list
* Copyright (C) 2010 Jérémie Dimino
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, with linking exceptions;
* either version 2.1 of the License, or (at your option) any later
* version. See COPYING file for details.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*)(** List helpers *)(* TEZOS CHANGES
* import version 2.4.5
* Remove iter/iteri
*)(** Note: this module use the same naming convention as
{!Lwt_stream}. *)(** {2 List iterators} *)valmap_s:('a->'bLwt.t)->'alist->'blistLwt.tvalmap_p:('a->'bLwt.t)->'alist->'blistLwt.tvalmapi_s:(int->'a->'bLwt.t)->'alist->'blistLwt.tvalmapi_p:(int->'a->'bLwt.t)->'alist->'blistLwt.tvalrev_map_s:('a->'bLwt.t)->'alist->'blistLwt.tvalrev_map_p:('a->'bLwt.t)->'alist->'blistLwt.tvalfold_left_s:('a->'b->'aLwt.t)->'a->'blist->'aLwt.tvalfold_right_s:('a->'b->'bLwt.t)->'alist->'b->'bLwt.t(** {2 List scanning} *)valfor_all_s:('a->boolLwt.t)->'alist->boolLwt.tvalfor_all_p:('a->boolLwt.t)->'alist->boolLwt.tvalexists_s:('a->boolLwt.t)->'alist->boolLwt.tvalexists_p:('a->boolLwt.t)->'alist->boolLwt.t(** {2 List searching} *)valfind_s:('a->boolLwt.t)->'alist->'aLwt.tvalfilter_s:('a->boolLwt.t)->'alist->'alistLwt.tvalfilter_p:('a->boolLwt.t)->'alist->'alistLwt.tvalfilter_map_s:('a->'boptionLwt.t)->'alist->'blistLwt.tvalfilter_map_p:('a->'boptionLwt.t)->'alist->'blistLwt.tvalpartition_s:('a->boolLwt.t)->'alist->('alist*'alist)Lwt.tvalpartition_p:('a->boolLwt.t)->'alist->('alist*'alist)Lwt.tend# 26 "v0.in.ml"moduleRaw_hashes:sig# 1 "v0/raw_hashes.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)valblake2b:MBytes.t->MBytes.tvalsha256:MBytes.t->MBytes.tvalsha512:MBytes.t->MBytes.tend# 28 "v0.in.ml"moduleCompare:sig# 1 "v0/compare.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)moduletypeCOMPARABLE=sigtypetvalcompare:t->t->intendmoduletypeS=sigtypetval(=):t->t->boolval(<>):t->t->boolval(<):t->t->boolval(<=):t->t->boolval(>=):t->t->boolval(>):t->t->boolvalcompare:t->t->intvalequal:t->t->boolvalmax:t->t->tvalmin:t->t->tendmoduleMake(P:COMPARABLE):Swithtypet:=P.tmoduleChar:Swithtypet=charmoduleBool:Swithtypet=boolmoduleInt:Swithtypet=intmoduleInt32:Swithtypet=int32moduleUint32:Swithtypet=int32moduleInt64:Swithtypet=int64moduleUint64:Swithtypet=int64moduleFloat:Swithtypet=floatmoduleString:Swithtypet=stringmoduleZ:Swithtypet=Z.tmoduleList(P:COMPARABLE):Swithtypet=P.tlistmoduleOption(P:COMPARABLE):Swithtypet=P.toptionend# 30 "v0.in.ml"moduleData_encoding:sig# 1 "v0/data_encoding.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)(** In memory JSON data *)typejson=[`Oof(string*json)list|`Boolofbool|`Floatoffloat|`Aofjsonlist|`Null|`Stringofstring]typejson_schematype'attype'aencoding='atvalclassify:'aencoding->[`Fixedofint|`Dynamic|`Variable]valsplitted:json:'aencoding->binary:'aencoding->'aencodingvalnull:unitencodingvalempty:unitencodingvalunit:unitencodingvalconstant:string->unitencodingvalint8:intencodingvaluint8:intencodingvalint16:intencodingvaluint16:intencodingvalint31:intencodingvalint32:int32encodingvalint64:int64encodingvaln:Z.tencodingvalz:Z.tencodingvalbool:boolencodingvalstring:stringencodingvalbytes:MBytes.tencodingvalfloat:floatencodingvaloption:'aencoding->'aoptionencodingvalstring_enum:(string*'a)list->'aencodingmoduleFixed:sigvalstring:int->stringencodingvalbytes:int->MBytes.tencodingvaladd_padding:'aencoding->int->'aencodingendmoduleVariable:sigvalstring:stringencodingvalbytes:MBytes.tencodingvalarray:?max_length:int->'aencoding->'aarrayencodingvallist:?max_length:int->'aencoding->'alistencodingendmoduleBounded:sigvalstring:int->stringencodingvalbytes:int->MBytes.tencodingendvaldynamic_size:?kind:[`Uint30|`Uint16|`Uint8]->'aencoding->'aencodingvaljson:jsonencodingvaljson_schema:json_schemaencodingtype'afieldvalreq:?title:string->?description:string->string->'tencoding->'tfieldvalopt:?title:string->?description:string->string->'tencoding->'toptionfieldvalvaropt:?title:string->?description:string->string->'tencoding->'toptionfieldvaldft:?title:string->?description:string->string->'tencoding->'t->'tfieldvalobj1:'f1field->'f1encodingvalobj2:'f1field->'f2field->('f1*'f2)encodingvalobj3:'f1field->'f2field->'f3field->('f1*'f2*'f3)encodingvalobj4:'f1field->'f2field->'f3field->'f4field->('f1*'f2*'f3*'f4)encodingvalobj5:'f1field->'f2field->'f3field->'f4field->'f5field->('f1*'f2*'f3*'f4*'f5)encodingvalobj6:'f1field->'f2field->'f3field->'f4field->'f5field->'f6field->('f1*'f2*'f3*'f4*'f5*'f6)encodingvalobj7:'f1field->'f2field->'f3field->'f4field->'f5field->'f6field->'f7field->('f1*'f2*'f3*'f4*'f5*'f6*'f7)encodingvalobj8:'f1field->'f2field->'f3field->'f4field->'f5field->'f6field->'f7field->'f8field->('f1*'f2*'f3*'f4*'f5*'f6*'f7*'f8)encodingvalobj9:'f1field->'f2field->'f3field->'f4field->'f5field->'f6field->'f7field->'f8field->'f9field->('f1*'f2*'f3*'f4*'f5*'f6*'f7*'f8*'f9)encodingvalobj10:'f1field->'f2field->'f3field->'f4field->'f5field->'f6field->'f7field->'f8field->'f9field->'f10field->('f1*'f2*'f3*'f4*'f5*'f6*'f7*'f8*'f9*'f10)encodingvaltup1:'f1encoding->'f1encodingvaltup2:'f1encoding->'f2encoding->('f1*'f2)encodingvaltup3:'f1encoding->'f2encoding->'f3encoding->('f1*'f2*'f3)encodingvaltup4:'f1encoding->'f2encoding->'f3encoding->'f4encoding->('f1*'f2*'f3*'f4)encodingvaltup5:'f1encoding->'f2encoding->'f3encoding->'f4encoding->'f5encoding->('f1*'f2*'f3*'f4*'f5)encodingvaltup6:'f1encoding->'f2encoding->'f3encoding->'f4encoding->'f5encoding->'f6encoding->('f1*'f2*'f3*'f4*'f5*'f6)encodingvaltup7:'f1encoding->'f2encoding->'f3encoding->'f4encoding->'f5encoding->'f6encoding->'f7encoding->('f1*'f2*'f3*'f4*'f5*'f6*'f7)encodingvaltup8:'f1encoding->'f2encoding->'f3encoding->'f4encoding->'f5encoding->'f6encoding->'f7encoding->'f8encoding->('f1*'f2*'f3*'f4*'f5*'f6*'f7*'f8)encodingvaltup9:'f1encoding->'f2encoding->'f3encoding->'f4encoding->'f5encoding->'f6encoding->'f7encoding->'f8encoding->'f9encoding->('f1*'f2*'f3*'f4*'f5*'f6*'f7*'f8*'f9)encodingvaltup10:'f1encoding->'f2encoding->'f3encoding->'f4encoding->'f5encoding->'f6encoding->'f7encoding->'f8encoding->'f9encoding->'f10encoding->('f1*'f2*'f3*'f4*'f5*'f6*'f7*'f8*'f9*'f10)encodingvalmerge_objs:'o1encoding->'o2encoding->('o1*'o2)encodingvalmerge_tups:'a1encoding->'a2encoding->('a1*'a2)encodingvalarray:?max_length:int->'aencoding->'aarrayencodingvallist:?max_length:int->'aencoding->'alistencodingvalassoc:'aencoding->(string*'a)listencodingtypecase_tag=Tagofint|Json_onlytype'tcasevalcase:title:string->?description:string->case_tag->'aencoding->('t->'aoption)->('a->'t)->'tcasevalunion:?tag_size:[`Uint8|`Uint16]->'tcaselist->'tencodingvaldef:string->?title:string->?description:string->'tencoding->'tencodingvalconv:('a->'b)->('b->'a)->?schema:json_schema->'bencoding->'aencodingvalmu:string->?title:string->?description:string->('aencoding->'aencoding)->'aencodingtype'alazy_tvallazy_encoding:'aencoding->'alazy_tencodingvalforce_decode:'alazy_t->'aoptionvalforce_bytes:'alazy_t->MBytes.tvalmake_lazy:'aencoding->'a->'alazy_tvalapply_lazy:fun_value:('a->'b)->fun_bytes:(MBytes.t->'b)->fun_combine:('b->'b->'b)->'alazy_t->'bmoduleJson:sigvalschema:?definitions_path:string->'aencoding->json_schemavalconstruct:'tencoding->'t->jsonvaldestruct:'tencoding->json->'t(** JSON Error *)typepath=path_itemlistandpath_item=[`Fieldofstring(** A field in an object. *)|`Indexofint(** An index in an array. *)|`Star(** Any / every field or index. *)|`Next(** The next element after an array. *)](** Exception raised by destructors, with the location in the original
JSON structure and the specific error. *)exceptionCannot_destructof(path*exn)(** Unexpected kind of data encountered (w/ the expectation). *)exceptionUnexpectedofstring*string(** Some {!union} couldn't be destructed, w/ the reasons for each {!type-case}. *)exceptionNo_case_matchedofexnlist(** Array of unexpected size encountered (w/ the expectation). *)exceptionBad_array_sizeofint*int(** Missing field in an object. *)exceptionMissing_fieldofstring(** Supernumerary field in an object. *)exceptionUnexpected_fieldofstringvalprint_error:?print_unknown:(Format.formatter->exn->unit)->Format.formatter->exn->unit(** Helpers for writing encoders. *)valcannot_destruct:('a,Format.formatter,unit,'b)format4->'avalwrap_error:('a->'b)->'a->'bvalpp:Format.formatter->json->unitendmoduleBinary:sigvallength:'aencoding->'a->intvalfixed_length:'aencoding->intoptionvalread:'aencoding->MBytes.t->int->int->(int*'a)optionvalwrite:'aencoding->'a->MBytes.t->int->int->intoptionvalto_bytes:'aencoding->'a->MBytes.toptionvalto_bytes_exn:'aencoding->'a->MBytes.tvalof_bytes:'aencoding->MBytes.t->'aoptiontypewrite_errorexceptionWrite_errorofwrite_errorend(** [check_size size encoding] ensures that the binary encoding
of a value will not be allowed to exceed [size] bytes. The reader
and the writer fails otherwise. This function do not modify
the JSON encoding. *)valcheck_size:int->'aencoding->'aencodingend# 32 "v0.in.ml"moduleError_monad:sig# 1 "v0/error_monad.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)(** Tezos Protocol Implementation - Error Monad *)(** {2 Error classification} *)(** Categories of error *)typeerror_category=[`Branch(** Errors that may not happen in another context *)|`Temporary(** Errors that may not happen in a later context *)|`Permanent(** Errors that will happen no matter the context *)](** Custom error handling for economic protocols. *)typeerror=..valpp:Format.formatter->error->unit(** A JSON error serializer *)valerror_encoding:errorData_encoding.tvaljson_of_error:error->Data_encoding.jsonvalerror_of_json:Data_encoding.json->error(** Error information *)typeerror_info={category:error_category;id:string;title:string;description:string;schema:Data_encoding.json_schema;}valpp_info:Format.formatter->error_info->unit(** Retrieves information of registered errors *)valget_registered_errors:unit->error_infolist(** For other modules to register specialized error serializers *)valregister_error_kind:error_category->id:string->title:string->description:string->?pp:(Format.formatter->'err->unit)->'errData_encoding.t->(error->'erroption)->('err->error)->unit(** Classify an error using the registered kinds *)valclassify_errors:errorlist->error_category(** {2 Monad definition} *)(** The error monad wrapper type, the error case holds a stack of
error, initialized by the first call to {!fail} and completed by
each call to {!trace} as the stack is rewound. The most general
error is thus at the top of the error stack, going down to the
specific error that actually caused the failure. *)type'atzresult=('a,errorlist)result(** A JSON serializer for result of a given type *)valresult_encoding:'aData_encoding.t->'atzresultData_encoding.encoding(** Successful result *)valok:'a->'atzresult(** Successful return *)valreturn:'a->'atzresultLwt.t(** Successful return of [()] *)valreturn_unit:unittzresultLwt.t(** Successful return of [None] *)valreturn_none:'aoptiontzresultLwt.t(** [return_some x] is a successful return of [Some x] *)valreturn_some:'a->'aoptiontzresultLwt.t(** Successful return of [[]] *)valreturn_nil:'alisttzresultLwt.t(** Successful return of [true] *)valreturn_true:booltzresultLwt.t(** Successful return of [false] *)valreturn_false:booltzresultLwt.t(** Erroneous result *)valerror:error->'atzresult(** Erroneous return *)valfail:error->'atzresultLwt.t(** Non-Lwt bind operator *)val(>>?):'atzresult->('a->'btzresult)->'btzresult(** Bind operator *)val(>>=?):'atzresultLwt.t->('a->'btzresultLwt.t)->'btzresultLwt.t(** Lwt's bind reexported *)val(>>=):'aLwt.t->('a->'bLwt.t)->'bLwt.tval(>|=):'aLwt.t->('a->'b)->'bLwt.t(** To operator *)val(>>|?):'atzresultLwt.t->('a->'b)->'btzresultLwt.t(** Non-Lwt to operator *)val(>|?):'atzresult->('a->'b)->'btzresult(** Enrich an error report (or do nothing on a successful result) manually *)valrecord_trace:error->'atzresult->'atzresult(** Automatically enrich error reporting on stack rewind *)valtrace:error->'btzresultLwt.t->'btzresultLwt.t(** Same as record_trace, for unevaluated error *)valrecord_trace_eval:(unit->errortzresult)->'atzresult->'atzresult(** Same as trace, for unevaluated Lwt error *)valtrace_eval:(unit->errortzresultLwt.t)->'btzresultLwt.t->'btzresultLwt.t(** Erroneous return on failed assertion *)valfail_unless:bool->error->unittzresultLwt.t(** Erroneous return on successful assertion *)valfail_when:bool->error->unittzresultLwt.t(** {2 In-monad list iterators} *)(** A {!List.iter} in the monad *)valiter_s:('a->unittzresultLwt.t)->'alist->unittzresultLwt.tvaliter_p:('a->unittzresultLwt.t)->'alist->unittzresultLwt.t(** A {!List.map} in the monad *)valmap_s:('a->'btzresultLwt.t)->'alist->'blisttzresultLwt.tvalmap_p:('a->'btzresultLwt.t)->'alist->'blisttzresultLwt.t(** A {!List.map2} in the monad *)valmap2:('a->'b->'ctzresult)->'alist->'blist->'clisttzresult(** A {!List.map2} in the monad *)valmap2_s:('a->'b->'ctzresultLwt.t)->'alist->'blist->'clisttzresultLwt.t(** A {!List.filter_map} in the monad *)valfilter_map_s:('a->'boptiontzresultLwt.t)->'alist->'blisttzresultLwt.t(** A {!List.fold_left} in the monad *)valfold_left_s:('a->'b->'atzresultLwt.t)->'a->'blist->'atzresultLwt.t(** A {!List.fold_right} in the monad *)valfold_right_s:('a->'b->'btzresultLwt.t)->'alist->'b->'btzresultLwt.t(**/**)typeshell_errortype'ashell_tzresult=('a,shell_errorlist)resultend# 34 "v0.in.ml"openError_monadmoduleLogging:sig# 1 "v0/logging.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)valdebug:('a,Format.formatter,unit,unit)format4->'avallog_info:('a,Format.formatter,unit,unit)format4->'avallog_notice:('a,Format.formatter,unit,unit)format4->'avalwarn:('a,Format.formatter,unit,unit)format4->'avallog_error:('a,Format.formatter,unit,unit)format4->'avalfatal_error:('a,Format.formatter,unit,unit)format4->'avallwt_debug:('a,Format.formatter,unit,unitLwt.t)format4->'avallwt_log_info:('a,Format.formatter,unit,unitLwt.t)format4->'avallwt_log_notice:('a,Format.formatter,unit,unitLwt.t)format4->'avallwt_warn:('a,Format.formatter,unit,unitLwt.t)format4->'avallwt_log_error:('a,Format.formatter,unit,unitLwt.t)format4->'aend# 38 "v0.in.ml"moduleTime:sig# 1 "v0/time.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)typetincludeCompare.Swithtypet:=tvaladd:t->int64->tvaldiff:t->t->int64valof_seconds:int64->tvalto_seconds:t->int64valof_notation:string->toptionvalof_notation_exn:string->tvalto_notation:t->stringvalencoding:tData_encoding.tvalrfc_encoding:tData_encoding.tvalpp_hum:Format.formatter->t->unitend# 40 "v0.in.ml"moduleOption:sig# 1 "v0/option.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)valmap:f:('a->'b)->'aoption->'boptionvalapply:f:('a->'boption)->'aoption->'boptionvaliter:f:('a->unit)->'aoption->unitvalunopt:default:'a->'aoption->'avalunopt_map:f:('a->'b)->default:'b->'aoption->'bvalfirst_some:'aoption->'aoption->'aoptionvaltry_with:(unit->'a)->'aoptionvalsome:'a->'aoptionend# 42 "v0.in.ml"moduleRPC_arg:sig# 1 "v0/RPC_arg.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)type'attype'aarg='atvalmake:?descr:string->name:string->destruct:(string->('a,string)result)->construct:('a->string)->unit->'aargtypedescr={name:string;descr:stringoption}valdescr:'aarg->descrvalint:intargvalint32:int32argvalint64:int64argvalfloat:floatargvalstring:stringargvallike:'aarg->?descr:string->string->'aargtype('a,'b)eq=Eq:('a,'a)eqvaleq:'aarg->'barg->('a,'b)eqoptionend# 44 "v0.in.ml"moduleRPC_path:sig# 1 "v0/RPC_path.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)type('prefix,'params)ttype('prefix,'params)path=('prefix,'params)ttype'prefixcontext=('prefix,'prefix)pathvalroot:unitcontextvalopen_root:'acontextvaladd_suffix:('prefix,'params)path->string->('prefix,'params)pathval(/):('prefix,'params)path->string->('prefix,'params)pathvaladd_arg:('prefix,'params)path->'aRPC_arg.t->('prefix,'params*'a)pathval(/:):('prefix,'params)path->'aRPC_arg.t->('prefix,'params*'a)pathvaladd_final_args:('prefix,'params)path->'aRPC_arg.t->('prefix,'params*'alist)pathval(/:*):('prefix,'params)path->'aRPC_arg.t->('prefix,'params*'alist)pathend# 46 "v0.in.ml"moduleRPC_query:sig# 1 "v0/RPC_query.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)type'attype'aquery='atvalempty:unitquerytype('a,'b)fieldvalfield:?descr:string->string->'aRPC_arg.t->'a->('b->'a)->('b,'a)fieldvalopt_field:?descr:string->string->'aRPC_arg.t->('b->'aoption)->('b,'aoption)fieldvalflag:?descr:string->string->('b->bool)->('b,bool)fieldvalmulti_field:?descr:string->string->'aRPC_arg.t->('b->'alist)->('b,'alist)fieldtype('a,'b,'c)open_queryvalquery:'b->('a,'b,'b)open_queryval(|+):('a,'b,'c->'d)open_query->('a,'c)field->('a,'b,'d)open_queryvalseal:('a,'b,'a)open_query->'attypeuntyped=(string*string)listexceptionInvalidofstringvalparse:'aquery->untyped->'aend# 48 "v0.in.ml"moduleRPC_service:sig# 1 "v0/RPC_service.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)(** HTTP methods. *)typemeth=[`GET|`POST|`DELETE|`PUT|`PATCH]type(+'meth,'prefix,'params,'query,'input,'output)tconstraint'meth=[<meth]type(+'meth,'prefix,'params,'query,'input,'output)service=('meth,'prefix,'params,'query,'input,'output)tvalget_service:?description:string->query:'queryRPC_query.t->output:'outputData_encoding.t->('prefix,'params)RPC_path.t->([`GET],'prefix,'params,'query,unit,'output)servicevalpost_service:?description:string->query:'queryRPC_query.t->input:'inputData_encoding.t->output:'outputData_encoding.t->('prefix,'params)RPC_path.t->([`POST],'prefix,'params,'query,'input,'output)servicevaldelete_service:?description:string->query:'queryRPC_query.t->output:'outputData_encoding.t->('prefix,'params)RPC_path.t->([`DELETE],'prefix,'params,'query,unit,'output)servicevalpatch_service:?description:string->query:'queryRPC_query.t->input:'inputData_encoding.t->output:'outputData_encoding.t->('prefix,'params)RPC_path.t->([`PATCH],'prefix,'params,'query,'input,'output)servicevalput_service:?description:string->query:'queryRPC_query.t->input:'inputData_encoding.t->output:'outputData_encoding.t->('prefix,'params)RPC_path.t->([`PUT],'prefix,'params,'query,'input,'output)serviceend# 50 "v0.in.ml"moduleRPC_answer:sig# 1 "v0/RPC_answer.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)(** Return type for service handler *)type'ot=[`Okof'o(* 200 *)|`OkStreamof'ostream(* 200 *)|`Createdofstringoption(* 201 *)|`No_content(* 204 *)|`Unauthorizedoferrorlistoption(* 401 *)|`Forbiddenoferrorlistoption(* 403 *)|`Not_foundoferrorlistoption(* 404 *)|`Conflictoferrorlistoption(* 409 *)|`Erroroferrorlistoption(* 500 *)]and'astream={next:unit->'aoptionLwt.t;shutdown:unit->unit}valreturn:'o->'otLwt.tvalreturn_stream:'ostream->'otLwt.tvalnot_found:'otLwt.tvalfail:errorlist->'atLwt.tend# 52 "v0.in.ml"moduleRPC_directory:sig# 1 "v0/RPC_directory.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)(** Dispatch tree *)type'prefixttype'prefixdirectory='prefixt(** Empty list of dispatch trees *)valempty:'prefixdirectoryvalmap:('a->'bLwt.t)->'bdirectory->'adirectoryvalprefix:('pr,'p)RPC_path.path->'pdirectory->'prdirectoryvalmerge:'adirectory->'adirectory->'adirectory(** Possible error while registering services. *)typestep=|Staticofstring|DynamicofRPC_arg.descr|DynamicTailofRPC_arg.descrtypeconflict=|CServiceofRPC_service.meth|CDir|CBuilder|CTail|CTypesofRPC_arg.descr*RPC_arg.descr|CTypeofRPC_arg.descr*stringlistexceptionConflictofsteplist*conflict(** Registering handler in service tree. *)valregister:'prefixdirectory->('meth,'prefix,'params,'query,'input,'output)RPC_service.t->('params->'query->'input->'outputtzresultLwt.t)->'prefixdirectoryvalopt_register:'prefixdirectory->('meth,'prefix,'params,'query,'input,'output)RPC_service.t->('params->'query->'input->'outputoptiontzresultLwt.t)->'prefixdirectoryvalgen_register:'prefixdirectory->('meth,'prefix,'params,'query,'input,'output)RPC_service.t->('params->'query->'input->[<'outputRPC_answer.t]Lwt.t)->'prefixdirectoryvallwt_register:'prefixdirectory->('meth,'prefix,'params,'query,'input,'output)RPC_service.t->('params->'query->'input->'outputLwt.t)->'prefixdirectory(** Registering handler in service tree. Curryfied variant. *)valregister0:unitdirectory->('m,unit,unit,'q,'i,'o)RPC_service.t->('q->'i->'otzresultLwt.t)->unitdirectoryvalregister1:'prefixdirectory->('m,'prefix,unit*'a,'q,'i,'o)RPC_service.t->('a->'q->'i->'otzresultLwt.t)->'prefixdirectoryvalregister2:'prefixdirectory->('m,'prefix,(unit*'a)*'b,'q,'i,'o)RPC_service.t->('a->'b->'q->'i->'otzresultLwt.t)->'prefixdirectoryvalregister3:'prefixdirectory->('m,'prefix,((unit*'a)*'b)*'c,'q,'i,'o)RPC_service.t->('a->'b->'c->'q->'i->'otzresultLwt.t)->'prefixdirectoryvalregister4:'prefixdirectory->('m,'prefix,(((unit*'a)*'b)*'c)*'d,'q,'i,'o)RPC_service.t->('a->'b->'c->'d->'q->'i->'otzresultLwt.t)->'prefixdirectoryvalregister5:'prefixdirectory->('m,'prefix,((((unit*'a)*'b)*'c)*'d)*'e,'q,'i,'o)RPC_service.t->('a->'b->'c->'d->'e->'q->'i->'otzresultLwt.t)->'prefixdirectoryvalopt_register0:unitdirectory->('m,unit,unit,'q,'i,'o)RPC_service.t->('q->'i->'ooptiontzresultLwt.t)->unitdirectoryvalopt_register1:'prefixdirectory->('m,'prefix,unit*'a,'q,'i,'o)RPC_service.t->('a->'q->'i->'ooptiontzresultLwt.t)->'prefixdirectoryvalopt_register2:'prefixdirectory->('m,'prefix,(unit*'a)*'b,'q,'i,'o)RPC_service.t->('a->'b->'q->'i->'ooptiontzresultLwt.t)->'prefixdirectoryvalopt_register3:'prefixdirectory->('m,'prefix,((unit*'a)*'b)*'c,'q,'i,'o)RPC_service.t->('a->'b->'c->'q->'i->'ooptiontzresultLwt.t)->'prefixdirectoryvalopt_register4:'prefixdirectory->('m,'prefix,(((unit*'a)*'b)*'c)*'d,'q,'i,'o)RPC_service.t->('a->'b->'c->'d->'q->'i->'ooptiontzresultLwt.t)->'prefixdirectoryvalopt_register5:'prefixdirectory->('m,'prefix,((((unit*'a)*'b)*'c)*'d)*'e,'q,'i,'o)RPC_service.t->('a->'b->'c->'d->'e->'q->'i->'ooptiontzresultLwt.t)->'prefixdirectoryvalgen_register0:unitdirectory->('m,unit,unit,'q,'i,'o)RPC_service.t->('q->'i->[<'oRPC_answer.t]Lwt.t)->unitdirectoryvalgen_register1:'prefixdirectory->('m,'prefix,unit*'a,'q,'i,'o)RPC_service.t->('a->'q->'i->[<'oRPC_answer.t]Lwt.t)->'prefixdirectoryvalgen_register2:'prefixdirectory->('m,'prefix,(unit*'a)*'b,'q,'i,'o)RPC_service.t->('a->'b->'q->'i->[<'oRPC_answer.t]Lwt.t)->'prefixdirectoryvalgen_register3:'prefixdirectory->('m,'prefix,((unit*'a)*'b)*'c,'q,'i,'o)RPC_service.t->('a->'b->'c->'q->'i->[<'oRPC_answer.t]Lwt.t)->'prefixdirectoryvalgen_register4:'prefixdirectory->('m,'prefix,(((unit*'a)*'b)*'c)*'d,'q,'i,'o)RPC_service.t->('a->'b->'c->'d->'q->'i->[<'oRPC_answer.t]Lwt.t)->'prefixdirectoryvalgen_register5:'prefixdirectory->('m,'prefix,((((unit*'a)*'b)*'c)*'d)*'e,'q,'i,'o)RPC_service.t->('a->'b->'c->'d->'e->'q->'i->[<'oRPC_answer.t]Lwt.t)->'prefixdirectoryvallwt_register0:unitdirectory->('m,unit,unit,'q,'i,'o)RPC_service.t->('q->'i->'oLwt.t)->unitdirectoryvallwt_register1:'prefixdirectory->('m,'prefix,unit*'a,'q,'i,'o)RPC_service.t->('a->'q->'i->'oLwt.t)->'prefixdirectoryvallwt_register2:'prefixdirectory->('m,'prefix,(unit*'a)*'b,'q,'i,'o)RPC_service.t->('a->'b->'q->'i->'oLwt.t)->'prefixdirectoryvallwt_register3:'prefixdirectory->('m,'prefix,((unit*'a)*'b)*'c,'q,'i,'o)RPC_service.t->('a->'b->'c->'q->'i->'oLwt.t)->'prefixdirectoryvallwt_register4:'prefixdirectory->('m,'prefix,(((unit*'a)*'b)*'c)*'d,'q,'i,'o)RPC_service.t->('a->'b->'c->'d->'q->'i->'oLwt.t)->'prefixdirectoryvallwt_register5:'prefixdirectory->('m,'prefix,((((unit*'a)*'b)*'c)*'d)*'e,'q,'i,'o)RPC_service.t->('a->'b->'c->'d->'e->'q->'i->'oLwt.t)->'prefixdirectory(** Registering dynamic subtree. *)valregister_dynamic_directory:?descr:string->'prefixdirectory->('prefix,'a)RPC_path.t->('a->'adirectoryLwt.t)->'prefixdirectoryend# 54 "v0.in.ml"moduleBase58:sig# 1 "v0/base58.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)type'aencodingvalsimple_decode:'aencoding->string->'aoptionvalsimple_encode:'aencoding->'a->stringtypedata=..valregister_encoding:prefix:string->length:int->to_raw:('a->string)->of_raw:(string->'aoption)->wrap:('a->data)->'aencodingvalcheck_encoded_prefix:'aencoding->string->int->unitvaldecode:string->dataoptionend# 56 "v0.in.ml"moduleS:sig# 1 "v0/s.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)(** Generic interface for a datatype with comparison, pretty-printer
and serialization functions. *)moduletypeT=sigtypetincludeCompare.Swithtypet:=tvalpp:Format.formatter->t->unitvalencoding:tData_encoding.tvalto_bytes:t->MBytes.tvalof_bytes:MBytes.t->toptionend(** Generic interface for a datatype with comparison, pretty-printer,
serialization functions and a hashing function. *)moduletypeHASHABLE=sigincludeTtypehashvalhash:t->hashvalhash_raw:MBytes.t->hashend(** {2 Hash Types} *)(** The signature of an abstract hash type, as produced by functor
{!Make_SHA256}. The {!t} type is abstracted for separating the
various kinds of hashes in the system at typing time. Each type is
equipped with functions to use it as is of as keys in the database
or in memory sets and maps. *)moduletypeMINIMAL_HASH=sigtypetvalname:stringvaltitle:stringvalpp:Format.formatter->t->unitvalpp_short:Format.formatter->t->unitincludeCompare.Swithtypet:=tvalhash_bytes:?key:MBytes.t->MBytes.tlist->tvalhash_string:?key:string->stringlist->tvalzero:tendmoduletypeRAW_DATA=sigtypetvalsize:int(* in bytes *)valto_bytes:t->MBytes.tvalof_bytes_opt:MBytes.t->toptionvalof_bytes_exn:MBytes.t->tendmoduletypeB58_DATA=sigtypetvalto_b58check:t->stringvalto_short_b58check:t->stringvalof_b58check_exn:string->tvalof_b58check_opt:string->toptiontypeBase58.data+=Dataoftvalb58check_encoding:tBase58.encodingendmoduletypeENCODER=sigtypetvalencoding:tData_encoding.tvalrpc_arg:tRPC_arg.tendmoduletypeSET=sigtypeelttypetvalempty:tvalis_empty:t->boolvalmem:elt->t->boolvaladd:elt->t->tvalsingleton:elt->tvalremove:elt->t->tvalunion:t->t->tvalinter:t->t->tvaldiff:t->t->tvalcompare:t->t->intvalequal:t->t->boolvalsubset:t->t->boolvaliter:(elt->unit)->t->unitvalmap:(elt->elt)->t->tvalfold:(elt->'a->'a)->t->'a->'avalfor_all:(elt->bool)->t->boolvalexists:(elt->bool)->t->boolvalfilter:(elt->bool)->t->tvalpartition:(elt->bool)->t->t*tvalcardinal:t->intvalelements:t->eltlistvalmin_elt_opt:t->eltoptionvalmax_elt_opt:t->eltoptionvalchoose_opt:t->eltoptionvalsplit:elt->t->t*bool*tvalfind_opt:elt->t->eltoptionvalfind_first_opt:(elt->bool)->t->eltoptionvalfind_last_opt:(elt->bool)->t->eltoptionvalof_list:eltlist->tendmoduletypeMAP=sigtypekeytype+'atvalempty:'atvalis_empty:'at->boolvalmem:key->'at->boolvaladd:key->'a->'at->'atvalupdate:key->('aoption->'aoption)->'at->'atvalsingleton:key->'a->'atvalremove:key->'at->'atvalmerge:(key->'aoption->'boption->'coption)->'at->'bt->'ctvalunion:(key->'a->'a->'aoption)->'at->'at->'atvalcompare:('a->'a->int)->'at->'at->intvalequal:('a->'a->bool)->'at->'at->boolvaliter:(key->'a->unit)->'at->unitvalfold:(key->'a->'b->'b)->'at->'b->'bvalfor_all:(key->'a->bool)->'at->boolvalexists:(key->'a->bool)->'at->boolvalfilter:(key->'a->bool)->'at->'atvalpartition:(key->'a->bool)->'at->'at*'atvalcardinal:'at->intvalbindings:'at->(key*'a)listvalmin_binding_opt:'at->(key*'a)optionvalmax_binding_opt:'at->(key*'a)optionvalchoose_opt:'at->(key*'a)optionvalsplit:key->'at->'at*'aoption*'atvalfind_opt:key->'at->'aoptionvalfind_first_opt:(key->bool)->'at->(key*'a)optionvalfind_last_opt:(key->bool)->'at->(key*'a)optionvalmap:('a->'b)->'at->'btvalmapi:(key->'a->'b)->'at->'btendmoduletypeINDEXES=sigtypetvalto_path:t->stringlist->stringlistvalof_path:stringlist->toptionvalof_path_exn:stringlist->tvalprefix_path:string->stringlistvalpath_length:intmoduleSet:sigincludeSETwithtypeelt=tvalencoding:tData_encoding.tendmoduleMap:sigincludeMAPwithtypekey=tvalencoding:'aData_encoding.t->'atData_encoding.tendendmoduletypeHASH=sigincludeMINIMAL_HASHincludeRAW_DATAwithtypet:=tincludeB58_DATAwithtypet:=tincludeENCODERwithtypet:=tincludeINDEXESwithtypet:=tendmoduletypeMERKLE_TREE=sigtypeeltincludeHASHvalcompute:eltlist->tvalempty:ttypepath=Leftofpath*t|Rightoft*path|Opvalcompute_path:eltlist->int->pathvalcheck_path:path->elt->t*intvalpath_encoding:pathData_encoding.tendmoduletypeSIGNATURE=sigmodulePublic_key_hash:sigtypetvalpp:Format.formatter->t->unitvalpp_short:Format.formatter->t->unitincludeCompare.Swithtypet:=tincludeRAW_DATAwithtypet:=tincludeB58_DATAwithtypet:=tincludeENCODERwithtypet:=tincludeINDEXESwithtypet:=tvalzero:tendmodulePublic_key:sigtypetvalpp:Format.formatter->t->unitincludeCompare.Swithtypet:=tincludeB58_DATAwithtypet:=tincludeENCODERwithtypet:=tvalhash:t->Public_key_hash.tendtypetvalpp:Format.formatter->t->unitincludeRAW_DATAwithtypet:=tincludeCompare.Swithtypet:=tincludeB58_DATAwithtypet:=tincludeENCODERwithtypet:=tvalzero:ttypewatermark(** Check a signature *)valcheck:?watermark:watermark->Public_key.t->t->MBytes.t->boolendend# 58 "v0.in.ml"moduleSet:sig# 1 "v0/set.mli"(**************************************************************************)(* *)(* OCaml *)(* *)(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)(* *)(* Copyright 1996 Institut National de Recherche en Informatique et *)(* en Automatique. *)(* *)(* All rights reserved. This file is distributed under the terms of *)(* the GNU Lesser General Public License version 2.1, with the *)(* special exception on linking described in the file LICENSE. *)(* *)(**************************************************************************)(** Sets over ordered types.
This module implements the set data structure, given a total ordering
function over the set elements. All operations over sets
are purely applicative (no side-effects).
The implementation uses balanced binary trees, and is therefore
reasonably efficient: insertion and membership take time
logarithmic in the size of the set, for instance.
The {!Make} functor constructs implementations for any type, given a
[compare] function.
For instance:
{[
module IntPairs =
struct
type t = int * int
let compare (x0,y0) (x1,y1) =
match Stdlib.compare x0 x1 with
0 -> Stdlib.compare y0 y1
| c -> c
end
module PairsSet = Set.Make(IntPairs)
let m = PairsSet.(empty |> add (2,3) |> add (5,7) |> add (11,13))
]}
This creates a new module [PairsSet], with a new type [PairsSet.t]
of sets of [int * int].
*)(** Input signature of the functor {!Set.Make}. *)moduletypeOrderedType=sig(** The type of the set elements. *)typet(** A total ordering function over the set elements.
This is a two-argument function [f] such that
[f e1 e2] is zero if the elements [e1] and [e2] are equal,
[f e1 e2] is strictly negative if [e1] is smaller than [e2],
and [f e1 e2] is strictly positive if [e1] is greater than [e2].
Example: a suitable ordering function is the generic structural
comparison function {!Stdlib.compare}. *)valcompare:t->t->intend(** Functor building an implementation of the set structure
given a totally ordered type. *)moduleMake(Ord:OrderedType):S.SETwithtypeelt=Ord.tend# 60 "v0.in.ml"moduleMap:sig# 1 "v0/map.mli"(**************************************************************************)(* *)(* OCaml *)(* *)(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)(* *)(* Copyright 1996 Institut National de Recherche en Informatique et *)(* en Automatique. *)(* *)(* All rights reserved. This file is distributed under the terms of *)(* the GNU Lesser General Public License version 2.1, with the *)(* special exception on linking described in the file LICENSE. *)(* *)(**************************************************************************)(** Association tables over ordered types.
This module implements applicative association tables, also known as
finite maps or dictionaries, given a total ordering function
over the keys.
All operations over maps are purely applicative (no side-effects).
The implementation uses balanced binary trees, and therefore searching
and insertion take time logarithmic in the size of the map.
For instance:
{[
module IntPairs =
struct
type t = int * int
let compare (x0,y0) (x1,y1) =
match Stdlib.compare x0 x1 with
0 -> Stdlib.compare y0 y1
| c -> c
end
module PairsMap = Map.Make(IntPairs)
let m = PairsMap.(empty |> add (0,1) "hello" |> add (1,0) "world")
]}
This creates a new module [PairsMap], with a new type ['a PairsMap.t]
of maps from [int * int] to ['a]. In this example, [m] contains [string]
values so its type is [string PairsMap.t].
*)(** Input signature of the functor {!Map.Make}. *)moduletypeOrderedType=sig(** The type of the map keys. *)typet(** A total ordering function over the keys.
This is a two-argument function [f] such that
[f e1 e2] is zero if the keys [e1] and [e2] are equal,
[f e1 e2] is strictly negative if [e1] is smaller than [e2],
and [f e1 e2] is strictly positive if [e1] is greater than [e2].
Example: a suitable ordering function is the generic structural
comparison function {!Stdlib.compare}. *)valcompare:t->t->intend(** Functor building an implementation of the map structure
given a totally ordered type. *)moduleMake(Ord:OrderedType):S.MAPwithtypekey=Ord.tend# 62 "v0.in.ml"moduleBlake2B:sig# 1 "v0/blake2B.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)(** Builds a new Hash type using Blake2B. *)(** The parameters for creating a new Hash type using
{!Make_Blake2B}. Both {!name} and {!title} are only informative,
used in error messages and serializers. *)moduletypeName=sigvalname:stringvaltitle:stringvalsize:intoptionendmoduletypePrefixedName=sigincludeNamevalb58check_prefix:stringendmoduleMake_minimal(Name:Name):S.MINIMAL_HASHmoduleMake(Register:sigvalregister_encoding:prefix:string->length:int->to_raw:('a->string)->of_raw:(string->'aoption)->wrap:('a->Base58.data)->'aBase58.encodingend)(Name:PrefixedName):S.HASHend# 64 "v0.in.ml"moduleEd25519:sig# 1 "v0/ed25519.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)(** Tezos - Ed25519 cryptography *)includeS.SIGNATUREwithtypewatermark:=MBytes.tend# 66 "v0.in.ml"moduleSecp256k1:sig# 1 "v0/secp256k1.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)(** Tezos - Secp256k1 cryptography *)includeS.SIGNATUREwithtypewatermark:=MBytes.tend# 68 "v0.in.ml"moduleP256:sig# 1 "v0/p256.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)(** Tezos - P256 cryptography *)includeS.SIGNATUREwithtypewatermark:=MBytes.tend# 70 "v0.in.ml"moduleChain_id:sig# 1 "v0/chain_id.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)includeS.HASHend# 72 "v0.in.ml"moduleSignature:sig# 1 "v0/signature.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)typepublic_key_hash=|Ed25519ofEd25519.Public_key_hash.t|Secp256k1ofSecp256k1.Public_key_hash.t|P256ofP256.Public_key_hash.ttypepublic_key=|Ed25519ofEd25519.Public_key.t|Secp256k1ofSecp256k1.Public_key.t|P256ofP256.Public_key.ttypewatermark=|Block_headerofChain_id.t|EndorsementofChain_id.t|Generic_operation|CustomofMBytes.tincludeS.SIGNATUREwithtypePublic_key_hash.t=public_key_hashandtypePublic_key.t=public_keyandtypewatermark:=watermarkend# 74 "v0.in.ml"moduleBlock_hash:sig# 1 "v0/block_hash.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)(** Blocks hashes / IDs. *)includeS.HASHend# 76 "v0.in.ml"moduleOperation_hash:sig# 1 "v0/operation_hash.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)(** Operations hashes / IDs. *)includeS.HASHend# 78 "v0.in.ml"moduleOperation_list_hash:sig# 1 "v0/operation_list_hash.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)(** Blocks hashes / IDs. *)includeS.MERKLE_TREEwithtypeelt=Operation_hash.tend# 80 "v0.in.ml"moduleOperation_list_list_hash:sig# 1 "v0/operation_list_list_hash.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)(** Blocks hashes / IDs. *)includeS.MERKLE_TREEwithtypeelt=Operation_list_hash.tend# 82 "v0.in.ml"moduleProtocol_hash:sig# 1 "v0/protocol_hash.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)(** Protocol hashes / IDs. *)includeS.HASHend# 84 "v0.in.ml"moduleContext_hash:sig# 1 "v0/context_hash.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)(** Committed context hashes / IDs. *)includeS.HASHend# 86 "v0.in.ml"moduleMicheline:sig# 1 "v0/micheline.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)typeannot=stringlisttype('l,'p)node=|Intof'l*Z.t|Stringof'l*string|Bytesof'l*MBytes.t|Primof'l*'p*('l,'p)nodelist*annot|Seqof'l*('l,'p)nodelisttype'pcanonicaltypecanonical_location=intvalroot:'pcanonical->(canonical_location,'p)nodevalcanonical_location_encoding:canonical_locationData_encoding.encodingvalcanonical_encoding:variant:string->'lData_encoding.encoding->'lcanonicalData_encoding.encodingvalcanonical_encoding_v1:variant:string->'lData_encoding.encoding->'lcanonicalData_encoding.encoding(*
val erased_encoding : variant:string -> 'l -> 'p Data_encoding.encoding -> ('l, 'p) node Data_encoding.encoding
val table_encoding : variant:string -> 'l Data_encoding.encoding -> 'p Data_encoding.encoding -> ('l, 'p) node Data_encoding.encoding
*)vallocation:('l,'p)node->'lvalannotations:('l,'p)node->stringlistvalstrip_locations:(_,'p)node->'pcanonicalvalextract_locations:('l,'p)node->'pcanonical*(canonical_location*'l)listvalinject_locations:(canonical_location->'l)->'pcanonical->('l,'p)nodeend# 88 "v0.in.ml"moduleBlock_header:sig# 1 "v0/block_header.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)typeshell_header={level:Int32.t;(** The number of preceding block in this chain, i.e. the genesis
has level 0. *)proto_level:int;(** The number of preceding protocol change in the chain (modulo 256),
i.e. the genesis has proto_level 0. *)predecessor:Block_hash.t;timestamp:Time.t;validation_passes:int;operations_hash:Operation_list_list_hash.t;fitness:MBytes.tlist;context:Context_hash.t;}valshell_header_encoding:shell_headerData_encoding.ttypet={shell:shell_header;protocol_data:MBytes.t}includeS.HASHABLEwithtypet:=tandtypehash:=Block_hash.tend# 90 "v0.in.ml"moduleFitness:sig# 1 "v0/fitness.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)(** The fitness of a block is defined as a list of bytes,
compared in a lexicographical order (longer list are greater). *)includeS.Twithtypet=MBytes.tlistend# 92 "v0.in.ml"moduleOperation:sig# 1 "v0/operation.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)(** Tezos operations. *)typeshell_header={branch:Block_hash.t;(** The operation is only valid in a branch containing the
block [branch]. *)}valshell_header_encoding:shell_headerData_encoding.ttypet={shell:shell_header;proto:MBytes.t}includeS.HASHABLEwithtypet:=tandtypehash:=Operation_hash.tend# 94 "v0.in.ml"moduleContext:sig# 1 "v0/context.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)(** View over the context store, restricted to types, access and
functional manipulation of an existing context. *)typet(** Keys in (kex x value) database implementations *)typekey=stringlist(** Values in (kex x value) database implementations *)typevalue=MBytes.tvalmem:t->key->boolLwt.tvaldir_mem:t->key->boolLwt.tvalget:t->key->valueoptionLwt.tvalset:t->key->value->tLwt.t(** [copy] returns None if the [from] key is not bound *)valcopy:t->from:key->to_:key->toptionLwt.tvaldel:t->key->tLwt.tvalremove_rec:t->key->tLwt.tvalfold:t->key->init:'a->f:([`Keyofkey|`Dirofkey]->'a->'aLwt.t)->'aLwt.tvalkeys:t->key->keylistLwt.tvalfold_keys:t->key->init:'a->f:(key->'a->'aLwt.t)->'aLwt.tvalregister_resolver:'aBase58.encoding->(t->string->'alistLwt.t)->unitvalcomplete:t->string->stringlistLwt.tend# 96 "v0.in.ml"moduleUpdater:sig# 1 "v0/updater.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)(** Tezos Protocol Environment - Protocol updater. *)(** Validation result: the record returned by the protocol
on the successful validation of a block. *)typevalidation_result={context:Context.t;(** The resulting context, it will be used for the next block. *)fitness:Fitness.t;(** The effective fitness of the block (to be compared with
the 'announced' one in the block header. *)message:stringoption;(** An optional informative message to be used as in the 'git
commit' of the block's context. *)max_operations_ttl:int;(** The "time-to-live" of operation for the next block: any
operations whose 'branch' is older than 'ttl' blocks in the
past cannot be included in the next block. *)last_allowed_fork_level:Int32.t;(** The level of the last block for which the node might consider an
alternate branch. The shell should consider as invalid any
branch whose fork point is older than the given level *)}typequota={max_size:int;(** The maximum size (in bytes) of the serialized list of
operations. *)max_op:intoption;(** The maximum number of operation.
[None] means no limit. *)}typerpc_context={block_hash:Block_hash.t;block_header:Block_header.shell_header;context:Context.t;}(** This is the signature of a Tezos protocol implementation. It has
access to the standard library and the Environment module. *)moduletypePROTOCOL=sig(** The maximum size of a block header in bytes. *)valmax_block_length:int(** The maximum size of an operation in bytes. *)valmax_operation_data_length:int(** The number of validation passes (length of the list) and the
operation's quota for each pass. *)valvalidation_passes:quotalist(** The version specific type of blocks. *)typeblock_header_data(** Encoding for version specific part of block headers. *)valblock_header_data_encoding:block_header_dataData_encoding.t(** A fully parsed block header. *)typeblock_header={shell:Block_header.shell_header;protocol_data:block_header_data;}(** Version-specific side information computed by the protocol
during the validation of a block. Should not include information
about the evaluation of operations which is handled separately by
{!operation_metadata}. To be used as an execution trace by tools
(client, indexer). Not necessary for validation. *)typeblock_header_metadata(** Encoding for version-specific block metadata. *)valblock_header_metadata_encoding:block_header_metadataData_encoding.t(** The version specific type of operations. *)typeoperation_data(** Version-specific side information computed by the protocol
during the validation of each operation, to be used conjointly
with {!block_header_metadata}. *)typeoperation_receipt(** A fully parsed operation. *)typeoperation={shell:Operation.shell_header;protocol_data:operation_data;}(** Encoding for version-specific operation data. *)valoperation_data_encoding:operation_dataData_encoding.t(** Encoding for version-specific operation receipts. *)valoperation_receipt_encoding:operation_receiptData_encoding.t(** Encoding that mixes an operation data and its receipt. *)valoperation_data_and_receipt_encoding:(operation_data*operation_receipt)Data_encoding.t(** The Validation passes in which an operation can appear.
For instance [[0]] if it only belongs to the first pass.
An answer of [[]] means that the operation is ill-formed
and cannot be included at all. *)valacceptable_passes:operation->intlist(** Basic ordering of operations. [compare_operations op1 op2] means
that [op1] should appear before [op2] in a block. *)valcompare_operations:operation->operation->int(** A functional state that is transmitted through the steps of a
block validation sequence. It must retain the current state of
the store (that can be extracted from the outside using
{!current_context}, and whose final value is produced by
{!finalize_block}). It can also contain the information that
must be remembered during the validation, which must be
immutable (as validator or baker implementations are allowed to
pause, replay or backtrack during the validation process). *)typevalidation_state(** Access the context at a given validation step. *)valcurrent_context:validation_state->Context.ttzresultLwt.t(** Checks that a block is well formed in a given context. This
function should run quickly, as its main use is to reject bad
blocks from the chain as early as possible. The input context
is the one resulting of an ancestor block of same protocol
version. This ancestor of the current head is guaranteed to be
more recent than `last_allowed_fork_level`.
The resulting `validation_state` will be used for multi-pass
validation. *)valbegin_partial_application:chain_id:Chain_id.t->ancestor_context:Context.t->predecessor_timestamp:Time.t->predecessor_fitness:Fitness.t->block_header->validation_statetzresultLwt.t(** The first step in a block validation sequence. Initializes a
validation context for validating a block. Takes as argument the
{!Block_header.t} to initialize the context for this block. The
function {!precheck_block} may not have been called before
[begin_application], so all the check performed by the former
must be repeated in the latter. *)valbegin_application:chain_id:Chain_id.t->predecessor_context:Context.t->predecessor_timestamp:Time.t->predecessor_fitness:Fitness.t->block_header->validation_statetzresultLwt.t(** Initializes a validation context for constructing a new block
(as opposed to validating an existing block). When the
[protocol_data] argument is specified, it should contains a
'prototype' of a the protocol specific part of a block header,
and the function should produce the exact same effect on the
context than would produce the validation of a block containing
an "equivalent" (but complete) header. For instance, if the
block header usually includes a signature, the header provided
to {!begin_construction} should includes a faked signature. *)valbegin_construction:chain_id:Chain_id.t->predecessor_context:Context.t->predecessor_timestamp:Time.t->predecessor_level:Int32.t->predecessor_fitness:Fitness.t->predecessor:Block_hash.t->timestamp:Time.t->?protocol_data:block_header_data->unit->validation_statetzresultLwt.t(** Called after {!begin_application} (or {!begin_construction}) and
before {!finalize_block}, with each operation in the block. *)valapply_operation:validation_state->operation->(validation_state*operation_receipt)tzresultLwt.t(** The last step in a block validation sequence. It produces the
context that will be used as input for the validation of its
successor block candidates. *)valfinalize_block:validation_state->(validation_result*block_header_metadata)tzresultLwt.t(** The list of remote procedures exported by this implementation *)valrpc_services:rpc_contextRPC_directory.t(** Initialize the context (or upgrade the context after a protocol
amendment). This function receives the context resulting of the
application of a block that triggered the amendment. It also
receives the header of the block that triggered the amendment. *)valinit:Context.t->Block_header.shell_header->validation_resulttzresultLwt.tend(** Activates a given protocol version from a given context. This
means that the context used for the next block will use this
version (this is not an immediate change). The version must have
been previously compiled successfully. *)valactivate:Context.t->Protocol_hash.t->Context.tLwt.t(** Fork a test chain. The forked chain will use the current block
as genesis, and [protocol] as economic protocol. The chain will
be destroyed when a (successor) block will have a timestamp greater
than [expiration]. The protocol must have been previously compiled
successfully. *)valfork_test_chain:Context.t->protocol:Protocol_hash.t->expiration:Time.t->Context.tLwt.tend# 98 "v0.in.ml"moduleRPC_context:sig# 1 "v0/RPC_context.mli"(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)typet=Updater.rpc_contextclasstype['pr]simple=objectmethodcall_proto_service0:'m'q'i'o.(([<RPC_service.meth]as'm),t,t,'q,'i,'o)RPC_service.t->'pr->'q->'i->'oError_monad.shell_tzresultLwt.tmethodcall_proto_service1:'m'a'q'i'o.(([<RPC_service.meth]as'm),t,t*'a,'q,'i,'o)RPC_service.t->'pr->'a->'q->'i->'oError_monad.shell_tzresultLwt.tmethodcall_proto_service2:'m'a'b'q'i'o.(([<RPC_service.meth]as'm),t,(t*'a)*'b,'q,'i,'o)RPC_service.t->'pr->'a->'b->'q->'i->'oError_monad.shell_tzresultLwt.tmethodcall_proto_service3:'m'a'b'c'q'i'o.(([<RPC_service.meth]as'm),t,((t*'a)*'b)*'c,'q,'i,'o)RPC_service.t->'pr->'a->'b->'c->'q->'i->'oError_monad.shell_tzresultLwt.tendvalmake_call0:([<RPC_service.meth],t,t,'q,'i,'o)RPC_service.t->'pr#simple->'pr->'q->'i->'oshell_tzresultLwt.tvalmake_call1:([<RPC_service.meth],t,t*'a,'q,'i,'o)RPC_service.t->'pr#simple->'pr->'a->'q->'i->'oshell_tzresultLwt.tvalmake_call2:([<RPC_service.meth],t,(t*'a)*'b,'q,'i,'o)RPC_service.t->'pr#simple->'pr->'a->'b->'q->'i->'oshell_tzresultLwt.tvalmake_call3:([<RPC_service.meth],t,((t*'a)*'b)*'c,'q,'i,'o)RPC_service.t->'pr#simple->'pr->'a->'b->'c->'q->'i->'oshell_tzresultLwt.tvalmake_opt_call0:([<RPC_service.meth],t,t,'q,'i,'o)RPC_service.t->'pr#simple->'pr->'q->'i->'ooptionshell_tzresultLwt.tvalmake_opt_call1:([<RPC_service.meth],t,t*'a,'q,'i,'o)RPC_service.t->'pr#simple->'pr->'a->'q->'i->'ooptionshell_tzresultLwt.tvalmake_opt_call2:([<RPC_service.meth],t,(t*'a)*'b,'q,'i,'o)RPC_service.t->'pr#simple->'pr->'a->'b->'q->'i->'ooptionshell_tzresultLwt.tvalmake_opt_call3:([<RPC_service.meth],t,((t*'a)*'b)*'c,'q,'i,'o)RPC_service.t->'pr#simple->'pr->'a->'b->'c->'q->'i->'ooptionshell_tzresultLwt.tend# 100 "v0.in.ml"end