Converter

object Converter

Advxml Created by geirolad on 31/10/2019.

class Object
trait Matchable
class Any

Value members

Concrete methods

def apply[A, B](implicit c: Converter[A, B]): Converter[A, B]

Apply conversion using implicit Converter instance. This method catch a Converter instance in the scope that conforms with types F, A and B and then invoke in it the method apply passing a.

Apply conversion using implicit Converter instance. This method catch a Converter instance in the scope that conforms with types F, A and B and then invoke in it the method apply passing a.

Type Params
A

Contravariant input type

B

Output object type

Value Params
c

implicit Converter instance

Returns

Safe conversion of A into B, express as F[B]

def const[A, B](b: B): Converter[A, B]

Create an always pure converter that return the passed value ignoring the converter input.

Create an always pure converter that return the passed value ignoring the converter input.

Type Params
B

inner output type

Value Params
b

Inner value returned when the Converter is invoked, the converter input is ignored.

Returns

Constant Converter instance

def constF[F[_], A, B](b: B)(implicit evidence$5: Applicative[F]): Converter[A, F[B]]

Create an always pure converter that return the passed value in F[_] ignoring the converter input.

Create an always pure converter that return the passed value in F[_] ignoring the converter input.

Type Params
B

inner output type

F

context

Value Params
b

Inner value returned when the Converter is invoked, the converter input is ignored.

Returns

Constant Converter instance

def id[A]: Converter[A, A]

Create an always pure converter that return the input instance.

Create an always pure converter that return the input instance.

Type Params
A

input and output type

Returns

Identity Converter instance

def idF[F[_], A](implicit evidence$4: Applicative[F]): Converter[A, F[A]]

Create an always pure converter that return the input instance wrapped in F.

Create an always pure converter that return the input instance wrapped in F.

Type Params
A

input and output type

F

context

Returns

Identity Converter instance

def of[A, B](f: A => B): Converter[A, B]

Create an instance of Converter

Create an instance of Converter

Type Params
A

Input type

B

Output type

Value Params
f

function to map input to output

Returns

Converter instance