5data JSONType : Type where
6 JSONArray : (n : Nat) -> Vect n JSONType -> JSONType
10 JSONObject : SortedMap String JSONType -> JSONType
14 using (ts : Vect n JSONType, fs : SortedMap String JSONType)
16 data JArray : (n : Nat) -> Vect n JSONType -> Type where
18 (::) : JSON t -> JArray n ts -> JArray (S n) (t :: ts)
21 data JObject : SortedMap String JSONType -> Type where
23 (::) : (f : (String, JSON t)) ->
25 JObject (insert (fst f) t fs)
27 data JSON : JSONType -> Type where
28 JSString : String -> JSON JSONString
29 JSNumber : Float -> JSON JSONNumber
30 JSBool : Bool -> JSON JSONBool
31 JSNull : JSON JSONNull
32 JSArray : JArray n ts -> JSON (JSONArray n ts)
33 JSObject : JObject fs -> JSON (JSONObject fs)
35index : (i : Fin n) -> JSON (JSONArray n ts) -> JSON (index i ts)
36index fZ (JSArray (x :: xs)) = x
37index (fS i) (JSArray (x :: xs)) = index i (JSArray xs)
41(++) : JSON (JSONArray m ts1) ->
42 JSON (JSONArray n ts2) ->
43 JSON (JSONArray (m + n) (ts1 ++ ts2))
44(++) (JSArray []) ys = ys
45(++) (JSArray (x :: xs)) ys with ((JSArray xs) ++ ys)
46 | (JSArray as) = JSArray (x :: as)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list