You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to include a new datatype, for now we will call it Hyperlink, which packages up a value with a string that references or “explains” it. We need to be able to splice these hyperlink values into a LinkedText, so that rather than a list of strings, a LinkedText will instead be a list of String + Hyperlink (perhaps wrapped in a newtype). Since we need a way of distinguishing an inert string from a Hyperlink, we will wrap the inert strings in their own constructor. Since this will likely get clunky, we may soon want to push on #1187 to streamline things for document authors.
Since these strings can themselves be “computed” (the use-case we have investigated so far), interacting with the text once it’s rendered should modify selection information on the (potentially computed, potentially inert) string, and the value to which it makes reference
Rename LinkedText to Paragraph, which takes a list of TextFragment
New TextFragment datatype with two constructors:
Link (with two arguments)
Text (with one)
Remove Explanation experiment
Other partially-formed thoughts:
Is the “very likely” pattern better thought of as an example of Link where there is both a computed value (e.g. proportion of distribution that is above 2°C) and some computed text (mapping that value to the string “very likely”)? It might be preferable to think of this as a Link rather than Text because one could easily imagine wanting to be able to reveal the underlying value in the UI. (Although that behaviour would in some sense be redundant if we could visualise the computational explanation behind a value, e.g. a Text element.)
Should a Link be a value paired with a function which will interpret that value as a string? Then Text (numToStr n) could be expressed as Link n numToStr and in fact Text e would be equivalent to Link e id.
rolyp
changed the title
Hyperlink datatypeHyperlink datatype
Dec 29, 2024
We need to include a new datatype, for now we will call it
Hyperlink
, which packages up a value with a string that references or “explains” it. We need to be able to splice these hyperlink values into aLinkedText
, so that rather than a list of strings, aLinkedText
will instead be a list ofString + Hyperlink
(perhaps wrapped in a newtype). Since we need a way of distinguishing an inert string from aHyperlink
, we will wrap the inert strings in their own constructor. Since this will likely get clunky, we may soon want to push on #1187 to streamline things for document authors.Since these strings can themselves be “computed” (the use-case we have investigated so far), interacting with the text once it’s rendered should modify selection information on the (potentially computed, potentially inert) string, and the value to which it makes reference
Related Issues
LinkedText
: interpolation syntax #1187The text was updated successfully, but these errors were encountered: