~/bend-docscommunity

Json.bend checks

raw source on the hub · import hhefesto-json@1.0.0.0/Json.bend as Json

1 import
import Base

Types

type js.D source · line 24 · raw

Data

A decimal digit

type js.Exp source · line 37 · raw

Data

an exponent: none, or its sign and digits (one at least)

type js.Num source · line 43 · raw

Data

a number as written: its sign, integer digits (one at least: d, then ds), fraction digits (none: no point) and exponent

type js.Json source · line 46 · raw

Data

type js.Fr source · line 589 · raw

Data

What a reader is in: inside arrays and objects (the frames: the values so far, reversed; an object's keys too, and the key the next value goes under), and what it wants next.

type js.Ph source · line 595 · raw

Data

where a number is: after its "-"; in its integer digits; after its "."; in its fraction; after its "e"; after the exponent's sign; in the exponent

type js.M source · line 604 · raw

Data

type js.St source · line 619 · raw

Data

Definitions

def js.if source · line 56 · raw

@-A:Data -> @b:Bool -> @t:(@_:Unit -> A) -> @e:(@_:Unit -> A) -> A

a choice whose branches are computed only when taken (Bool.pick computes both)

def js.d.code source · line 66 · raw

@d:js.D -> U32

def js.d.val source · line 89 · raw

@d:js.D -> Nat

def js.d.lo source · line 112 · raw

@a:Bool -> @b:Bool -> @c:Bool -> @d:Bool -> @e:Bool -> Maybe<&2, js.D>

def js.d.hi source · line 127 · raw

@a:Bool -> @b:Bool -> @c:Bool -> @d:Bool -> @e:Bool -> Maybe<&2, js.D>

def js.d.half source · line 142 · raw

@low:Bool -> @+c:U32 -> Maybe<&2, js.D>

def js.d.of source · line 150 · raw

@+c:U32 -> Maybe<&2, js.D>

the digit a character is, if it is one

def js.ds.put source · line 153 · raw

@m:Maybe<&2, js.D> -> @acc:List<&2, js.D> -> @more:(@_:List<&2, js.D> -> Maybe<&2, List<&2, js.D>>) -> Maybe<&2, List<&2, js.D>>

def js.ds.go source · line 160 · raw

@cs:String -> @acc:List<&2, js.D> -> Maybe<&2, List<&2, js.D>>

def js.ds.of source · line 168 · raw

@s:String -> Maybe<&2, List<&2, js.D>>

a decimal's digits, if it is one (no sign)

def js.ds.val source · line 172 · raw

@ds:List<&2, js.D> -> @+acc:Nat -> Nat

a digit string's value

def js.n.of.ds source · line 182 · raw

@m:Maybe<&2, List<&2, js.D>> -> js.Num

def js.n.nat source · line 190 · raw

@n:Nat -> js.Num

a natural number as aeson writes one

def js.nat source · line 193 · raw

@n:Nat -> js.Json

def js.u32 source · line 196 · raw

@+n:U32 -> js.Json

def js.zeros source · line 201 · raw

@ds:List<&2, js.D> -> Bool

a whole number's value: its integer digits, the fraction's digits moved in by the exponent, if that leaves no fraction that is not zero

def js.shift source · line 210 · raw

@k:Nat -> @ds:List<&2, js.D> -> @fs:List<&2, js.D> -> Maybe<&2, Nat>

def js.n.whole.e source · line 219 · raw

@neg:Bool -> @ds:List<&2, js.D> -> @fs:List<&2, js.D> -> @e:js.Exp -> Maybe<&2, Nat>

def js.n.whole source · line 230 · raw

@n:js.Num -> Maybe<&2, Nat>

the natural number a number is, if it is one (aeson's toBoundedInteger, for the non-negative)

def js.digits source · line 238 · raw

@ds:List<&2, js.D> -> @out:String -> String

def js.minus source · line 245 · raw

@neg:Bool -> @out:String -> String

def js.frac source · line 252 · raw

@fs:List<&2, js.D> -> @out:String -> String

def js.exp source · line 259 · raw

@e:js.Exp -> @out:String -> String

def js.num source · line 267 · raw

@n:js.Num -> @out:String -> String

a number's text, before out

def js.esc.hi source · line 276 · raw

@q:Bool -> @b:Bool -> @+c:U32 -> @out:String -> String

A string's characters, escaped. The 32 code points below U+0020 are picked out one by one (js.c0 .. js.c31), so that what each is written as is fixed text; one that is none of them goes on as a character from U+0020 up would (it cannot happen, but the proof need not know that).

def js.c31 source · line 285 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c30 source · line 292 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c29 source · line 299 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c28 source · line 306 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c27 source · line 313 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c26 source · line 320 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c25 source · line 327 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c24 source · line 334 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c23 source · line 341 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c22 source · line 348 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c21 source · line 355 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c20 source · line 362 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c19 source · line 369 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c18 source · line 376 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c17 source · line 383 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c16 source · line 390 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c15 source · line 397 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c14 source · line 404 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c13 source · line 411 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c12 source · line 418 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c11 source · line 425 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c10 source · line 432 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c9 source · line 439 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c8 source · line 446 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c7 source · line 453 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c6 source · line 460 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c5 source · line 467 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c4 source · line 474 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c3 source · line 481 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c2 source · line 488 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c1 source · line 495 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.c0 source · line 502 · raw

@hit:Bool -> @+c:U32 -> @out:String -> String

def js.esc.char source · line 509 · raw

@low:Bool -> @+c:U32 -> @out:String -> String

def js.esc source · line 517 · raw

@s:String -> @out:String -> String

s escaped, before out

def js.quote source · line 525 · raw

@s:String -> @out:String -> String

s quoted, before out

def js.lead.key source · line 532 · raw

@ks:List<&2, String> -> @body:(@_:List<&2, String> -> String) -> String

Values. A list of values is written by one def that goes into each value it meets (an array's values, an object's), with the keys an object pairs them with: body writes what follows a separator and a key, given the keys left.

def js.lead.obj source · line 539 · raw

@obj:Bool -> @ks:List<&2, String> -> @body:(@_:List<&2, String> -> String) -> String

def js.lead source · line 546 · raw

@first:Bool -> @obj:Bool -> @ks:List<&2, String> -> @body:(@_:List<&2, String> -> String) -> String

def js.bool source · line 553 · raw

@b:Bool -> @out:String -> String

def js.items source · line 562 · raw

@xs:List<&2, js.Json> -> @ks:List<&2, String> -> @+obj:Bool -> @first:Bool -> @out:String -> String

The values xs, each after its key ks (in an object: obj), comma between (first: none before the first), before out.

def js.show source · line 580 · raw

@j:js.Json -> String

a value's text, as aeson writes it

def js.bad source · line 622 · raw

js.St

def js.ws source · line 625 · raw

@+c:U32 -> Bool

def js.place source · line 629 · raw

@stack:List<&2, js.Fr> -> @j:js.Json -> js.St

a value done: into the frame it is in, or the whole text's

def js.close.arr source · line 638 · raw

@stack:List<&2, js.Fr> -> js.St

def js.close.obj source · line 645 · raw

@stack:List<&2, js.Fr> -> js.St

def js.comma source · line 652 · raw

@stack:List<&2, js.Fr> -> js.St

def js.setkey source · line 661 · raw

@stack:List<&2, js.Fr> -> @k:String -> js.St

def js.start.digit source · line 668 · raw

@m:Maybe<&2, js.D> -> @stack:List<&2, js.Fr> -> js.St

def js.start.at source · line 675 · raw

@q:Bool -> @a:Bool -> @o:Bool -> @t:Bool -> @f:Bool -> @n:Bool -> @m:Bool -> @stack:List<&2, js.Fr> -> @+c:U32 -> js.St

def js.start source · line 695 · raw

@stack:List<&2, js.Fr> -> @+c:U32 -> js.St

the first character of a value

def js.on.val source · line 698 · raw

@w:Bool -> @stack:List<&2, js.Fr> -> @+c:U32 -> js.St

def js.on.first source · line 705 · raw

@w:Bool -> @close:Bool -> @stack:List<&2, js.Fr> -> @+c:U32 -> js.St

def js.on.key source · line 714 · raw

@w:Bool -> @q:Bool -> @close:Bool -> @stack:List<&2, js.Fr> -> js.St

def js.on.key1 source · line 725 · raw

@w:Bool -> @q:Bool -> @stack:List<&2, js.Fr> -> js.St

def js.on.colon source · line 734 · raw

@w:Bool -> @k:Bool -> @stack:List<&2, js.Fr> -> js.St

def js.on.after.at source · line 743 · raw

@w:Bool -> @comma:Bool -> @ca:Bool -> @co:Bool -> @stack:List<&2, js.Fr> -> js.St

def js.on.done source · line 756 · raw

@w:Bool -> @j:js.Json -> js.St

def js.on.after source · line 764 · raw

@st:js.St -> @+c:U32 -> js.St

after a value: a separator, a closer, or (the whole text's) the end

def js.flush.at source · line 775 · raw

@none:Bool -> @acc:String -> String

Strings: hi is a high surrogate read as \uXXXX and waiting for its low half (0: none); one left alone is U+FFFD.

def js.flush source · line 782 · raw

@+hi:U32 -> @acc:String -> String

def js.push source · line 785 · raw

@+hi:U32 -> @+c:U32 -> @acc:String -> String

def js.str.end source · line 788 · raw

@key:Bool -> @stack:List<&2, js.Fr> -> @s:String -> js.St

def js.in.str source · line 795 · raw

@q:Bool -> @b:Bool -> @stack:List<&2, js.Fr> -> @acc:String -> @key:Bool -> @+hi:U32 -> @+c:U32 -> js.St

def js.esc.of.at source · line 804 · raw

@q:Bool -> @b:Bool -> @s:Bool -> @bb:Bool -> @f:Bool -> @n:Bool -> @r:Bool -> @t:Bool -> U32

def js.esc.of source · line 826 · raw

@+c:U32 -> U32

what the character after a backslash stands for (4294967295: nothing)

def js.in.esc.at source · line 829 · raw

@u:Bool -> @bad:Bool -> @stack:List<&2, js.Fr> -> @acc:String -> @key:Bool -> @+hi:U32 -> @+x:U32 -> js.St

def js.in.esc source · line 838 · raw

@stack:List<&2, js.Fr> -> @acc:String -> @key:Bool -> @+hi:U32 -> @+c:U32 -> js.St

def js.hexv.at source · line 841 · raw

@a:Bool -> @b:Bool -> @c2:Bool -> @d:Bool -> @e:Bool -> @f:Bool -> @+c:U32 -> U32

def js.hexv source · line 853 · raw

@+c:U32 -> U32

a hex digit's value (16: none)

def js.pair.low source · line 856 · raw

@none:Bool -> @+hi:U32 -> @+u:U32 -> @acc:String -> String

def js.unit.at source · line 863 · raw

@high:Bool -> @low:Bool -> @stack:List<&2, js.Fr> -> @acc:String -> @key:Bool -> @+hi:U32 -> @+u:U32 -> js.St

def js.unit source · line 873 · raw

@stack:List<&2, js.Fr> -> @acc:String -> @key:Bool -> @+hi:U32 -> @+u:U32 -> js.St

a code unit read as \uXXXX

def js.in.hex.at source · line 876 · raw

@bad:Bool -> @last:Bool -> @stack:List<&2, js.Fr> -> @acc:String -> @key:Bool -> @+hi:U32 -> @+n:U32 -> @+v:U32 -> js.St

def js.in.hex source · line 885 · raw

@stack:List<&2, js.Fr> -> @acc:String -> @key:Bool -> @+hi:U32 -> @+n:U32 -> @+v:U32 -> @+h:U32 -> js.St

def js.lit.more source · line 889 · raw

@t:String -> @j:js.Json -> @stack:List<&2, js.Fr> -> js.St

true, false, null: the letters still wanted

def js.lit.at source · line 896 · raw

@hit:Bool -> @t:String -> @j:js.Json -> @stack:List<&2, js.Fr> -> js.St

def js.in.lit source · line 903 · raw

@want:String -> @j:js.Json -> @stack:List<&2, js.Fr> -> @+c:U32 -> js.St

def js.num.e source · line 912 · raw

@has:Bool -> @eneg:Bool -> @es:List<&2, js.D> -> Maybe<&2, js.Exp>

Numbers: a number ends at the first character that cannot go on it, which then is read as what follows a value.

def js.num.mk source · line 921 · raw

@neg:Bool -> @ds:List<&2, js.D> -> @fs:List<&2, js.D> -> @e:Maybe<&2, js.Exp> -> Maybe<&2, js.Num>

def js.num.make source · line 928 · raw

@neg:Bool -> @ds:List<&2, js.D> -> @fs:List<&2, js.D> -> @eneg:Bool -> @es:List<&2, js.D> -> @has:Bool -> Maybe<&2, js.Num>

def js.ph.end source · line 932 · raw

@ph:js.Ph -> Bool

whether a number may end where it is, and whether it has an exponent

def js.ph.exp source · line 943 · raw

@ph:js.Ph -> Bool

def js.num.fin source · line 950 · raw

@neg:Bool -> @ds:List<&2, js.D> -> @fs:List<&2, js.D> -> @eneg:Bool -> @es:List<&2, js.D> -> @+ph:js.Ph -> Maybe<&2, js.Num>

def js.num.end source · line 953 · raw

@m:Maybe<&2, js.Num> -> @stack:List<&2, js.Fr> -> @+c:U32 -> js.St

def js.num.digit source · line 960 · raw

@ph:js.Ph -> @d:js.D -> @neg:Bool -> @ds:List<&2, js.D> -> @fs:List<&2, js.D> -> @eneg:Bool -> @es:List<&2, js.D> -> @stack:List<&2, js.Fr> -> js.St

def js.num.other source · line 977 · raw

@ph:js.Ph -> @dot:Bool -> @e:Bool -> @sign:Bool -> @mneg:Bool -> @neg:Bool -> @ds:List<&2, js.D> -> @fs:List<&2, js.D> -> @eneg:Bool -> @es:List<&2, js.D> -> @stack:List<&2, js.Fr> -> @+c:U32 -> js.St

def js.in.num source · line 996 · raw

@dm:Maybe<&2, js.D> -> @ph:js.Ph -> @neg:Bool -> @ds:List<&2, js.D> -> @fs:List<&2, js.D> -> @eneg:Bool -> @es:List<&2, js.D> -> @stack:List<&2, js.Fr> -> @+c:U32 -> js.St

def js.step source · line 1005 · raw

@st:js.St -> @+c:U32 -> js.St

One character read.

def js.run source · line 1035 · raw

@cs:String -> @st:js.St -> js.St

the text read, from a state on

def js.fin.num source · line 1042 · raw

@m:Maybe<&2, js.Num> -> Maybe<&2, js.Json>

def js.fin source · line 1050 · raw

@st:js.St -> Maybe<&2, js.Json>

what a reader that has read the whole text has read

def js.parse source · line 1060 · raw

@s:String -> Maybe<&2, js.Json>

JSON text read

def js.find source · line 1066 · raw

@ks:List<&2, String> -> @vs:List<&2, js.Json> -> @+k:String -> Maybe<&2, js.Json>

def js.get source · line 1074 · raw

@j:js.Json -> @+k:String -> Maybe<&2, js.Json>

an object's value under a key (the first; None: no such key, or no object)

def js.text source · line 1084 · raw

@m:Maybe<&2, js.Json> -> String

What aeson's readers in the Haskell backend make of a value that may be missing: a string (a number as its text), a natural number (0 when it is none), a truth value (False when none), strings (an array's strings).

def js.whole.of source · line 1093 · raw

@m:Maybe<&2, Nat> -> Nat

def js.natural source · line 1100 · raw

@m:Maybe<&2, js.Json> -> Nat

def js.truth source · line 1107 · raw

@m:Maybe<&2, js.Json> -> Bool

def js.strs.go source · line 1114 · raw

@xs:List<&2, js.Json> -> List<&2, String>

def js.texts source · line 1123 · raw

@m:Maybe<&2, js.Json> -> List<&2, String>