All Downloads are FREE. Search and download functionalities are using the official Maven repository.

aecor.encoding.WireProtocol.scala Maven / Gradle / Ivy

There is a newer version: 0.19.0
Show newest version
package aecor.encoding

import aecor.data.PairE
import aecor.encoding.WireProtocol.Invocation
import scodec.bits.BitVector
import scodec.{ Decoder, Encoder }

trait WireProtocol[M[_[_]]] {
  def decoder: Decoder[PairE[Invocation[M, ?], Encoder]]
  def encoder: M[WireProtocol.Encoded]
}

object WireProtocol {
  def apply[M[_[_]]](implicit M: WireProtocol[M]): WireProtocol[M] = M
  type Encoded[A] = (BitVector, Decoder[A])
  type Invocation[M[_[_]], A] = aecor.arrow.Invocation[M, A]
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy