Skip to content

Instantly share code, notes, and snippets.

@hmrclt
hmrclt / Prereg.scala
Created January 9, 2018 16:04
SDIL-prereg
object prereg {
def OptList[A](in: List[A]): List[Option[A]] =
None :: in.toList.map(Some(_))
object GG extends Enumeration { val CT, SA, SDIL = Value }
object Affinity extends Enumeration {
val Agent, Individual, Org_Admin, Org_Assistant, Other = Value
}
@hmrclt
hmrclt / Zero.scala
Created May 18, 2017 16:21
shapeless automatic case class instances
package zero {
trait Zero[A] {
def zero: Option[A]
def zeroN(s: String): Option[A] = zero
}
object Zero {
def apply[A](implicit e: Zero[A]): Zero[A] = e