I was excited to see the elm-tagged package because our project has a lot of replicated code to wrap string-based IDs in types and those ID’s then don’t work well with dictionaries. However, my quick experiments show that it allows forging of tagged values. Specifically, if I define something like:
type alias AccountID = Tagged.Tagged AccountID_Private String
type AccountID_Private = NotExported
Then it turns out that in another module, I can write:
forgedID : AccountID
forgedID = Tagged.tag “forged”
Is there a way to prevent this? Obviously, I could just say “don’t do that” but one could say that about all sorts of things for which type-safety instead says “you can’t do that”.
Mark