PureConfig Support

This module provides refined types ConfigReader instances for PureConfig.

Dependency

SBT:

libraryDependencies += "io.github.iltotore" %% "iron-pureconfig" % "version"

Mill:

ivy"io.github.iltotore::iron-pureconfig:version"

Following examples' dependencies

SBT:

libraryDependencies += "com.github.pureconfig" %% "pureconfig-core" % "0.17.7"

Mill:

ivy"com.github.pureconfig::pureconfig-core::0.17.7"

ConfigReader instances

Iron provides ConfigReader instances for refined types:

package io.github.iltotore.iron

import pureconfig.ConfigReader
import pureconfig.generic.derivation.default.*
import io.github.iltotore.iron.constraint.all.*
import io.github.iltotore.iron.pureconfig.given

opaque type Username = String :| MinLength[5]
object Username extends RefinedTypeOps[String, MinLength[5], Username]

case class IronTypeConfig(
  username: String :| MinLength[5]
) derives ConfigReader

case class NewTypeConfig(
  username: Username
) derives ConfigReader