You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I see, many people consider opaque types as something they can use in the same way as newtypes.
That connotation of domain values maintenance implies having access to underlying value.
Access to underlying values is another step to let Iron be a legitimate replacement of the newtype+refined stack.
opaque type Temperature = Double :| Positive
object Temperature extends RefinedTypeOps[Temperature]
Usage
val temperature = Temperature(100)
val sum: Double = temperature.raw + 100
sum is Double; depending on the context, it could be packed back to Temperature. But that is up to the user.
As far as I see, many people consider
opaque
types as something they can use in the same way as newtypes.That connotation of domain values maintenance implies having access to underlying value.
Access to underlying values is another step to let Iron be a legitimate replacement of the newtype+refined stack.
Usage
sum
is Double; depending on the context, it could be packed back toTemperature
. But that is up to the user.Pull request with the idea: #120
The text was updated successfully, but these errors were encountered: