Skip to content

Instantly share code, notes, and snippets.

@trepidacious
Created December 26, 2017 22:43
Show Gist options
  • Save trepidacious/f0239d8228198bc45c87d20258284808 to your computer and use it in GitHub Desktop.
Save trepidacious/f0239d8228198bc45c87d20258284808 to your computer and use it in GitHub Desktop.
trait Delta[U, A] {
def apply(a: A): DeltaIO[U, A]
}
sealed trait DeltaIOA[U, A]
case class GetGuid[U]() extends DeltaIOA[U, Guid]
//case class GetId[U, T <: U]() extends DeltaIOA[U, Id[T]]
case class GetContext[U]() extends DeltaIOA[U, DeltaIOContext]
case class GetDeltaId[U]() extends DeltaIOA[U, DeltaId]
case class GetPRInt[U]() extends DeltaIOA[U, Int]
case class GetPRIntUntil[U](bound: Int) extends DeltaIOA[U, Int]
case class GetPRLong[U]() extends DeltaIOA[U, Long]
case class GetPRBoolean[U]() extends DeltaIOA[U, Boolean]
case class GetPRFloat[U]() extends DeltaIOA[U, Float]
case class GetPRDouble[U]() extends DeltaIOA[U, Double]
case class Put[U, T <: U](create: Id[T] => DeltaIO[U, T]) extends DeltaIOA[U, T]
type DeltaIO[U, A] = Free[({ type T[X] = DeltaIOA[U, X] })#T, A]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment