3 ms·
"what it means to be a string includes styling (bold, italic, etc.)" I would keep String and StyledString separate. Lifting to a StyledString is okay if you wa
by ericlavigne 15y ago
"what it means to be a string includes styling (bold, italic, etc.)"
I would keep String and StyledString separate. Lifting to a StyledString is okay if you want to concatenate a String and a StyledString.
(plain "This is ") ++ (bold "GREAT!")
-> StyledString "This is <b>GREAT!</b>"
Strings are used for more than just rendering HTML, and I should be able to forget about styling in situations where styling is irrelevant.
"partial serialization of something..." ++ " another chunk"
-> "partial serialization of something... another chunk"
One immediate benefit of keeping String and StyledString separate, is that you won't forget which argument comes first in link.
link :: (String -> StyledString -> Element)