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
object hlists | |
enum HList | |
case :*:[+H, +T <: HList](head: H, tail: T) | |
case HNil | |
def :*:[H](h: H): H :*: this.type = new HList.:*:(h, this) | |
override def toString: String = this match | |
case HList.:*:(head, tail) => s"($head) :: $tail" | |
case HList.HNil => "HNil" |
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
import shapeless._ | |
import shapeless.labelled._ | |
import syntax.singleton._ | |
sealed trait Event[A] { | |
def replay(initial: Option[A]): Option[A] | |
} | |
case class NameChangedEvent[A: NameChangedEvent.Update](name: String) extends Event[A] { | |
def replay(initial: Option[A]): Option[A] = |