Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advantages over AnyVal? #42

Open
CremboC opened this issue Jan 30, 2019 · 2 comments
Open

Advantages over AnyVal? #42

CremboC opened this issue Jan 30, 2019 · 2 comments

Comments

@CremboC
Copy link

CremboC commented Jan 30, 2019

The README.md compares this library to Haskell's newtype and to Tagged types. However, more crucially, it doesn't mention how this is any different/better than simply using case class Thing(value: String) extends AnyVal.

From my understand this is an alternative to extends AnyVal, hence this info is crucial.

@markschaake
Copy link

@barambani
Copy link

@CremboC you might also find this

https://failex.blogspot.com/2017/04/the-high-cost-of-anyval-subclasses.html

and this

https://github.com/barambani/http4s-extend#new-type

interesting on the subject.

ghostbuster91 added a commit to ghostbuster91/scala-newtype that referenced this issue Feb 10, 2022
I think that this piece of information is very crucial since value classes are native for scala. I know that there is this issue estatico#42 but I would expect to see that information in the top of the readme.

I mostly copy-pasted what was in the issue and made it more discover-able.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants