Skip to content

Which the suggested way from Raw[T] to T #52

Closed Answered by Iltotore
mcallisto asked this question in Q&A
Discussion options

You must be logged in to vote

In Iron, Raw means not refined. In other words, it's a value of type Constrained value with an always-true constraint (or "no constraint"). It should always be Right.

Your code is actually ok. You can use getOrElse to shorten your code but it is mostly a matter of preferences.

Also note that Raw will probably disappear in 2.0.0. Seamless interoperability between "normal" types and refined/constrained is targeted:

val x: Int = ???
val y: Int / AlwaysValidConstraint = x //No error and no verification required in 2.0.0

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Iltotore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants