Advertisement
Advertisement
⚡ Community Insights
Discussion Sentiment
86% Positive
Analyzed from 378 words in the discussion.
Trending Topics
#null#value#age#domain#iban#performance#cannot#json#person#haskell
Discussion Sentiment
Analyzed from 378 words in the discussion.
Trending Topics
Discussion (11 Comments)Read Original on HackerNews
https://www.haskell.org/definition/from12to13.html#newtype
I guess you can probably do the same with Unpacking.
https://wiki.haskell.org/Performance/Data_types
I’d love feedback from folks who’ve experimented with Valhalla or have opinions on modelling domain types in Java.
Won't this be an issue for JPA/JSONB? `null` is a an important and value in JSON and nearly every database, and for modeling the real world.
Null is the thing which it isn't. A null value is evidence that your modelling does not fit the domain.
I guess since basic types, like an int or double, cannot be null, I understand why these cannot be null. This unfortunately limits their usefulness, but it's a carryover from the underlying properties of the basic type.
I can only really say one thing here: they are really late to the party with this but it's good. The performance boost will be welcome, and would probably change ORMs forever if applied right.
Nullability rules should of course be also part of this domain-constricted types concept, since it would solve a lot of accidental mistakes. Because that's what a type system is for, right? Validation of programmer input.