com.jnape.palatable.lambda.functions.builtin.fn2

## Class ToMap<K,V,M extends Map<K,V>>

- java.lang.Object
- - com.jnape.palatable.lambda.functions.builtin.fn2.ToMap<K,V,M>

- Type Parameters:
    `K` - the key element type
    `V` - the value element type
    `M` - the resulting map type
  All Implemented Interfaces:
    Fn1<Fn0<M>,Fn1<Iterable<? extends Map.Entry<K,V>>,M>>, Fn2<Fn0<M>,Iterable<? extends Map.Entry<K,V>>,M>, Applicative<Fn1<Iterable<? extends Map.Entry<K,V>>,M>,Fn1<Fn0<M>,?>>, Cartesian<Fn0<M>,Fn1<Iterable<? extends Map.Entry<K,V>>,M>,Fn1<?,?>>, Cocartesian<Fn0<M>,Fn1<Iterable<? extends Map.Entry<K,V>>,M>,Fn1<?,?>>, Contravariant<Fn0<M>,Profunctor<?,Fn1<Iterable<? extends Map.Entry<K,V>>,M>,Fn1<?,?>>>, Functor<Fn1<Iterable<? extends Map.Entry<K,V>>,M>,Fn1<Fn0<M>,?>>, Profunctor<Fn0<M>,Fn1<Iterable<? extends Map.Entry<K,V>>,M>,Fn1<?,?>>, Monad<Fn1<Iterable<? extends Map.Entry<K,V>>,M>,Fn1<Fn0<M>,?>>, MonadReader<Fn0<M>,Fn1<Iterable<? extends Map.Entry<K,V>>,M>,Fn1<Fn0<M>,?>>, MonadRec<Fn1<Iterable<? extends Map.Entry<K,V>>,M>,Fn1<Fn0<M>,?>>, MonadWriter<Fn0<M>,Fn1<Iterable<? extends Map.Entry<K,V>>,M>,Fn1<Fn0<M>,?>>

      public final class ToMap<K,V,M extends Map<K,V>>
      extends Object
      implements Fn2<Fn0<M>,Iterable<? extends Map.Entry<K,V>>,M>

  Given an `Fn0` of some `Map` `M`, create an instance of `M` and put all of the entries in the provided `Iterable` into the instance. Note that instances of `M` must support `Map.put(K, V)` (which is to say, must not throw on invocation).

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `M` | `checkedApply(Fn0<M> mFn0, Iterable<? extends Map.Entry<K,V>> entries)`
    `static <K,V,M extends Map<K,V>> ToMap<K,V,M>` | `toMap()`
    `static <K,V,M extends Map<K,V>> Fn1<Iterable<? extends Map.Entry<K,V>>,M>` | `toMap(Fn0<M> mFn0)`
    `static <K,V,M extends Map<K,V>> M` | `toMap(Fn0<M> mFn0, Iterable<? extends Map.Entry<K,V>> entries)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.jnape.palatable.lambda.functions.Fn2

      `apply, apply, checkedApply, compose, contraMap, curried, curry, diMapL, discardR, flip, fn2, fromBiFunction, toBiFunction, uncurry, widen`

    - ### Methods inherited from interface com.jnape.palatable.lambda.functions.Fn1

      `andThen, carry, cartesian, censor, choose, cocartesian, diMap, diMapR, discardL, flatMap, fmap, fn1, fromFunction, lazyZip, listens, local, pure, pureFn1, thunk, toFunction, trampolineM, zip, zip`

    - ### Methods inherited from interface com.jnape.palatable.lambda.monad.Monad

      `join`

    - ### Methods inherited from interface com.jnape.palatable.lambda.functor.Functor

      `coerce`

- - ### Method Detail

    - #### checkedApply

          public M checkedApply(Fn0<M> mFn0,
                                Iterable<? extends Map.Entry<K,V>> entries)

      Specified by:
        `checkedApply` in interface `Fn2<Fn0<M extends Map<K,V>>,Iterable<? extends Map.Entry<K,V>>,M extends Map<K,V>>`

    - #### toMap

          public static <K,V,M extends Map<K,V>> ToMap<K,V,M> toMap()

    - #### toMap

          public static <K,V,M extends Map<K,V>> Fn1<Iterable<? extends Map.Entry<K,V>>,M> toMap(Fn0<M> mFn0)

    - #### toMap

          public static <K,V,M extends Map<K,V>> M toMap(Fn0<M> mFn0,
                                                         Iterable<? extends Map.Entry<K,V>> entries)