As discussed, changed sed -i".orig" to sed -i.orig
apps/blockchain/*
My primary contributions to main branch.
util/Extra.sml
Added Haskell-like ListExtra.span to help with HTTP parser
Added StringExtra.crlfLines, akin to Haskell's lines, to help with HTTP parser.
Added StringExtra.escape in order to escape JSON strings, translating \ to \\ and " to \", to aid stringify-ing JSON.
Added/corrected a few commented type signatures
util/Http.sml
Parses and constructs HTTP requests/responses which is needed to communicate with the blockchain.
util/Json.sml
Removed fst and snd as these are already top-level CakeML functions. And no other code called Json.fst or Json.snd.
Changed print_json, getKeyword so that it (un)stringifies JSON booleans as the lowercase true and false.
Added lookup to lookup key-values in a JSON object by key. Needed by my blockchain tools to pull out values from JSON responses.
Added convertToString to produce a rather minimal stringified JSON. Not strictly necessary for me, but the blockchain doesn't need pretty printed strings.
Added utility functions for JSONs. Functions like Json.fromBoolean which take a CakeML boolean and return a Json.json datatype, Json.isBoolean which takes a Json.json datatype and returns true exactly when that JSON value is a boolean, and Json.toBoolean which converts a Json.json value into a bool option returning Some of a boolean exactly when the given JSON is the same boolean. These aren't necessary for me but thought they might be useful.
Added JSON walker jsonWalker to convert a JSON to an arbitrary value. Again, this isn't needed by me but may be useful.
Otherwise most of the changes are standardizing spacing/indentation, brining wildcards into case statements when possible, and slightly redefined functions like toList and toAList so they are explicitly functions of tuples instead of using case statements to break down a pair. Not necessary, cosmetic changes.
util/Misc.sml
Added lots of OCaml-like functionality to Result. Not necessary, but I thought they might be useful.
Changes:
sed -i".orig"
tosed -i.orig
ListExtra.span
to help with HTTP parserStringExtra.crlfLines
, akin to Haskell'slines
, to help with HTTP parser.StringExtra.escape
in order to escape JSON strings, translating\
to\\
and"
to\"
, to aid stringify-ing JSON.fst
andsnd
as these are already top-level CakeML functions. And no other code calledJson.fst
orJson.snd
.print_json
,getKeyword
so that it (un)stringifies JSON booleans as the lowercasetrue
andfalse
.lookup
to lookup key-values in a JSON object by key. Needed by my blockchain tools to pull out values from JSON responses.convertToString
to produce a rather minimal stringified JSON. Not strictly necessary for me, but the blockchain doesn't need pretty printed strings.Json.fromBoolean
which take a CakeML boolean and return aJson.json
datatype,Json.isBoolean
which takes aJson.json
datatype and returns true exactly when that JSON value is a boolean, andJson.toBoolean
which converts aJson.json
value into abool option
returningSome
of a boolean exactly when the given JSON is the same boolean. These aren't necessary for me but thought they might be useful.jsonWalker
to convert a JSON to an arbitrary value. Again, this isn't needed by me but may be useful.toList
andtoAList
so they are explicitly functions of tuples instead of using case statements to break down a pair. Not necessary, cosmetic changes.Result
. Not necessary, but I thought they might be useful.