This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
itrait UEnum[T] { | |
def values: Map[String, T] | |
def name(t: T): String | |
def value(name: String): Option[T] | |
} | |
object UEnum { obj => | |
final case class UEnumImpl[T](seq: T*) extends UEnum[T] { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Plane = (Double, Double) | |
type Matrix = (Plane, Plane) | |
type TaggedEvents = Map[String, Plane] | |
private val sin45 = Math.sqrt(0.5) | |
private val matrixMinus45 = ((sin45, sin45), (-sin45, sin45)) | |
private val matrixPlus45 = ((sin45, -sin45), (sin45, sin45)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package utility.functional | |
import scala.language.{higherKinds, reflectiveCalls} | |
import cats.Applicative | |
import shapeless._ | |
/** | |
* Given a HList I0::I1:: ... In::HNil and a type Out | |
* returns a curried function (I0 => I1 => ... In => Out) => Out |