endpoints4s

package endpoints4s

Type members

Classlikes

trait Codec[E, D] extends Decoder[E, D] with Encoder[D, E]

A way to encode and decode values

A way to encode and decode values

Type parameters:
D

Type of decoded values

E

Type of encoded values

Companion:
object
object Codec
Companion:
class
trait Decoder[-From, +To]

A way to decode a From value into a To value.

A way to decode a From value into a To value.

Companion:
object
object Decoder
Companion:
class
trait Encoder[-From, +To]

A way to encode a From value into a To value

A way to encode a From value into a To value

Companion:
object
object Encoder
Companion:
class
case class Invalid(errors: Seq[String]) extends Validated[Nothing]

A list of validation errors

A list of validation errors

Companion:
object
object Invalid
Companion:
class
trait InvariantFunctor[F[_]]

Defines ways to transform a given type constructor F

Defines ways to transform a given type constructor F

Provides extensions methods for values of type InvariantFunctor

Provides extensions methods for values of type InvariantFunctor

trait MultipleOf[A]

Type class that checks whether something is a multiple of another numeric value. Added since the std-lib Numeric does not have a modulo function.

Type class that checks whether something is a multiple of another numeric value. Added since the std-lib Numeric does not have a modulo function.

Companion:
object
object MultipleOf
Companion:
class
final class NumericConstraints[A] extends Serializable

Possible restrictions on the numeric value used. Needs an instance for Ordering to check whether values are valid w.r.t. to the properties.

Possible restrictions on the numeric value used. Needs an instance for Ordering to check whether values are valid w.r.t. to the properties.

Companion:
object
Companion:
class

Given a type constructor F, a partial function A => Validated[B] and a total function B => A, turns an F[A] into an F[B].

Given a type constructor F, a partial function A => Validated[B] and a total function B => A, turns an F[A] into an F[B].

A partial invariant functor is an invariant functor whose covariant transformation function is total (ie, A => Valid[B]).

Provides extension methods for values of type PartialInvariantFunctor

Provides extension methods for values of type PartialInvariantFunctor

trait Tupler[A, B]

Defines a strategy for tupling A and B values, according to types A and B.

Defines a strategy for tupling A and B values, according to types A and B.

The actual implementation avoids nested tuples and eliminates Unit, so that instead of ending with, e.g., the following type:

 ((Unit, Int), (((Unit, Unit), String)))

We just get:

 (Int, String)

The following rules are implemented (by increasing priority):

  • A, B -> (A, B)
  • A, (B, C) -> (A, B, C)
  • (A, B), C -> (A, B, C)
  • (A, B), (C, D) -> (A, B, C, D)
  • A, (B, C, D, E) -> (A, B, C, D, E)
  • (A, B), (C, D, E) -> (A, B, C, D, E)
  • (A, B, C), D -> (A, B, C, D)
  • (A, B, C, D), E -> (A, B, C, D, E)
  • (A, B, C, D, E), F -> (A, B, C, D, E, F)
  • A, Unit -> A
  • Unit, A -> A
Companion:
object
object Tupler extends Tupler5
Companion:
class
trait Tupler1
trait Tupler2 extends Tupler1
trait Tupler3 extends Tupler2
trait Tupler4 extends TuplerAppend
trait Tupler5 extends Tupler4
trait TuplerAppend extends Tupler3

Generated trait that provides Tupler instances for appending to tuples from 3 to 21 elements

Generated trait that provides Tupler instances for appending to tuples from 3 to 21 elements

case class Valid[+A](value: A) extends Validated[A]

A valid value of type A

A valid value of type A

sealed trait Validated[+A]

A validated value of type A can either be Valid or Invalid

A validated value of type A can either be Valid or Invalid

Type parameters:
A

Type of the validated value

Companion:
object
object Validated
Companion:
class