- or download this
A basic technique is to use newtype declarations to declare separate
types for separate intents.
...
append (AnnotatedString x) (AnnotatedString y)
= AnnotatedString (x ++ y)
- or download this
If x and y have the same safety level,
then (x ++ y) has again that same safety level.
- or download this
type family Join a b
type instance Join Safe Safe = Safe
type instance Join Safe Unsafe = Unsafe
type instance Join Unsafe Safe = Unsafe
type instance Join Unsafe Unsafe = Unsafe
- or download this
append
:: AnnotatedString a
-> AnnotatedString b
-> AnnotatedString (Join a b)
- or download this
(x ++ y) is at least as safe as the least safe of x and y.