Type alias Transformation<A, B>

Transformation<A, B>: ((a) => B)

Type Parameters

  • A

    any type

  • B

    any type

Type declaration

    • (a): B
    • Type alias for simple transformations functions.

      A transformation takes a Value if type A and return a value of type B.

      Parameters

      • a: A

      Returns B

      Example

      // All the following are valid transformations
      const f1: Transformation = (a: number): string => a.toString()
      const f2: Transformation = (a: number): number => a + 2
      const f3: Transformation = (_a: string): object => ({color: 'red'})

Generated using TypeDoc