(* Images (currently, pdf, to be changed): *) datatype img = emptyImg | Imag raw_data (* Visibility outside the current api: either friends-only or public *) datatype vis = Vsb String.literal (* Accepted values: friend and public *) abbreviation"FriendV ≡ Vsb (STR ''friend'')" abbreviation"PublicV ≡ Vsb (STR ''public'')" fun stringOfVis where"stringOfVis (Vsb str) = str"
(* A post consists of a string for title, a string for its text,
a (possibly empty) image and a visibility specification: *)
datatypepost = Ntc (titlePost : title) (textPost : "text") (imgPost : img) (* Setters: *) fun setTitlePost where"setTitlePost (Ntc title text img) title' = Ntc title' text img" fun setTextPost where"setTextPost(Ntc title text img) text' = Ntc title text' img" fun setImgPost where"setImgPost (Ntc title text img) img' = Ntc title text img'" (* *) definition emptyPost :: postwhere "emptyPost ≡ Ntc emptyTitle emptyText emptyImg" (* initially set to the lowest visibility: friend *)
(* Information associated to requests for registration: both for users and apps *) datatype req = ReqInfo String.literal definition"emptyReq ≡ ReqInfo emptyStr"
subsection‹Identifiers›
datatype userID = Uid String.literal datatype postID = Nid String.literal
definition"emptyUserID ≡ Uid emptyStr" definition"emptyPostID ≡ Nid emptyStr"
(* *) fun userIDAsStr where"userIDAsStr (Uid str) = str"
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.