Skip to content

Raison d'être of Iron #73

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

You must be logged in to vote

Hi.

The use cases of Iron are rather the same as refined: securing your objects/values (usually domain models) by forbiding wrong values, using type constraints.

Despite sharing the same goal, Iron and refined has differences in their approach.

What are the differences besides Iron being written from scratch in Scala 3?

Being written for Scala 3 allows Iron to use Dotty-specific features, especially opaque types, inlines and new macros.

An opaque type is a type alias whose inner type is not known at compile-time in external files. Both Iron and refined (in Scala 3) use this feature for their refined type (IronType for Iron, Refined for refined) to eleminate the overhead of a class. Howe…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wvandermerwe
Comment options

Answer selected by wvandermerwe
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