Options
All
  • Public
  • Public/Protected
  • All
Menu

Type class laws defined for MonadError.

This is an abstract definition. In order to use it in unit testing, the implementor must think of a strategy to evaluate the truthiness of the returned Equiv values.

Even though in TypeScript the Funfix library is using classes to express these laws, when implementing this class it is recommended that you implement it as a mixin using implements, instead of extending it directly with extends. See TypeScript: Mixins for details and note that we already have applyMixins defined.

We are doing this in order to support multiple inheritance and to avoid inheriting any static members. In the Flow definitions (e.g. .js.flow files) for Funfix these classes are defined with interface, as they are meant to be interfaces that sometimes have default implementations and not classes.

Type parameters

  • F

  • E

Hierarchy

  • MonadErrorLaws

Implements

Index

Properties

F

F: MonadError<F, E>

The MonadError designated instance for F, to be tested.

applicativeComposition

applicativeComposition: function

Type declaration

    • <A, B, C>(fa: HK<F, A>, fab: HK<F, function>, fbc: HK<F, function>): Equiv<HK<F, C>>
    • Type parameters

      • A

      • B

      • C

      Parameters

      • fa: HK<F, A>
      • fab: HK<F, function>
      • fbc: HK<F, function>

      Returns Equiv<HK<F, C>>

applicativeErrorRecover

applicativeErrorRecover: function

Type declaration

    • <A>(e: E, f: function): Equiv<HK<F, A>>
    • Type parameters

      • A

      Parameters

      • e: E
      • f: function
          • (e: E): A
          • Parameters

            • e: E

            Returns A

      Returns Equiv<HK<F, A>>

applicativeErrorRecoverWith

applicativeErrorRecoverWith: function

Type declaration

    • <A>(e: E, f: function): Equiv<HK<F, A>>
    • Type parameters

      • A

      Parameters

      • e: E
      • f: function
          • (e: E): HK<F, A>
          • Parameters

            • e: E

            Returns HK<F, A>

      Returns Equiv<HK<F, A>>

applicativeHomomorphism

applicativeHomomorphism: function

Type declaration

    • <A, B>(a: A, f: function): Equiv<HK<F, B>>
    • Type parameters

      • A

      • B

      Parameters

      • a: A
      • f: function
          • (a: A): B
          • Parameters

            • a: A

            Returns B

      Returns Equiv<HK<F, B>>

applicativeIdentity

applicativeIdentity: function

Type declaration

    • Type parameters

      • A

      Parameters

      • fa: HK<F, A>

      Returns Equiv<HK<F, A>>

applicativeInterchange

applicativeInterchange: function

Type declaration

    • <A, B>(a: A, ff: HK<F, function>): Equiv<HK<F, B>>
    • Type parameters

      • A

      • B

      Parameters

      • a: A
      • ff: HK<F, function>

      Returns Equiv<HK<F, B>>

applicativeMap

applicativeMap: function

Type declaration

    • <A, B>(fa: HK<F, A>, f: function): Equiv<HK<F, B>>
    • Type parameters

      • A

      • B

      Parameters

      • fa: HK<F, A>
      • f: function
          • (a: A): B
          • Parameters

            • a: A

            Returns B

      Returns Equiv<HK<F, B>>

applicativeUnit

applicativeUnit: function

Type declaration

    • Type parameters

      • A

      Parameters

      • a: A

      Returns Equiv<HK<F, A>>

applyComposition

applyComposition: function

Type declaration

    • <A, B, C>(fa: HK<F, A>, fab: HK<F, function>, fbc: HK<F, function>): Equiv<HK<F, C>>
    • Type parameters

      • A

      • B

      • C

      Parameters

      • fa: HK<F, A>
      • fab: HK<F, function>
      • fbc: HK<F, function>

      Returns Equiv<HK<F, C>>

applyMap2Consistency

applyMap2Consistency: function

Type declaration

    • <A, B>(fa: HK<F, A>, f: HK<F, function>): Equiv<HK<F, B>>
    • Type parameters

      • A

      • B

      Parameters

      • fa: HK<F, A>
      • f: HK<F, function>

      Returns Equiv<HK<F, B>>

applyProductConsistency

applyProductConsistency: function

Type declaration

    • <A, B>(fa: HK<F, A>, f: HK<F, function>): Equiv<HK<F, B>>
    • Type parameters

      • A

      • B

      Parameters

      • fa: HK<F, A>
      • f: HK<F, function>

      Returns Equiv<HK<F, B>>

covariantComposition

covariantComposition: function

Type declaration

    • <A, B, C>(fa: HK<F, A>, f: function, g: function): Equiv<HK<F, C>>
    • Type parameters

      • A

      • B

      • C

      Parameters

      • fa: HK<F, A>
      • f: function
          • (a: A): B
          • Parameters

            • a: A

            Returns B

      • g: function
          • (b: B): C
          • Parameters

            • b: B

            Returns C

      Returns Equiv<HK<F, C>>

