Shadow stdlib with lwtreslib
Part 4 of !1872 (closed)
- It introduces a few compatibility modules for the protocol environment (using
structs/) so that the old protocol continues to use the legacy modules. - It shadows
Seq,Set,Map, andHashtbl(usingLwtreslibwithinlib_crypto, and usingBase'sTzPervasivesfor the rest). BecauseTzPervasivesis opened widely (as adunerule) this shadowing is widespread. - It then changes all the rest of the code to use the new shadowing modules. The main change is to call
finddirectly (instead offind_opt). Some more changes:- use
findwhich returns an option rather than relying onNot_foundfor control flow, - use the
{iter,fold,etc.}_{e,s,es,p,ep}directly rather than going through an intermediate list or folding over a promise
- use
The shadows are safe(r) versions (not raising exceptions) of existing modules and they provide traversors that are Lwt- and Error- aware. This makes for a safe, homogeneous coding experience over all the collections we use.
Edited by Raphaël Proust