]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.data/scl/Data/Json.md
An initial implementation of Json module.
[simantics/platform.git] / bundles / org.simantics.scl.data / scl / Data / Json.md
diff --git a/bundles/org.simantics.scl.data/scl/Data/Json.md b/bundles/org.simantics.scl.data/scl/Data/Json.md
new file mode 100644 (file)
index 0000000..fe8e721
--- /dev/null
@@ -0,0 +1,42 @@
+# Basic functions\r
+\r
+::value[toJsonString, fromJsonString]\r
+\r
+# Supported value types\r
+\r
+This module supports the following value types:\r
+\r
+```\r
+instance Json String\r
+instance Json Short\r
+instance Json Integer\r
+instance Json Long\r
+instance Json Float\r
+instance Json Double\r
+\r
+instance (Json a) => Json [a]\r
+instance (Json a) => Json (Maybe a)\r
+\r
+instance Json ()\r
+instance (Json a, Json b) => Json (a, b)\r
+instance (Json a, Json b, Json c) => Json (a, b, c)\r
+instance (Json a, Json b, Json c, Json d) => Json (a, b, c, d)\r
+instance (Json a, Json b, Json c, Json d, Json e) => Json (a, b, c, d, e) \r
+\r
+instance Json Json\r
+```\r
+\r
+# Generic JSON Type\r
+\r
+::data[Json, JsonField]\r
+\r
+# Adding support for additional value types\r
+\r
+::data[JsonGenerator, JsonParser]\r
+::class[Json]\r
+\r
+It is enough to implement `toJson` and `fromJson`.\r
+\r
+# Undocumented entities\r
+\r
+::undocumented[]
\ No newline at end of file