covariantIdentity

covariantIdentity: function

Type declaration

    • Type parameters

      • A

      Parameters

      • fa: HK<F, A>

      Returns Equiv<HK<F, A>>

flatMapAssociativity

flatMapAssociativity: function

Type declaration

    • <A, B, C>(fa: HK<F, A>, f: function, g: function): Equiv<HK<F, C>>
    • Type parameters

      • A

      • B

      • C

      Parameters

      • fa: HK<F, A>
      • f: function
          • (a: A): HK<F, B>
          • Parameters

            • a: A

            Returns HK<F, B>

      • g: function
          • (b: B): HK<F, C>
          • Parameters

            • b: B

            Returns HK<F, C>

      Returns Equiv<HK<F, C>>

flatMapConsistentApply

flatMapConsistentApply: function

Type declaration

    • <A, B>(fa: HK<F, A>, fab: HK<F, function>): Equiv<HK<F, B>>
    • Type parameters

      • A

      • B

      Parameters

      • fa: HK<F, A>
      • fab: HK<F, function>

      Returns Equiv<HK<F, B>>

followedByConsistency

followedByConsistency: function

Type declaration

    • Type parameters

      • A

      • B

      Parameters

      • fa: HK<F, A>
      • fb: HK<F, B>

      Returns Equiv<HK<F, B>>

followedByLConsistency

followedByLConsistency: function

Type declaration

    • Type parameters

      • A

      • B

      Parameters

      • fa: HK<F, A>
      • fb: HK<F, B>

      Returns Equiv<HK<F, B>>

forEffectConsistency

forEffectConsistency: function

Type declaration

    • Type parameters

      • A

      • B

      Parameters

      • fa: HK<F, A>
      • fb: HK<F, B>

      Returns Equiv<HK<F, A>>

forEffectLConsistency

forEffectLConsistency: function

Type declaration

    • Type parameters

      • A

      • B

      Parameters

      • fa: HK<F, A>
      • fb: HK<F, B>

      Returns Equiv<HK<F, A>>

mapFlatMapCoherence

mapFlatMapCoherence: function

Type declaration

    • <A, B>(fa: HK<F, A>, f: function): Equiv<HK<F, B>>
    • Type parameters

      • A

      • B

      Parameters

      • fa: HK<F, A>
      • f: function
          • (a: A): B
          • Parameters

            • a: A

            Returns B

      Returns Equiv<HK<F, B>>

monadLeftIdentity

monadLeftIdentity: function

Type declaration

    • <A, B>(a: A, f: function): Equiv<HK<F, B>>
    • Type parameters

      • A

      • B

      Parameters

      • a: A
      • f: function
          • (a: A): HK<F, B>
          • Parameters

            • a: A

            Returns HK<F, B>

      Returns Equiv<HK<F, B>>

monadRightIdentity

monadRightIdentity: function

Type declaration

    • Type parameters

      • A

      • B

      Parameters

      • fa: HK<F, A>

      Returns Equiv<HK<F, A>>

pureAttempt

pureAttempt: function

Type declaration

    • <A>(a: A): Equiv<HK<F, Either<E, A>>>
    • Type parameters

      • A

      Parameters

      • a: A

      Returns Equiv<HK<F, Either<E, A>>>

raiseErrorAttempt

raiseErrorAttempt: function

Type declaration

    • (e: E): Equiv<HK<F, Either<E, void>>>
    • Parameters

      • e: E

      Returns Equiv<HK<F, Either<E, void>>>

recoverPure

recoverPure: function

Type declaration

    • <A>(a: A, f: function): Equiv<HK<F, A>>
    • Type parameters

      • A

      Parameters

      • a: A
      • f: function
          • (e: E): A
          • Parameters

            • e: E

            Returns A

      Returns Equiv<HK<F, A>>

recoverWithPure

recoverWithPure: function

Type declaration

    • <A>(a: A, f: function): Equiv<HK<F, A>>
    • Type parameters

      • A

      Parameters

      • a: A
      • f: function
          • (e: E): HK<F, A>
          • Parameters

            • e: E

            Returns HK<F, A>

      Returns Equiv<HK<F, A>>

tailRecMConsistentFlatMap

tailRecMConsistentFlatMap: function

Type declaration

    • <A>(a: A, f: function): Equiv<HK<F, A>>
    • Type parameters

      • A

      Parameters

      • a: A
      • f: function
          • (a: A): HK<F, A>
          • Parameters

            • a: A

            Returns HK<F, A>

      Returns Equiv<HK<F, A>>

tailRecMStackSafety

tailRecMStackSafety: function

Type declaration

Methods

monadErrorLeftZero

  • monadErrorLeftZero<A, B>(e: E, f: function): Equiv<HK<F, B>>
  • Type parameters

    • A

    • B

    Parameters

    • e: E
    • f: function
        • (a: A): HK<F, B>
        • Parameters

          • a: A

          Returns HK<F, B>

    Returns Equiv<HK<F, B>>

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc