The `Monad` type class.

Allows composition of dependent effectful functions.

This type-class must support the `Applicative`, `Chain` and `ChainRec` algebras and obey the following laws:

1. Left identity: `M.chain(f, M.of(a)) <-> f(a)`
2. Right identity: `M.chain(M.of, u) <-> u`
3. Functor's `map` can be derived: `A.map = (f, u) => A.chain(x => A.of(f(x)), u)`

See Monads for functional programming, by Philip Wadler.

Equivalent with the `Monad` type-class in the Fantasy-Land and static-land specifications.

### Type parameters

- #### F

### Hierarchy

- Applicative<F>
- ChainRec<F>
  - Monad

## Index

### Methods

- ap
- chain
- chainRec
- map
- of

## Methods

### ap

- ap<A, B>(ff: HK<F, function>, fa: HK<F, A>): HK<F, B>

- Inherited from Apply.ap

  Overrides Apply.ap

  - Defined in apply.ts:31

  #### Type parameters

  - #### A

  - #### B

  #### Parameters

  - ##### ff: HK<F, function>

  - ##### fa: HK<F, A>

  #### Returns HK<F, B>

### chain

- chain<A, B>(f: function, fa: HK<F, A>): HK<F, B>

- Inherited from Chain.chain

  - Defined in chain.ts:39

  #### Type parameters

  - #### A

  - #### B

  #### Parameters

  - ##### f: function

    - - (a: A): HK<F, B>

      - #### Parameters

        - ##### a: A

        #### Returns HK<F, B>

  - ##### fa: HK<F, A>

  #### Returns HK<F, B>

### chainRec

- chainRec<A, B>(f: function, a: A): HK<F, B>

- Inherited from ChainRec.chainRec

  - Defined in chain-rec.ts:25

  #### Type parameters

  - #### A

  - #### B

  #### Parameters

  - ##### f: function

    - - <C>(next: function, done: function, a: A): HK<F, C>

      - #### Type parameters

        - #### C

        #### Parameters

        - ##### next: function

          - - (a: A): C

            - #### Parameters

              - ##### a: A

              #### Returns C

        - ##### done: function

          - - (b: B): C

            - #### Parameters

              - ##### b: B

              #### Returns C

        - ##### a: A

        #### Returns HK<F, C>

  - ##### a: A

  #### Returns HK<F, B>

### map

- map<A, B>(f: function, fa: HK<F, A>): HK<F, B>

- Inherited from Functor.map

  Overrides Functor.map

  - Defined in functor.ts:27

  #### Type parameters

  - #### A

  - #### B

  #### Parameters

  - ##### f: function

    - - (a: A): B

      - #### Parameters

        - ##### a: A

        #### Returns B

  - ##### fa: HK<F, A>

  #### Returns HK<F, B>

### of

- of<A>(a: A): HK<F, A>

- Inherited from Applicative.of

  - Defined in applicative.ts:45

  #### Type parameters

  - #### A

  #### Parameters

  - ##### a: A

  #### Returns HK<F, A>

Generated using TypeDoc