Iltotore / iron

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

Add NonEmptyString type #213

Closed dagmendez closed 4 months ago

dagmendez commented 5 months ago

Hello 👋🏼

Have you consider including a NonEmpty as a string constrain?

In the project I am working right now we have defined the type as follows:

type NonEmptyString = String :| Not[Empty]

We use it as a control type until we come up with a better refinement. It can be useful for early phases of design.

Thank you!

Iltotore commented 5 months ago

I'm unsure about the goal of it. Empty implies Blank (althrough the given Implication is not present in the codebase) so Not[Blank] already implies Not[Empty].

Therefore, NonEmpty is just Not[Empty] with a description so what is its purpose compared to just using Not[Empty]?

Iltotore commented 4 months ago

Closed due to inactivity. See #214