Me either didn’t care about the value classes memory usage before implementing large CSV files processing one day. Can’t remember exactly but I was getting 30–50mb of “value classes” in the heap.
What I like about type tags is that they allow to manipulate themselves programmatically without using Shapeless or other “hacks”. E.g. using this implementation of type tags, one can write:
implicit def taggedColumnType[T, U](implicit tColumnType: BaseColumnType[T],
clsTag: ClassTag[T @@ U]): BaseColumnType[T @@ U] =
MappedColumnType.base[T @@ U, T](identity, _.@@[U])
and then use it like
implicit lazy val dataVersionIdColumnType: BaseColumnType[DataVersionId.Type] =
I suspect this also can be made boilerplate-free.