Commits

Anonymous committed 5b172de

+ from_json tuple

Comments (0)

Files changed (1)

        | Sum_type _destr _constr
            -> failwith "json.from: Sum_type: not implemented"
            
-       | Tuple _ _ _
-           -> failwith "json.from: Tuple: not implemented"
+       | Tuple _destr utis constr ->
+           fun j ->
+           let jarr = Array.of_list (Br.array j) in
+           let ufields = Array.map2to1
+             (fun field_uti field_json ->
+                ubox_from_json field_uti field_json
+             )
+             utis
+             jarr
+           in
+           constr ufields
 
        | Lambda _ _ _
            -> failwith "can't convert json to Lambda"