kapunga / fallatol   0.1.1

MIT License GitHub

A collection of Thor's micro-libraries.

Scala versions: 3.x 2.13 2.12
Scala.js versions: 1.x
Scala Native versions: 0.5

Fallatól - Functional Tools

Scala CI Scala Steward badge Maven Central

A collection of Kapunga's personal micro-libraries. Cross build where possible to all Scala platforms (JVM, JS, and Native) for Scala versions 2.12, 2.13, and 3.

About

Fallatól is a collection of experimental micro-libraries that emerged from patterns I found myself repeating in my personal Scala projects. These libraries serve both as a centralized repository for code reuse in my side-projects and as well as to gain additional practice in end to end library development. While I'm making an effort to document and test them well, I make no guarantees as to production readiness or comprehensive feature coverage. I do welcome feedback and feature requests if you find them useful.

Main documentation is located here.

Current Micro-Libraries

A collection of implicits used with the sconfig library, providing a get method to Config that is generic and referentially transparent.

Quickstart

Add to your project's build.sbt:

libraryDependencies += "org.fallatol" %% "fallatol-config" % "0.1.1"

Read some configs:

import fallatol.config._
import org.ekrich.config._

case class Person(name: String, age: Int)
    
def loadConfig = {
  val personHocon =
    """
      |{
      |  name: "Alice"
      |  age: 37
      |}
      |""".stripMargin
      
  val config = ConfigFactory.parseString(personHocon)
  
  for {
    name <- config.get[String]("name")
    age <- config.get[Int]("age")
  } yield (origin, destination)
}