Original idea from Alexander Semenov [https://github.com/Tvaroh] using inner:
Original idea from Alexander Semenov [https://github.com/Tvaroh] using inner:
sealed trait Tag
but, we can use existent already materialized anchor
, so there is no need
for any additional anchor trait. All right for now :)object MyTag extends TaggedType[T]
Replaces all existing tags with 1 new (if no tags then adds one) (Don't know who really needs this, but very simple implementation, so it is here)
Alias for apply
for pretty coding MyTag @@ value
Adds one more tag to existing tags (if no tags then adds one)
Removes concrete tag (this.Tag)
Example:
def method(v:Width)object Width extends TaggedType[Int] type Width = Width.Type // this for pretty coding: