Main idea is that Literal represents values (of some type), not encodings. They all happen to have encodings, of course, but only one encoding per type. This is important to ensure equality. Literal is mostly used for storage.
By contrast, Media is a media type and byte-array, and therefore an encoding of something.
See #180, and #168 for JSON.
Currently:
Plan
Main idea is that
Literal
represents values (of some type), not encodings. They all happen to have encodings, of course, but only one encoding per type. This is important to ensure equality.Literal
is mostly used for storage.By contrast,
Media
is a media type and byte-array, and therefore an encoding of something.type storable MediaType
Mk Text Text (List (Text *: Text))
subtype MediaType <: Literal
D(MediaType) = Literal
vndMIMEType "mediatype"
mimeCompress
, probablym
MIME
type withtype storable Media
Mk MediaType ByteArray
Uses
HTMLText
type, not necessarily valid HTMLMk Text
subtype HTMLText <: Literal
subtype HTMLText <: Textual
subtype HTMLText <: Interpretation (Maybe XML)
(possibly, or useResult
)D(HTMLText) = Literal
(checking media type)subtype JPEG.Image <: Literal
(already done)subtype JPEG.Image <: Interpretation Image
(already done)jpegMIME.JPEG.Image