X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.data%2Fscl%2FData%2FJson.md;fp=bundles%2Forg.simantics.scl.data%2Fscl%2FData%2FJson.md;h=fe8e7218f9028c35768ba0580a31895b5f8914e9;hb=402384bf9afa895e925d9d2593a81e99ab99eab9;hp=0000000000000000000000000000000000000000;hpb=e92590c7c623e152404240d7a876c5d0a63812ad;p=simantics%2Fplatform.git 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 index 000000000..fe8e7218f --- /dev/null +++ b/bundles/org.simantics.scl.data/scl/Data/Json.md @@ -0,0 +1,42 @@ +# Basic functions + +::value[toJsonString, fromJsonString] + +# Supported value types + +This module supports the following value types: + +``` +instance Json String +instance Json Short +instance Json Integer +instance Json Long +instance Json Float +instance Json Double + +instance (Json a) => Json [a] +instance (Json a) => Json (Maybe a) + +instance Json () +instance (Json a, Json b) => Json (a, b) +instance (Json a, Json b, Json c) => Json (a, b, c) +instance (Json a, Json b, Json c, Json d) => Json (a, b, c, d) +instance (Json a, Json b, Json c, Json d, Json e) => Json (a, b, c, d, e) + +instance Json Json +``` + +# Generic JSON Type + +::data[Json, JsonField] + +# Adding support for additional value types + +::data[JsonGenerator, JsonParser] +::class[Json] + +It is enough to implement `toJson` and `fromJson`. + +# Undocumented entities + +::undocumented[] \ No newline at end of file