Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[refined4s-pureconfig] Add PureconfigNewtypeConfigReader and PureconfigRefinedConfigReader to provider ConfigReader for Newtype, Refined and InlinedRefined #116

Closed
kevin-lee opened this issue Dec 14, 2023 · 0 comments · Fixed by #119
Assignees
Labels
Milestone

Comments

@kevin-lee
Copy link
Owner

Summary

[refined4s-pureconfig] Add PureconfigNewtypeConfigReader and PureconfigRefinedConfigReader to provider ConfigReader for Newtype, Refined and InlinedRefined

Version

0.2.0

Description

type MyNewtype = MyNewtype.Type
object MyNewtype extends Newtype[String] with PureconfigNewtypeConfigReader[String]

type MyRefinedType = MyRefinedType.Type
object MyRefinedType extends Refined[String] with PureconfigRefinedConfigReader[String] {
  override inline def invalidReason(a: String): String =
    "It has to be a non-empty String but got \"" + a + "\""

  override inline def predicate(a: String): Boolean = a != ""
}

type MyRefinedNewtype = MyRefinedNewtype.Type
object MyRefinedNewtype extends Newtype[MyRefinedType] with PureconfigNewtypeConfigReader[MyRefinedType]

type MyInlinedRefinedType = MyInlinedRefinedType.Type
object MyInlinedRefinedType extends InlinedRefined[String] with PureconfigRefinedConfigReader[String] {
  override inline def invalidReason(a: String): String =
    "It has to be a non-empty String but got \"" + a + "\""

  override inline def predicate(a: String): Boolean = a != ""

  override inline def inlinedPredicate(inline a: String): Boolean = a != ""
}

type MyInlinedRefinedNewtype = MyInlinedRefinedNewtype.Type
object MyInlinedRefinedNewtype extends Newtype[MyRefinedType] with PureconfigNewtypeConfigReader[MyRefinedType]
@kevin-lee kevin-lee added the task label Dec 14, 2023
@kevin-lee kevin-lee added this to the m3 milestone Dec 14, 2023
@kevin-lee kevin-lee self-assigned this Dec 14, 2023
kevin-lee added a commit that referenced this issue Dec 14, 2023
… and PureconfigRefinedConfigReader to provider ConfigReader for Newtype, Refined and InlinedRefined
kevin-lee added a commit that referenced this issue Dec 15, 2023
… and PureconfigRefinedConfigReader to provider ConfigReader for Newtype, Refined and InlinedRefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment