package opium_kernel

  1. Overview
  2. Docs

A filter is a higher order function that transforms a service into another service.

A filter is a higher order function that transforms a service into another service.

type ('req, 'rep, 'req', 'rep') t = ('req, 'rep) Rock.Service.t -> ('req', 'rep') Rock.Service.t
val sexp_of_t : ('req -> Ppx_sexp_conv_lib.Sexp.t) -> ('rep -> Ppx_sexp_conv_lib.Sexp.t) -> ('req' -> Ppx_sexp_conv_lib.Sexp.t) -> ('rep' -> Ppx_sexp_conv_lib.Sexp.t) -> ('req, 'rep, 'req', 'rep') t -> Ppx_sexp_conv_lib.Sexp.t
val t_of_sexp : (Ppx_sexp_conv_lib.Sexp.t -> 'req) -> (Ppx_sexp_conv_lib.Sexp.t -> 'rep) -> (Ppx_sexp_conv_lib.Sexp.t -> 'req') -> (Ppx_sexp_conv_lib.Sexp.t -> 'rep') -> Ppx_sexp_conv_lib.Sexp.t -> ('req, 'rep, 'req', 'rep') t
type ('req, 'rep) simple = ('req, 'rep, 'req, 'rep) t

A filter is simple when it preserves the type of a service

val sexp_of_simple : ('req -> Ppx_sexp_conv_lib.Sexp.t) -> ('rep -> Ppx_sexp_conv_lib.Sexp.t) -> ('req, 'rep) simple -> Ppx_sexp_conv_lib.Sexp.t
val simple_of_sexp : (Ppx_sexp_conv_lib.Sexp.t -> 'req) -> (Ppx_sexp_conv_lib.Sexp.t -> 'rep) -> Ppx_sexp_conv_lib.Sexp.t -> ('req, 'rep) simple
val id : ('req, 'rep) simple
val (>>>) : ('q1, 'p1, 'q2, 'p2) t -> ('q2, 'p2, 'q3, 'p3) t -> ('q1, 'p1, 'q3, 'p3) t
val apply_all : ('req, 'rep) simple list -> ('req, 'rep) Rock.Service.t -> ('req, 'rep) Rock.Service.t