Iltotore / iron

Strong type constraints for Scala
https://iltotore.github.io/iron/docs/
Apache License 2.0
427 stars 37 forks source link

Rename `.refine` into `.refineUnsafe` #203

Closed matwojcik closed 6 months ago

matwojcik commented 6 months ago

Is your feature request related to a problem? Please describe. .refine method does not indicate that it is unsafe - i.e. can throw exception. It is so easy to make a mistake by a developer when they don't know the library very well. I think one of the goals of libraries like this is to promote type safety and purity.

Describe the solution you'd like I suggest in 3.x to rename it to refineUnsafe

Iltotore commented 6 months ago

Adding refineUnsafe to the next minor and marking refine as deprecated is also an option. Then, we can more safely remove refineUnsafe for 3.0.0.

matwojcik commented 6 months ago

Adding refineUnsafe to the next minor and marking refine as deprecated is also an option. Then, we can more safely remove refineUnsafe for 3.0.0.

Definitely good idea. Prepared PR #204 that addresses this