Open acjay opened 7 years ago
I recently made some major modifications to newtypes
. The current encoding of translucent types is almost identical to @@
, the only difference is that @translucent type A = Int
defines A
as an abstract type. The only case I know of where that might be important is @translucent type Void = Nothing
, which does not break implicit resolution (Nothing
itself does).
See https://github.com/scalaz/scalaz/pull/1450#issuecomment-332288733 for an explanation of the current encoding.
Not knowing this project existed, I created my own project that's very similar: https://github.com/acjay/taggy. A friend clued me into Newtypes and looking into it, I realized that Shapeless's
tag
has yet another implementation of this pattern:It seems most similar to the
translucent
option in this package, but I'm wondering if there are any significant differences? Would it be a good idea to an implementation based on this approach in Newtypes too?