Options
All
  • Public
  • Public/Protected
  • All
Menu

ts-cat

Index

Type aliases

IdentityURI

IdentityURI: URI

MaybeURI

MaybeURI: URI

Type

Type: URItoHKT<A>[URI]

Type2

Type2: URItoHKT2<A, B>[URI]

URI2s

URI2s: keyof URItoHKT2<any, any>

URIs

URIs: keyof URItoHKT<any>

Variables

Const IDENTITY_URI

IDENTITY_URI: "Identity" = URI

Const MAYBE_URI

MAYBE_URI: "Maybe" = URI

Const URI

URI: "Maybe" = "Maybe"

Object literals

Const identity

identity: object

The set of static functions which can be applied with Identity

category

Identity

ap

  • Apply a function wrapped by Identity to the value within another Identity.

    Type parameters

    • A

    • B

    Parameters

    • fab: Identity<function>

      A unary function wrapped by Identity.

    • fa: Identity<A>

      An identity containing the value to which the function will be applied.

    Returns Identity<B>

chain

  • Apply a function which returns Identity without adding structure.

    Type parameters

    • A

    • B

    Parameters

    • fa: function

      A unary function which returns an Identity

    • ma: Identity<A>

      An identity containing the value to which the function will be applied.

    Returns Identity<B>

map

  • Apply a function to the value within an Identity.

    Type parameters

    • A

    • B

    Parameters

    • f: function

      A unary function.

        • (a: A): B
        • Parameters

          • a: A

          Returns B

    • fa: Identity<A>

      An Identity containing the value to which the function will be applied.

    Returns Identity<B>

of

pure

Const maybe

maybe: object

The set of static functions which can be applied with Maybe

of

of: of = Maybe.of

Wrap a value with Maybe.

If the value is undefined or null, it will return "Nothing". Otherwise, it will return a "Just" containing the value.

param

pure

pure: of = Maybe.of

A common alias for of

alt

ap

  • Similar to map, but apply a function wrapped in Maybe.

    If either the function Maybe or this Maybe is "Nothing", then this will return "Nothing". Otherwise, the function will be applied to the value and return a Maybe.

    Type parameters

    • A

    • B

    Parameters

    • fab: Maybe<function>

      A unary function wrapped by Maybe

    • fa: Maybe<A>

    Returns Maybe<B>

chain

  • chain<A, B>(f: function, ma: Maybe<A>): Maybe<B>
  • Monadic binding. Apply a function which returns a Maybe without adding structure.

    Returns "Nothing" when the Maybe is "Nothing, or when the function applied to the value returns "Nothing". Otherwise, returns "Just" the result of the function: a Maybe of the value.

    Type parameters

    • A

    • B

    Parameters

    • f: function

      A unary function which returns a maybe

        • Parameters

          • a: A

          Returns Maybe<B>

    • ma: Maybe<A>

    Returns Maybe<B>

map

  • Apply a function to the value contained in Maybe

    If Maybe is "Nothing" then it will always return "Nothing". If Maybe is "Just" some value, the function will be applied to that value and returned as a Maybe.

    Type parameters

    • A

    • B

    Parameters

    • f: function

      A unary function

        • (a: A): B
        • Parameters

          • a: A

          Returns B

    • fa: Maybe<A>

    Returns Maybe<B>

zero

Generated using TypeDoc