[Ur] How to design JSON interface?

Marc Weber marco-oweber at gmx.de
Wed Dec 1 07:00:00 EST 2010


I'd like to implement toJson and fromJson which can read typed values
from json representation and back automatically.

I still don't know how to represent this in urweb:

I found:
- the eq class in basis.ur - but the implementation of mkEq is written
  in ml (?)

- the classes in tests/ - but those methods don't take a type of t
  worse: When copy pasting  type_classMod2.ur into my own .ur file it
  fails to compile:

  main.ur|27 col 30| 27:34: syntax error: replacing  TYPE with  UNDER

  Line 27 : val default = fn t :: Type => fn v : c t => v

Is using a class the best way at to implement a formJSON and toJSON
code?

Marc Weber



More information about the Ur mailing list