A set of delimiters can be used to encode/decode a Version and specify
alternative serialisation strategies.
Lenses can be used to modify the default delimiter set, as in the following
example - using alpha characters to encode the version as a valid
DNS CNAME (assuming operators from lens or lens-family-core):
let Right v = fromText "1.2.3+40"
let alpha = semantic & major .~ 'm' & patch .~ 'p' & release .~ 'r' & metadata .~ 'd' & identifier .~ 'i'
Data.Text.Lazy.Builder.toLazyText ("app01-" <> toBuilder alpha v <> ".dmz.internal")
Would result in the following LText.Text:
app01-1m2p3d40.dmz.internal
Using the same Delimiters set with parser would ensure
correct decoding behaviour.