LanguageExt.Core

LanguageExt.Core Prelude Lambda function inference

Contents

class Prelude Source #

Methods

method Func<R> fun <R> (Func<R> f) Source #

Func type inference helper

Try it with lambdas, instead of doing:

Func<int,int,int> add = (int x, int y) => x + y;

You can use this function and do:

var add = fun((int x, int y) => x + y);

Parameters

param f

Function to infer

returns

The same func you gave it, but allows the type system to work out what f is

method Func<T1, R> fun <T1, R> (Func<T1, R> f) Source #

Func type inference helper

Try it with lambdas, instead of doing:

Func<int,int,int> add = (int x, int y) => x + y;

You can use this function and do:

var add = fun((int x, int y) => x + y);

Parameters

param f

Function to infer

returns

The same func you gave it, but allows the type system to work out what f is

method Func<T1, T2, R> fun <T1, T2, R> (Func<T1, T2, R> f) Source #

Func type inference helper

Try it with lambdas, instead of doing:

Func<int,int,int> add = (int x, int y) => x + y;

You can use this function and do:

var add = fun((int x, int y) => x + y);

Parameters

param f

Function to infer

returns

The same func you gave it, but allows the type system to work out what f is

method Func<T1, T2, T3, R> fun <T1, T2, T3, R> (Func<T1, T2, T3, R> f) Source #

Func type inference helper

Try it with lambdas, instead of doing:

Func<int,int,int> add = (int x, int y) => x + y;

You can use this function and do:

var add = fun((int x, int y) => x + y);

Parameters

param f

Function to infer

returns

The same func you gave it, but allows the type system to work out what f is

method Func<T1, T2, T3, T4, R> fun <T1, T2, T3, T4, R> (Func<T1, T2, T3, T4, R> f) Source #

Func type inference helper

Try it with lambdas, instead of doing:

Func<int,int,int> add = (int x, int y) => x + y;

You can use this function and do:

var add = fun((int x, int y) => x + y);

Parameters

param f

Function to infer

returns

The same func you gave it, but allows the type system to work out what f is

method Func<T1, T2, T3, T4, T5, R> fun <T1, T2, T3, T4, T5, R> (Func<T1, T2, T3, T4, T5, R> f) Source #

Func type inference helper

Try it with lambdas, instead of doing:

Func<int,int,int> add = (int x, int y) => x + y;

You can use this function and do:

var add = fun((int x, int y) => x + y);

Parameters

param f

Function to infer

returns

The same func you gave it, but allows the type system to work out what f is

method Func<T1, T2, T3, T4, T5, T6, R> fun <T1, T2, T3, T4, T5, T6, R> (Func<T1, T2, T3, T4, T5, T6, R> f) Source #

Func type inference helper

Try it with lambdas, instead of doing:

Func<int,int,int> add = (int x, int y) => x + y;

You can use this function and do:

var add = fun((int x, int y) => x + y);

Parameters

param f

Function to infer

returns

The same func you gave it, but allows the type system to work out what f is

method Func<T1, T2, T3, T4, T5, T6, T7, R> fun <T1, T2, T3, T4, T5, T6, T7, R> (Func<T1, T2, T3, T4, T5, T6, T7, R> f) Source #

Func type inference helper

Try it with lambdas, instead of doing:

Func<int,int,int> add = (int x, int y) => x + y;

You can use this function and do:

var add = fun((int x, int y) => x + y);

Parameters

param f

Function to infer

returns

The same func you gave it, but allows the type system to work out what f is

method Func<T1, T2, T3, T4, T5, T6, T7, T8, R> fun <T1, T2, T3, T4, T5, T6, T7, T8, R> (Func<T1, T2, T3, T4, T5, T6, T7, T8, R> f) Source #

Func type inference helper

Try it with lambdas, instead of doing:

Func<int,int,int> add = (int x, int y) => x + y;

You can use this function and do:

var add = fun((int x, int y) => x + y);

Parameters

param f

Function to infer

returns

The same func you gave it, but allows the type system to work out what f is

method Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, R> fun <T1, T2, T3, T4, T5, T6, T7, T8, T9, R> (Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, R> f) Source #

Func type inference helper

Try it with lambdas, instead of doing:

Func<int,int,int> add = (int x, int y) => x + y;

You can use this function and do:

var add = fun((int x, int y) => x + y);

Parameters

param f

Function to infer

returns

The same func you gave it, but allows the type system to work out what f is

method Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R> fun <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R> (Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R> f) Source #

Func type inference helper

Try it with lambdas, instead of doing:

Func<int,int,int> add = (int x, int y) => x + y;

You can use this function and do:

var add = fun((int x, int y) => x + y);

Parameters

param f

Function to infer

returns

The same func you gave it, but allows the type system to work out what f is

method Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R> fun <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R> (Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R> f) Source #

Func type inference helper

Try it with lambdas, instead of doing:

Func<int,int,int> add = (int x, int y) => x + y;

You can use this function and do:

var add = fun((int x, int y) => x + y);

Parameters

param f

Function to infer

returns

The same func you gave it, but allows the type system to work out what f is

method Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R> fun <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R> (Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R> f) Source #

Func type inference helper

Try it with lambdas, instead of doing:

Func<int,int,int> add = (int x, int y) => x + y;

You can use this function and do:

var add = fun((int x, int y) => x + y);

Parameters

param f

Function to infer

returns

The same func you gave it, but allows the type system to work out what f is

method Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R> fun <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R> (Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R> f) Source #

Func type inference helper

Try it with lambdas, instead of doing:

Func<int,int,int> add = (int x, int y) => x + y;

You can use this function and do:

var add = fun((int x, int y) => x + y);

Parameters

param f

Function to infer

returns

The same func you gave it, but allows the type system to work out what f is

method Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R> fun <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R> (Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R> f) Source #

Func type inference helper

Try it with lambdas, instead of doing:

Func<int,int,int> add = (int x, int y) => x + y;

You can use this function and do:

var add = fun((int x, int y) => x + y);

Parameters

param f

Function to infer

returns

The same func you gave it, but allows the type system to work out what f is

method Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R> fun <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R> (Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R> f) Source #

Func type inference helper

Try it with lambdas, instead of doing:

Func<int,int,int> add = (int x, int y) => x + y;

You can use this function and do:

var add = fun((int x, int y) => x + y);

Parameters

param f

Function to infer

returns

The same func you gave it, but allows the type system to work out what f is

method Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R> fun <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R> (Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R> f) Source #

Func type inference helper

Try it with lambdas, instead of doing:

Func<int,int,int> add = (int x, int y) => x + y;

You can use this function and do:

var add = fun((int x, int y) => x + y);

Parameters

param f

Function to infer

returns

The same func you gave it, but allows the type system to work out what f is

method Func<Unit> fun (Action f) Source #

Action type inference helper and converts it to a Func that returns a Unit instead of void

Try it with lambdas, instead of doing:

Func<string,Unit> putStr = (string x) => { Console.WriteLine(x); return unit; }

You can use this function and do:

var putStr = fun((string x) => Console.WriteLine(x) );

Parameters

param f

Function to infer

returns

Func that returns a Unit

method Func<T1, Unit> fun <T1> (Action<T1> f) Source #

Action type inference helper and converts it to a Func that returns a Unit instead of void

Try it with lambdas, instead of doing:

Func<string,Unit> putStr = (string x) => { Console.WriteLine(x); return unit; }

You can use this function and do:

var putStr = fun((string x) => Console.WriteLine(x) );

Parameters

param f

Function to infer

returns

Func that returns a Unit

method Func<T1, T2, Unit> fun <T1, T2> (Action<T1, T2> f) Source #

Action type inference helper and converts it to a Func that returns a Unit instead of void

Try it with lambdas, instead of doing:

Func<string,Unit> putStr = (string x) => { Console.WriteLine(x); return unit; }

You can use this function and do:

var putStr = fun((string x) => Console.WriteLine(x) );

Parameters

param f

Function to infer

returns

Func that returns a Unit

method Func<T1, T2, T3, Unit> fun <T1, T2, T3> (Action<T1, T2, T3> f) Source #

Action type inference helper and converts it to a Func that returns a Unit instead of void

Try it with lambdas, instead of doing:

Func<string,Unit> putStr = (string x) => { Console.WriteLine(x); return unit; }

You can use this function and do:

var putStr = fun((string x) => Console.WriteLine(x) );

Parameters

param f

Function to infer

returns

Func that returns a Unit

method Func<T1, T2, T3, T4, Unit> fun <T1, T2, T3, T4> (Action<T1, T2, T3, T4> f) Source #

Action type inference helper and converts it to a Func that returns a Unit instead of void

Try it with lambdas, instead of doing:

Func<string,Unit> putStr = (string x) => { Console.WriteLine(x); return unit; }

You can use this function and do:

var putStr = fun((string x) => Console.WriteLine(x) );

Parameters

param f

Function to infer

returns

Func that returns a Unit

method Func<T1, T2, T3, T4, T5, Unit> fun <T1, T2, T3, T4, T5> (Action<T1, T2, T3, T4, T5> f) Source #

Action type inference helper and converts it to a Func that returns a Unit instead of void

Try it with lambdas, instead of doing:

Func<string,Unit> putStr = (string x) => { Console.WriteLine(x); return unit; }

You can use this function and do:

var putStr = fun((string x) => Console.WriteLine(x) );

Parameters

param f

Function to infer

returns

Func that returns a Unit

method Func<T1, T2, T3, T4, T5, T6, Unit> fun <T1, T2, T3, T4, T5, T6> (Action<T1, T2, T3, T4, T5, T6> f) Source #

Action type inference helper and converts it to a Func that returns a Unit instead of void

Try it with lambdas, instead of doing:

Func<string,Unit> putStr = (string x) => { Console.WriteLine(x); return unit; }

You can use this function and do:

var putStr = fun((string x) => Console.WriteLine(x) );

Parameters

param f

Function to infer

returns

Func that returns a Unit

method Func<T1, T2, T3, T4, T5, T6, T7, Unit> fun <T1, T2, T3, T4, T5, T6, T7> (Action<T1, T2, T3, T4, T5, T6, T7> f) Source #

Action type inference helper and converts it to a Func that returns a Unit instead of void

Try it with lambdas, instead of doing:

Func<string,Unit> putStr = (string x) => { Console.WriteLine(x); return unit; }

You can use this function and do:

var putStr = fun((string x) => Console.WriteLine(x) );

Parameters

param f

Function to infer

returns

Func that returns a Unit

method Action act (Action f) Source #

Action type inference helper

Try it with lambdas, instead of doing:

Action<string> putStr = (string x) => Console.WriteLine(x);

You can use this function and do:

var putStr = act((string x) => Console.WriteLine(x));

Parameters

param f

Action to infer

returns

The same Action you gave it, but allows the type system to work out what f is

method Action<T1> act <T1> (Action<T1> f) Source #

Action type inference helper

Try it with lambdas, instead of doing:

Action<string> putStr = (string x) => Console.WriteLine(x);

You can use this function and do:

var putStr = act((string x) => Console.WriteLine(x));

Parameters

param f

Action to infer

returns

The same Action you gave it, but allows the type system to work out what f is

method Action<T1, T2> act <T1, T2> (Action<T1, T2> f) Source #

Action type inference helper

Try it with lambdas, instead of doing:

Action<string> putStr = (string x) => Console.WriteLine(x);

You can use this function and do:

var putStr = act((string x) => Console.WriteLine(x));

Parameters

param f

Action to infer

returns

The same Action you gave it, but allows the type system to work out what f is

method Action<T1, T2, T3> act <T1, T2, T3> (Action<T1, T2, T3> f) Source #

Action type inference helper

Try it with lambdas, instead of doing:

Action<string> putStr = (string x) => Console.WriteLine(x);

You can use this function and do:

var putStr = act((string x) => Console.WriteLine(x));

Parameters

param f

Action to infer

returns

The same Action you gave it, but allows the type system to work out what f is

method Action<T1, T2, T3, T4> act <T1, T2, T3, T4> (Action<T1, T2, T3, T4> f) Source #

Action type inference helper

Try it with lambdas, instead of doing:

Action<string> putStr = (string x) => Console.WriteLine(x);

You can use this function and do:

var putStr = act((string x) => Console.WriteLine(x));

Parameters

param f

Action to infer

returns

The same Action you gave it, but allows the type system to work out what f is

method Action<T1, T2, T3, T4, T5> act <T1, T2, T3, T4, T5> (Action<T1, T2, T3, T4, T5> f) Source #

Action type inference helper

Try it with lambdas, instead of doing:

Action<string> putStr = (string x) => Console.WriteLine(x);

You can use this function and do:

var putStr = act((string x) => Console.WriteLine(x));

Parameters

param f

Action to infer

returns

The same Action you gave it, but allows the type system to work out what f is

method Action<T1, T2, T3, T4, T5, T6> act <T1, T2, T3, T4, T5, T6> (Action<T1, T2, T3, T4, T5, T6> f) Source #

Action type inference helper

Try it with lambdas, instead of doing:

Action<string> putStr = (string x) => Console.WriteLine(x);

You can use this function and do:

var putStr = act((string x) => Console.WriteLine(x));

Parameters

param f

Action to infer

returns

The same Action you gave it, but allows the type system to work out what f is

method Action<T1, T2, T3, T4, T5, T6, T7> act <T1, T2, T3, T4, T5, T6, T7> (Action<T1, T2, T3, T4, T5, T6, T7> f) Source #

Action type inference helper

Try it with lambdas, instead of doing:

Action<string> putStr = (string x) => Console.WriteLine(x);

You can use this function and do:

var putStr = act((string x) => Console.WriteLine(x));

Parameters

param f

Action to infer

returns

The same Action you gave it, but allows the type system to work out what f is

method Action act <R> (Func<R> f) Source #

Func type inference helper; converts it to an Action by dropping the return value

Try it with lambdas, instead of doing:

Func<string, string> thereIs = ...

Action<string,Unit> thereIsNoReturn = (string x) => { thereis(x); };

You can use this function and do:

var thereIsNoReturn = act(thereIs);

Parameters

param f

Function to infer

returns

Action that is the same as the Func passed in, but with the return type dropped

method Action<T1> act <T1, R> (Func<T1, R> f) Source #

Func type inference helper; converts it to an Action by dropping the return value

Try it with lambdas, instead of doing:

Func<string, string> thereIs = ...

Action<string,Unit> thereIsNoReturn = (string x) => { thereis(x); };

You can use this function and do:

var thereIsNoReturn = act(thereIs);

Parameters

param f

Function to infer

returns

Action that is the same as the Func passed in, but with the return type dropped

method Action<T1, T2> act <T1, T2, R> (Func<T1, T2, R> f) Source #

Func type inference helper; converts it to an Action by dropping the return value

Try it with lambdas, instead of doing:

Func<string, string> thereIs = ...

Action<string,Unit> thereIsNoReturn = (string x) => { thereis(x); };

You can use this function and do:

var thereIsNoReturn = act(thereIs);

Parameters

param f

Function to infer

returns

Action that is the same as the Func passed in, but with the return type dropped

method Action<T1, T2, T3> act <T1, T2, T3, R> (Func<T1, T2, T3, R> f) Source #

Func type inference helper; converts it to an Action by dropping the return value

Try it with lambdas, instead of doing:

Func<string, string> thereIs = ...

Action<string,Unit> thereIsNoReturn = (string x) => { thereis(x); };

You can use this function and do:

var thereIsNoReturn = act(thereIs);

Parameters

param f

Function to infer

returns

Action that is the same as the Func passed in, but with the return type dropped

method Action<T1, T2, T3, T4> act <T1, T2, T3, T4, R> (Func<T1, T2, T3, T4, R> f) Source #

Func type inference helper; converts it to an Action by dropping the return value

Try it with lambdas, instead of doing:

Func<string, string> thereIs = ...

Action<string,Unit> thereIsNoReturn = (string x) => { thereis(x); };

You can use this function and do:

var thereIsNoReturn = act(thereIs);

Parameters

param f

Function to infer

returns

Action that is the same as the Func passed in, but with the return type dropped

method Action<T1, T2, T3, T4, T5> act <T1, T2, T3, T4, T5, R> (Func<T1, T2, T3, T4, T5, R> f) Source #

Func type inference helper; converts it to an Action by dropping the return value

Try it with lambdas, instead of doing:

Func<string, string> thereIs = ...

Action<string,Unit> thereIsNoReturn = (string x) => { thereis(x); };

You can use this function and do:

var thereIsNoReturn = act(thereIs);

Parameters

param f

Function to infer

returns

Action that is the same as the Func passed in, but with the return type dropped

method Action<T1, T2, T3, T4, T5, T6> act <T1, T2, T3, T4, T5, T6, R> (Func<T1, T2, T3, T4, T5, T6, R> f) Source #

Func type inference helper; converts it to an Action by dropping the return value

Try it with lambdas, instead of doing:

Func<string, string> thereIs = ...

Action<string,Unit> thereIsNoReturn = (string x) => { thereis(x); };

You can use this function and do:

var thereIsNoReturn = act(thereIs);

Parameters

param f

Function to infer

returns

Action that is the same as the Func passed in, but with the return type dropped

method Action<T1, T2, T3, T4, T5, T6, T7> act <T1, T2, T3, T4, T5, T6, T7, R> (Func<T1, T2, T3, T4, T5, T6, T7, R> f) Source #

Func type inference helper; converts it to an Action by dropping the return value

Try it with lambdas, instead of doing:

Func<string, string> thereIs = ...

Action<string,Unit> thereIsNoReturn = (string x) => { thereis(x); };

You can use this function and do:

var thereIsNoReturn = act(thereIs);

Parameters

param f

Function to infer

returns

Action that is the same as the Func passed in, but with the return type dropped

method Expression<Func<R>> expr <R> (Expression<Func<R>> f) Source #

Expression inference

Parameters

returns

Same expression passed in, just gives the type system a chance to infer

method Expression<Func<T1, R>> expr <T1, R> (Expression<Func<T1, R>> f) Source #

Expression inference

Parameters

returns

Same expression passed in, just gives the type system a chance to infer

method Expression<Func<T1, T2, R>> expr <T1, T2, R> (Expression<Func<T1, T2, R>> f) Source #

Expression inference

Parameters

returns

Same expression passed in, just gives the type system a chance to infer

method Expression<Func<T1, T2, T3, R>> expr <T1, T2, T3, R> (Expression<Func<T1, T2, T3, R>> f) Source #

Expression inference

Parameters

returns

Same expression passed in, just gives the type system a chance to infer

method Expression<Func<T1, T2, T3, T4, R>> expr <T1, T2, T3, T4, R> (Expression<Func<T1, T2, T3, T4, R>> f) Source #

Expression inference

Parameters

returns

Same expression passed in, just gives the type system a chance to infer

method Expression<Func<T1, T2, T3, T4, T5, R>> expr <T1, T2, T3, T4, T5, R> (Expression<Func<T1, T2, T3, T4, T5, R>> f) Source #

Expression inference

Parameters

returns

Same expression passed in, just gives the type system a chance to infer

method Expression<Func<T1, T2, T3, T4, T5, T6, R>> expr <T1, T2, T3, T4, T5, T6, R> (Expression<Func<T1, T2, T3, T4, T5, T6, R>> f) Source #

Expression inference

Parameters

returns

Same expression passed in, just gives the type system a chance to infer

method Expression<Func<T1, T2, T3, T4, T5, T6, T7, R>> expr <T1, T2, T3, T4, T5, T6, T7, R> (Expression<Func<T1, T2, T3, T4, T5, T6, T7, R>> f) Source #

Expression inference

Parameters

returns

Same expression passed in, just gives the type system a chance to infer

method Expression<Action> expr (Expression<Action> f) Source #

Expression inference

Parameters

returns

Same expression passed in, just gives the type system a chance to infer

method Expression<Action<T1>> expr <T1> (Expression<Action<T1>> f) Source #

Expression inference

Parameters

returns

Same expression passed in, just gives the type system a chance to infer

method Expression<Action<T1, T2>> expr <T1, T2> (Expression<Action<T1, T2>> f) Source #

Expression inference

Parameters

returns

Same expression passed in, just gives the type system a chance to infer

method Expression<Action<T1, T2, T3>> expr <T1, T2, T3> (Expression<Action<T1, T2, T3>> f) Source #

Expression inference

Parameters

returns

Same expression passed in, just gives the type system a chance to infer

method Expression<Action<T1, T2, T3, T4>> expr <T1, T2, T3, T4> (Expression<Action<T1, T2, T3, T4>> f) Source #

Expression inference

Parameters

returns

Same expression passed in, just gives the type system a chance to infer

method Expression<Action<T1, T2, T3, T4, T5>> expr <T1, T2, T3, T4, T5> (Expression<Action<T1, T2, T3, T4, T5>> f) Source #

Expression inference

Parameters

returns

Same expression passed in, just gives the type system a chance to infer

method Expression<Action<T1, T2, T3, T4, T5, T6>> expr <T1, T2, T3, T4, T5, T6> (Expression<Action<T1, T2, T3, T4, T5, T6>> f) Source #

Expression inference

Parameters

returns

Same expression passed in, just gives the type system a chance to infer

method Expression<Action<T1, T2, T3, T4, T5, T6, T7>> expr <T1, T2, T3, T4, T5, T6, T7> (Expression<Action<T1, T2, T3, T4, T5, T6, T7>> f) Source #

Expression inference

Parameters

returns

Same expression passed in, just gives the type system a chance to infer

method Func<T2> compose <T1, T2> (Func<T1> a, Func<T1, T2> b) Source #

Function composition

Parameters

returns

b(a(()))

method Func<T1, T3> compose <T1, T2, T3> (Func<T1, T2> a, Func<T2, T3> b) Source #

Function composition

Parameters

returns

b(a(v))

method Func<T1, T4> compose <T1, T2, T3, T4> (Func<T1, T2> a, Func<T2, T3> b, Func<T3, T4> c) Source #

Function composition

Parameters

returns

c(b(a(v)))

method Func<T1, T5> compose <T1, T2, T3, T4, T5> (Func<T1, T2> a, Func<T2, T3> b, Func<T3, T4> c, Func<T4, T5> d) Source #

Function composition

Parameters

returns

c(b(a(v)))

method Func<T1, T6> compose <T1, T2, T3, T4, T5, T6> (Func<T1, T2> a, Func<T2, T3> b, Func<T3, T4> c, Func<T4, T5> d, Func<T5, T6> e) Source #

Function composition

Parameters

returns

c(b(a(v)))

method Func<T1, T7> compose <T1, T2, T3, T4, T5, T6, T7> (Func<T1, T2> a, Func<T2, T3> b, Func<T3, T4> c, Func<T4, T5> d, Func<T5, T6> e, Func<T6, T7> f) Source #

Function composition

Parameters

returns

c(b(a(v)))