- FunctorExtensions
- IgnoreF <F, A> (this K<F, A> fa)
- SelectMany <F, A, C> ( this K<F, A> ma, Func<A, Guard<Error, Unit>> bind, Func<A, Unit, C> project)
- SelectMany <F, A, C> ( this K<F, A> ma, Func<A, Guard<Fail<Error>, Unit>> bind, Func<A, Unit, C> project)
- SelectMany <F, B, C> ( this Guard<Error, Unit> ma, Func<Unit, K<F, B>> bind, Func<Unit, B, C> project)
- SelectMany <F, B, C> ( this Guard<Fail<Error>, Unit> ma, Func<Unit, K<F, B>> bind, Func<Unit, B, C> project)
- Map <Fnctr, A, B> ( this K<Fnctr, A> ma, Func<A, B> f)
- Map <Fnctr, A, B> ( this K<Fnctr, A> ma, B value)
- Select <Fnctr, A, B> ( this K<Fnctr, A> ma, Func<A, B> f)
- Map <Fnctr, A, B> ( this Func<A, B> f, K<Fnctr, A> ma)
- Map <Fnctr, A, B, C> ( this Func<A, B, C> f, K<Fnctr, A> ma)
- Map <Fnctr, A, B, C, D> ( this Func<A, B, C, D> f, K<Fnctr, A> ma)
- Map <Fnctr, A, B, C, D, E> ( this Func<A, B, C, D, E> f, K<Fnctr, A> ma)
- Map <Fnctr, A, B, C, D, E, F> ( this Func<A, B, C, D, E, F> f, K<Fnctr, A> ma)
- Map <Fnctr, A, B, C, D, E, F, G> ( this Func<A, B, C, D, E, F, G> f, K<Fnctr, A> ma)
- Map <Fnctr, A, B, C, D, E, F, G, H> ( this Func<A, B, C, D, E, F, G, H> f, K<Fnctr, A> ma)
- Map <Fnctr, A, B, C, D, E, F, G, H, I> ( this Func<A, B, C, D, E, F, G, H, I> f, K<Fnctr, A> ma)
- Map <Fnctr, A, B, C, D, E, F, G, H, I, J> ( this Func<A, B, C, D, E, F, G, H, I, J> f, K<Fnctr, A> ma)
- Map <Fnctr, A, B, C, D, E, F, G, H, I, J, K> ( this Func<A, B, C, D, E, F, G, H, I, J, K> f, K<Fnctr, A> ma)
- FunctorExtensions
- FunctorLaw <F>
- assert (K<F, int> fa, Func<K<F, int>, K<F, int>, bool>? equals = null)
- validate (K<F, int> fa, Func<K<F, int>, K<F, int>, bool>? equals = null)
- identityLaw (K<F, int> lhs, Func<K<F, int>, K<F, int>, bool> equals)
- compositionLaw ( K<F, int> fa, Func<int, int> f, Func<int, int> g, Func<K<F, int>, K<F, int>, bool> equals)
- Functor
- Prelude
- ignore <F, A> (K<F, A> fa)
- map <Fnctr, A, B> ( Func<A, B> f, K<Fnctr, A> ma)
- map <Fnctr, A, B, C> ( Func<A, B, C> f, K<Fnctr, A> ma)
- map <Fnctr, A, B, C, D> ( Func<A, B, C, D> f, K<Fnctr, A> ma)
- map <Fnctr, A, B, C, D, E> ( Func<A, B, C, D, E> f, K<Fnctr, A> ma)
- map <Fnctr, A, B, C, D, E, F> ( Func<A, B, C, D, E, F> f, K<Fnctr, A> ma)
- map <Fnctr, A, B, C, D, E, F, G> ( Func<A, B, C, D, E, F, G> f, K<Fnctr, A> ma)
- map <Fnctr, A, B, C, D, E, F, G, H> ( Func<A, B, C, D, E, F, G, H> f, K<Fnctr, A> ma)
- map <Fnctr, A, B, C, D, E, F, G, H, I> ( Func<A, B, C, D, E, F, G, H, I> f, K<Fnctr, A> ma)
- map <Fnctr, A, B, C, D, E, F, G, H, I, J> ( Func<A, B, C, D, E, F, G, H, I, J> f, K<Fnctr, A> ma)
- map <Fnctr, A, B, C, D, E, F, G, H, I, J, K> ( Func<A, B, C, D, E, F, G, H, I, J, K> f, K<Fnctr, A> ma)
- Functor <F>
class FunctorExtensions Source #
method K<F, Unit> IgnoreF <F, A> (this K<F, A> fa) Source #
Ignores the bound value result and instead maps it to Unit
type | F | Functor trait |
type | A | Bound value type |
param | fa | Functor that returns a bound value that should be ignored |
returns | Functor with unit bound value |
method K<F, C> SelectMany <F, A, C> ( this K<F, A> ma, Func<A, Guard<Error, Unit>> bind, Func<A, Unit, C> project) Source #
Monad bind operation
type | F | Functor trait |
type | A | Initial bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns | M |
method K<F, C> SelectMany <F, A, C> ( this K<F, A> ma, Func<A, Guard<Fail<Error>, Unit>> bind, Func<A, Unit, C> project) Source #
Monad bind operation
type | F | Functor trait |
type | A | Initial bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns | M |
method K<F, C> SelectMany <F, B, C> ( this Guard<Error, Unit> ma, Func<Unit, K<F, B>> bind, Func<Unit, B, C> project) Source #
Monad bind operation
type | F | Functor trait |
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns | M |
method K<F, C> SelectMany <F, B, C> ( this Guard<Fail<Error>, Unit> ma, Func<Unit, K<F, B>> bind, Func<Unit, B, C> project) Source #
Monad bind operation
type | F | Functor trait |
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns | M |
method K<Fnctr, B> Map <Fnctr, A, B> ( this K<Fnctr, A> ma, Func<A, B> f) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
type | Fnctr | Trait of the functor |
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method K<Fnctr, B> Map <Fnctr, A, B> ( this K<Fnctr, A> ma, B value) Source #
Functor map operation
Invokes the functor, extracting its bound value, which it then ignores and
then maps to the default value
provided. This is useful for side-effecting
monads that have an effect on the world, which the result value can be ignored,
to then return a default.
type | Fnctr | Trait of the functor |
param | ma | Functor to map |
param | value | Ignore the bound value and map to this |
returns | Mapped functor |
method K<Fnctr, B> Select <Fnctr, A, B> ( this K<Fnctr, A> ma, Func<A, B> f) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
type | Fnctr | Trait of the functor |
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method K<Fnctr, B> Map <Fnctr, A, B> ( this Func<A, B> f, K<Fnctr, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
type | Fnctr | Trait of the functor |
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method K<Fnctr, Func<B, C>> Map <Fnctr, A, B, C> ( this Func<A, B, C> f, K<Fnctr, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
This variant takes the passed function and partially applies it, so the result is a
functor within the value being the partially applied function. If Fnctr
is also an
Applicative
, which is often the case, you can provide further arguments to the
partially applied function by calling .Apply()
on the resulting functor.
You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.
type | Fnctr | Trait of the functor |
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method K<Fnctr, Func<B, Func<C, D>>> Map <Fnctr, A, B, C, D> ( this Func<A, B, C, D> f, K<Fnctr, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
This variant takes the passed function and partially applies it, so the result is a
functor within the value being the partially applied function. If Fnctr
is also an
Applicative
, which is often the case, you can provide further arguments to the
partially applied function by calling .Apply()
on the resulting functor.
You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.
type | Fnctr | Trait of the functor |
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method K<Fnctr, Func<B, Func<C, Func<D, E>>>> Map <Fnctr, A, B, C, D, E> ( this Func<A, B, C, D, E> f, K<Fnctr, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
This variant takes the passed function and partially applies it, so the result is a
functor within the value being the partially applied function. If Fnctr
is also an
Applicative
, which is often the case, you can provide further arguments to the
partially applied function by calling .Apply()
on the resulting functor.
You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.
type | Fnctr | Trait of the functor |
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method K<Fnctr, Func<B, Func<C, Func<D, Func<E, F>>>>> Map <Fnctr, A, B, C, D, E, F> ( this Func<A, B, C, D, E, F> f, K<Fnctr, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
This variant takes the passed function and partially applies it, so the result is a
functor within the value being the partially applied function. If Fnctr
is also an
Applicative
, which is often the case, you can provide further arguments to the
partially applied function by calling .Apply()
on the resulting functor.
You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.
type | Fnctr | Trait of the functor |
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method K<Fnctr, Func<B, Func<C, Func<D, Func<E, Func<F, G>>>>>> Map <Fnctr, A, B, C, D, E, F, G> ( this Func<A, B, C, D, E, F, G> f, K<Fnctr, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
This variant takes the passed function and partially applies it, so the result is a
functor within the value being the partially applied function. If Fnctr
is also an
Applicative
, which is often the case, you can provide further arguments to the
partially applied function by calling .Apply()
on the resulting functor.
You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.
type | Fnctr | Trait of the functor |
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method K<Fnctr, Func<B, Func<C, Func<D, Func<E, Func<F, Func<G, H>>>>>>> Map <Fnctr, A, B, C, D, E, F, G, H> ( this Func<A, B, C, D, E, F, G, H> f, K<Fnctr, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
This variant takes the passed function and partially applies it, so the result is a
functor within the value being the partially applied function. If Fnctr
is also an
Applicative
, which is often the case, you can provide further arguments to the
partially applied function by calling .Apply()
on the resulting functor.
You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.
type | Fnctr | Trait of the functor |
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method K<Fnctr, Func<B, Func<C, Func<D, Func<E, Func<F, Func<G, Func<H, I>>>>>>>> Map <Fnctr, A, B, C, D, E, F, G, H, I> ( this Func<A, B, C, D, E, F, G, H, I> f, K<Fnctr, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
This variant takes the passed function and partially applies it, so the result is a
functor within the value being the partially applied function. If Fnctr
is also an
Applicative
, which is often the case, you can provide further arguments to the
partially applied function by calling .Apply()
on the resulting functor.
You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.
type | Fnctr | Trait of the functor |
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method K<Fnctr, Func<B, Func<C, Func<D, Func<E, Func<F, Func<G, Func<H, Func<I, J>>>>>>>>> Map <Fnctr, A, B, C, D, E, F, G, H, I, J> ( this Func<A, B, C, D, E, F, G, H, I, J> f, K<Fnctr, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
This variant takes the passed function and partially applies it, so the result is a
functor within the value being the partially applied function. If Fnctr
is also an
Applicative
, which is often the case, you can provide further arguments to the
partially applied function by calling .Apply()
on the resulting functor.
You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.
type | Fnctr | Trait of the functor |
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method K<Fnctr, Func<B, Func<C, Func<D, Func<E, Func<F, Func<G, Func<H, Func<I, Func<J, K>>>>>>>>>> Map <Fnctr, A, B, C, D, E, F, G, H, I, J, K> ( this Func<A, B, C, D, E, F, G, H, I, J, K> f, K<Fnctr, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
This variant takes the passed function and partially applies it, so the result is a
functor within the value being the partially applied function. If Fnctr
is also an
Applicative
, which is often the case, you can provide further arguments to the
partially applied function by calling .Apply()
on the resulting functor.
You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.
type | Fnctr | Trait of the functor |
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
class FunctorExtensions Source #
method K<M, K<N, B>> MapT <M, N, A, B> (this K<M, K<N, A>> mna, Func<A, B> f) Source #
Runs a functor map operation on the nested functors
If you're working with an inner functor that is concrete then you will first need to
call KindT
to cast the functor to a more general K
version. This enables the
T
variant extensions (like BindT
, `MapT, etc.) to work without providing
excessive generic arguments all the way down the chain.
type | NA |
|
type | M | Outer functor trait |
type | N | Inner functor trait |
type | A | Input bound value |
type | B | Output bound value |
param | mna | Nested functor value |
param | f | Bind function |
returns | Mapped value |
var mx = Seq<Option
var ma = mx.KindT<Seq, Option, Option
class FunctorLaw <F> Source #
Functions that test that functor-laws hold for the F
functor provided.
NOTE: Equals
must be implemented for the K<F, *>
derived-type, so that the laws
can be proven to be true. If your functor doesn't have Equals
then you must provide
the optional equals
parameter so that the equality of outcomes can be tested.
type | F | Functor type |
method Unit assert (K<F, int> fa, Func<K<F, int>, K<F, int>, bool>? equals = null) Source #
Assert that the functor laws hold
NOTE: Equals
must be implemented for the K<F, *>
derived-type, so that the laws
can be proven to be true. If your functor doesn't have Equals
then you must provide
the optional equals
parameter so that the equality of outcomes can be tested.
method Validation<Error, Unit> validate (K<F, int> fa, Func<K<F, int>, K<F, int>, bool>? equals = null) Source #
Validate that the functor laws hold
NOTE: Equals
must be implemented for the K<F, *>
derived-type, so that the laws
can be proven to be true. If your functor doesn't have Equals
then you must provide
the optional equals
parameter so that the equality of outcomes can be tested.
method Validation<Error, Unit> identityLaw (K<F, int> lhs, Func<K<F, int>, K<F, int>, bool> equals) Source #
Validate the identity law
NOTE: Equals
must be implemented for the K<F, *>
derived-type, so that the laws
can be proven to be true. If your functor doesn't have Equals
then you must provide
the optional equals
parameter so that the equality of outcomes can be tested.
method Validation<Error, Unit> compositionLaw ( K<F, int> fa, Func<int, int> f, Func<int, int> g, Func<K<F, int>, K<F, int>, bool> equals) Source #
Validate the composition law
NOTE: Equals
must be implemented for the K<F, *>
derived-type, so that the laws
can be proven to be true. If your functor doesn't have Equals
then you must provide
the optional equals
parameter so that the equality of outcomes can be tested.
Functor module
method K<F, Unit> ignore <F, A> (K<F, A> fa) Source #
Ignores the bound value result and instead maps it to Unit
type | F | Functor trait |
type | A | Bound value type |
param | fa | Functor that returns a bound value that should be ignored |
returns | Functor with unit bound value |
method K<Fnctr, B> map <Fnctr, A, B> ( Func<A, B> f, K<Fnctr, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
type | Fnctr | Trait of the functor |
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method K<Fnctr, Func<B, C>> map <Fnctr, A, B, C> ( Func<A, B, C> f, K<Fnctr, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
This variant takes the passed function and partially applies it, so the result is a
functor within the value being the partially applied function. If Fnctr
is also an
Applicative
, which is often the case, you can provide further arguments to the
partially applied function by calling .Apply()
on the resulting functor.
You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.
type | Fnctr | Trait of the functor |
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method K<Fnctr, Func<B, Func<C, D>>> map <Fnctr, A, B, C, D> ( Func<A, B, C, D> f, K<Fnctr, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
This variant takes the passed function and partially applies it, so the result is a
functor within the value being the partially applied function. If Fnctr
is also an
Applicative
, which is often the case, you can provide further arguments to the
partially applied function by calling .Apply()
on the resulting functor.
You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.
type | Fnctr | Trait of the functor |
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method K<Fnctr, Func<B, Func<C, Func<D, E>>>> map <Fnctr, A, B, C, D, E> ( Func<A, B, C, D, E> f, K<Fnctr, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
This variant takes the passed function and partially applies it, so the result is a
functor within the value being the partially applied function. If Fnctr
is also an
Applicative
, which is often the case, you can provide further arguments to the
partially applied function by calling .Apply()
on the resulting functor.
You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.
type | Fnctr | Trait of the functor |
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method K<Fnctr, Func<B, Func<C, Func<D, Func<E, F>>>>> map <Fnctr, A, B, C, D, E, F> ( Func<A, B, C, D, E, F> f, K<Fnctr, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
This variant takes the passed function and partially applies it, so the result is a
functor within the value being the partially applied function. If Fnctr
is also an
Applicative
, which is often the case, you can provide further arguments to the
partially applied function by calling .Apply()
on the resulting functor.
You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.
type | Fnctr | Trait of the functor |
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method K<Fnctr, Func<B, Func<C, Func<D, Func<E, Func<F, G>>>>>> map <Fnctr, A, B, C, D, E, F, G> ( Func<A, B, C, D, E, F, G> f, K<Fnctr, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
This variant takes the passed function and partially applies it, so the result is a
functor within the value being the partially applied function. If Fnctr
is also an
Applicative
, which is often the case, you can provide further arguments to the
partially applied function by calling .Apply()
on the resulting functor.
You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.
type | Fnctr | Trait of the functor |
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method K<Fnctr, Func<B, Func<C, Func<D, Func<E, Func<F, Func<G, H>>>>>>> map <Fnctr, A, B, C, D, E, F, G, H> ( Func<A, B, C, D, E, F, G, H> f, K<Fnctr, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
This variant takes the passed function and partially applies it, so the result is a
functor within the value being the partially applied function. If Fnctr
is also an
Applicative
, which is often the case, you can provide further arguments to the
partially applied function by calling .Apply()
on the resulting functor.
You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.
type | Fnctr | Trait of the functor |
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method K<Fnctr, Func<B, Func<C, Func<D, Func<E, Func<F, Func<G, Func<H, I>>>>>>>> map <Fnctr, A, B, C, D, E, F, G, H, I> ( Func<A, B, C, D, E, F, G, H, I> f, K<Fnctr, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
This variant takes the passed function and partially applies it, so the result is a
functor within the value being the partially applied function. If Fnctr
is also an
Applicative
, which is often the case, you can provide further arguments to the
partially applied function by calling .Apply()
on the resulting functor.
You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.
type | Fnctr | Trait of the functor |
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method K<Fnctr, Func<B, Func<C, Func<D, Func<E, Func<F, Func<G, Func<H, Func<I, J>>>>>>>>> map <Fnctr, A, B, C, D, E, F, G, H, I, J> ( Func<A, B, C, D, E, F, G, H, I, J> f, K<Fnctr, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
This variant takes the passed function and partially applies it, so the result is a
functor within the value being the partially applied function. If Fnctr
is also an
Applicative
, which is often the case, you can provide further arguments to the
partially applied function by calling .Apply()
on the resulting functor.
You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.
type | Fnctr | Trait of the functor |
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method K<Fnctr, Func<B, Func<C, Func<D, Func<E, Func<F, Func<G, Func<H, Func<I, Func<J, K>>>>>>>>>> map <Fnctr, A, B, C, D, E, F, G, H, I, J, K> ( Func<A, B, C, D, E, F, G, H, I, J, K> f, K<Fnctr, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
This variant takes the passed function and partially applies it, so the result is a
functor within the value being the partially applied function. If Fnctr
is also an
Applicative
, which is often the case, you can provide further arguments to the
partially applied function by calling .Apply()
on the resulting functor.
You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.
type | Fnctr | Trait of the functor |
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
interface Functor <F> Source #
Functor trait
Map
is used to apply a function of type Func<A, B>
to a value of type K<F, A>
where F
is a functor, to produce a value of type K<F, B>
.
Note that for any type with more than one parameter (e.g., Either
), only the
last type parameter can be modified with Map
(e.g. R
in Either<L, R>
).
Some types two generic parameters or more have a Bifunctor
instance that allows both
the last and the penultimate parameters to be mapped over.
type | F | Self referring type |
method K<F, B> Map <A, B> (Func<A, B> f, K<F, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
type | Fnctr | Trait of the functor |
param | f | Mapping function |
param | ma | Functor to map |
returns | Mapped functor |