@@ -125,6 +125,19 @@ mapBin = Maybe.fromJust $ constructorId mapRef "Map.Bin"
125125setWrap :: ConstructorId
126126setWrap = Maybe. fromJust $ constructorId setRef " Set.Set"
127127
128+ jsonNull , jsonBool , jsonObj , jsonNum , jsonText , jsonArr :: ConstructorId
129+ jsonNull = Maybe. fromJust $ constructorId jsonRef " Json.Null"
130+ jsonBool = Maybe. fromJust $ constructorId jsonRef " Json.Boolean"
131+ jsonObj = Maybe. fromJust $ constructorId jsonRef " Json.Object"
132+ jsonNum = Maybe. fromJust $ constructorId jsonRef " Json.Number.Unparsed"
133+ jsonText = Maybe. fromJust $ constructorId jsonRef " Json.Text"
134+ jsonArr = Maybe. fromJust $ constructorId jsonRef " Json.Array"
135+
136+ jsonParseError :: ConstructorId
137+ jsonParseError =
138+ Maybe. fromJust $
139+ constructorId parseErrorRef " Json.ParseError.ParseError"
140+
128141isPropagatedConstructorId = Maybe. fromJust $ constructorId isPropagatedRef " IsPropagated.IsPropagated"
129142
130143isTestConstructorId = Maybe. fromJust $ constructorId isTestRef " IsTest.IsTest"
@@ -260,6 +273,12 @@ mapRef = lookupDeclRef "Map"
260273setRef :: Reference
261274setRef = lookupDeclRef " Set"
262275
276+ jsonRef :: Reference
277+ jsonRef = lookupDeclRef " Json"
278+
279+ parseErrorRef :: Reference
280+ parseErrorRef = lookupDeclRef " Json.ParseError"
281+
263282pattern Rewrites' :: [Term2 vt at ap v a ] -> Term2 vt at ap v a
264283pattern Rewrites' ts <- (unRewrites -> Just ts)
265284
@@ -316,7 +335,9 @@ builtinDataDecls = rs1 ++ rs
316335 (v " RewriteCase" , rewriteCase),
317336 (v " Rewrites" , rewrites),
318337 (v " Map" , map ),
319- (v " Set" , set)
338+ (v " Set" , set),
339+ (v " Json" , json),
340+ (v " Json.ParseError" , jsonParseError)
320341 ] of
321342 Right a -> a
322343 Left e -> error $ " builtinDataDecls: " <> show e
@@ -649,6 +670,40 @@ builtinDataDecls = rs1 ++ rs
649670 )
650671 ]
651672
673+ json =
674+ DataDeclaration
675+ (Unique " oml0j9g6bb2tij2s75k4v7n1nftj199i" )
676+ ()
677+ []
678+ let json = var " Json"
679+ tup x y = Type. apps' (var " Tuple" ) [x, y]
680+ pair x y = tup x (tup y (var " Unit" ))
681+ in [ (() , v " Json.Null" , var " Json" ),
682+ (() , v " Json.Boolean" , Type. boolean () `arr` json),
683+ ( () ,
684+ v " Json.Object" ,
685+ Type. app () (Type. list () ) (pair (Type. text () ) json)
686+ `arr` json
687+ ),
688+ (() , v " Json.Number.Unparsed" , Type. text () `arr` json),
689+ (() , v " Json.Text" , Type. text () `arr` json),
690+ ( () ,
691+ v " Json.Array" ,
692+ Type. app () (Type. list () ) json `arr` json
693+ )
694+ ]
695+ jsonParseError =
696+ DataDeclaration
697+ (Unique " u3j6g9j6daejijc5e0rcujjj3sd6j3gq" )
698+ ()
699+ []
700+ let jpe = var " Json.ParseError"
701+ in [ ( () ,
702+ v " Json.ParseError.ParseError" ,
703+ Type. text () `arr` Type. nat () `arr` Type. text () `arr` jpe
704+ )
705+ ]
706+
652707builtinEffectDecls :: [(Symbol , Reference. Id , DD. EffectDeclaration Symbol () )]
653708builtinEffectDecls =
654709 case hashDataDecls $ Map. fromList [(v " Exception" , exception)] of
0 commit comments