Skip to content

Instantly share code, notes, and snippets.

Created Apr 18, 2019
What would you like to do?
squants exercise with pureconfig
package exercise.squants.with_pureconfig
import pureconfig.ConfigReader.Result
import squants.motion.Pressure
import pureconfig.module.squants._
import squants.Mass
import squants.thermal._
case class EarthConfig(
meanRadius: Length, // 平均半径
volume: Volume, // 体積
mass: Mass, // 質量
atmosphericPressure: Pressure, // 大気圧
averageTemperature: Temperature // 平均気温
object Main {
def main(args: Array[String]): Unit = {
val config: Result[EarthConfig] = pureconfig.loadConfig[EarthConfig]
println(config.fold("\n"), _.toString))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment