LanguageExt Namespace

DELEGATES

Cond<A, B>

Conditional computation. Represents a computation that could succeed or fail. The result of the computation is an Option data-type.

public delegate Option<B> Cond<A, B>(A input)

CondAsync<A, B>

Conditional asynchronous computation. Represents a computation that could succeed or fail. The result of the computation is an Option data-type promise.

public delegate Task<Option<B>> CondAsync<A, B>(A input)
public delegate ValueTuple<A, bool> Reader<Env, A>(Env env)
public delegate ValueTuple<A, S, bool> State<S, A>(S state)

Try<A>

The Try monad captures exceptions and uses them to cancel the computation. Primarily useful for expression based processing of errors.

public delegate Result<A> Try<A>()

TryAsync<A>

The Try monad captures exceptions and uses them to cancel the computation. Primarily useful for expression based processing of errors.

public delegate Task<Result<A>> TryAsync<A>()

TryOption<A>

The Try monad captures exceptions and uses them to cancel the computation. Primarily useful for expression based processing of errors.

public delegate OptionalResult<A> TryOption<A>()

TryOptionAsync<A>

The Try monad captures exceptions and uses them to cancel the computation. Primarily useful for expression based processing of errors.

public delegate Task<OptionalResult<A>> TryOptionAsync<A>()
public delegate C WhenMatched<K, A, B, C>(K key, A left, B right)
public delegate B WhenMissing<K, A, B>(K key, A value)
public delegate ValueTuple<A, W, bool> Writer<MonoidW, W, A>()

STRUCTS

Arr<A>

Immutable array Native array O(1) read performance. Modifications require copying of the entire array to generate the newly mutated version. This is will be very expensive for large arrays.

[Serializable]
public struct Arr<A> : IEnumerable<A>,
IReadOnlyList<A>,
IReadOnlyCollection<A>

bigint

BigInteger convenience wrapper

public struct bigint

Either<L, R>

Either L R Holds one of two values 'Left' or 'Right'. Usually 'Left' is considered 'wrong' or 'in error', and 'Right' is, well, right. So when the Either is in a Left state, it cancels computations like bind or map, etc. So you can see Left as an 'early out, with a message'. Unlike Option that has None as its alternative value (i.e. it has an 'early out, but no message').

[Serializable]
public struct Either<L, R> : IEnumerable<EitherData<L, R>>,
IEither,
IComparable<Either<L, R>>,
IComparable<R>,
IEquatable<Either<L, R>>,
IEquatable<R>,
ISerializable

EitherContext<L, R, Ret>

Context for the fluent Either matching

public struct EitherContext<L, R, Ret>

EitherUnitContext<L, R>

Context for the fluent Either matching

public struct EitherUnitContext<L, R>

EitherUnsafe<L, R>

Either L R Holds one of two values 'Left' or 'Right'. Usually 'Left' is considered 'wrong' or 'in error', and 'Right' is, well, right. So when the Either is in a Left state, it cancels computations like bind or map, etc. So you can see Left as an 'early out, with a message'. Unlike Option that has None as its alternative value (i.e. it has an 'early out, but no message').

[Serializable]
public struct EitherUnsafe<L, R> : IEnumerable<EitherData<L, R>>,
IEither,
IComparable<EitherUnsafe<L, R>>,
IComparable<R>,
IEquatable<EitherUnsafe<L, R>>,
IEquatable<R>,
ISerializable

EitherUnsafeContext<L, R, Ret>

Context for the fluent EitherUnsafe matching

public struct EitherUnsafeContext<L, R, Ret>

EitherUnsafeUnitContext<L, R>

Context for the fluent Either matching

public struct EitherUnsafeUnitContext<L, R>

HashMap<EqK, K, V>

Unsorted immutable hash-map

public struct HashMap<EqK, K, V> : IEnumerable<ValueTuple<K, V>>,
IEquatable<HashMap<EqK, K, V>>

HashMap<K, V>

Unsorted immutable hash-map

public struct HashMap<K, V> : IEnumerable<ValueTuple<K, V>>,
IEquatable<HashMap<K, V>>

HashSet<A>

Unsorted immutable hash-set

public struct HashSet<A> : IEnumerable<A>,
IEquatable<HashSet<A>>

HashSet<EqA, A>

Unsorted immutable hash-set

public struct HashSet<EqA, A> : IEnumerable<A>,
IEquatable<HashSet<EqA, A>>

Identity<A>

Identity monad

public struct Identity<A>

Lst<A>

Immutable list

[Serializable]
public struct Lst<A> : IEnumerable<A>,
IReadOnlyList<A>,
IReadOnlyCollection<A>,
IEquatable<Lst<A>>

Lst<PRED, A>

Immutable list with validation predicate

[Serializable]
public struct Lst<PRED, A> : IEnumerable<A>,
IReadOnlyList<A>,
IReadOnlyCollection<A>,
IEquatable<Lst<PRED, A>>,
ListInfo

Lst<PredList, PredItem, A>

Immutable list with validation predicate

[Serializable]
public struct Lst<PredList, PredItem, A> : IEnumerable<A>,
IReadOnlyList<A>,
IReadOnlyCollection<A>,
IEquatable<Lst<PredList, PredItem, A>>,
ListInfo

Map<K, V>

Immutable map AVL tree implementation AVL tree is a self-balancing binary search tree. http://en.wikipedia.org/wiki/AVL_tree

[Serializable]
public struct Map<K, V> : IEnumerable<ValueTuple<K, V>>,
IEquatable<Map<K, V>>

Map<OrdK, K, V>

Immutable map AVL tree implementation AVL tree is a self-balancing binary search tree. http://en.wikipedia.org/wiki/AVL_tree

[Serializable]
public struct Map<OrdK, K, V> : IEnumerable<ValueTuple<K, V>>,
IEquatable<Map<OrdK, K, V>>

Option<A>

Discriminated union type. Can be in one of two states:

Some(a)
None


Typeclass instances available for this type:

BiFoldable : MOption
Eq : EqOpt
Foldable : MOption
Functor : FOption
MonadPlus : MOption
Optional : MOption
Ord : OrdOpt

[Serializable]
public struct Option<A> : IEnumerable<A>,
IOptional,
IEquatable<Option<A>>,
IComparable<Option<A>>,
ISerializable

OptionalResult<A>

Represents the result of an operation:

Some(A) | None | Exception


public struct OptionalResult<A> : IEquatable<OptionalResult<A>>

OptionAsync<A>

Discriminated union type. Can be in one of two states:

Some(a)
None


Typeclass instances available for this type:

Applicative : ApplOptionAsync
BiFoldable : MOptionAsync
Foldable : MOptionAsync
Functor : FOptionAsync
Monad : MOptionAsync
OptionalAsync : MOptionAsync


public struct OptionAsync<A> : IOptionalAsync

OptionNone

A unit type that represents Option.None. This type can be implicitly converted to Option or OptionUnsafe.

public struct OptionNone

OptionUnsafe<A>

Discriminated union type. Can be in one of two states:

Some(a)
None


Typeclass instances available for this type:

BiFoldable : MOptionUnsafe
Eq : EqOpt
Foldable : MOptionUnsafe
Functor : FOptionUnsafe
MonadPlus : MOptionUnsafe
Optional : MOptionUnsafe
Ord : OrdOpt

public struct OptionUnsafe<A> : IEnumerable<A>,
IOptional,
IEquatable<OptionUnsafe<A>>,
IComparable<OptionUnsafe<A>>
[Serializable]
public struct Que<T> : IEnumerable<T>,
IEnumerable,
IEquatable<Que<T>>

Ratio<A>

A ratio between two values.

public struct Ratio<A>

Result<A>

Represents the result of an operation:

A | Exception


public struct Result<A> : IEquatable<Result<A>>

SeqEmpty

A unit type that represents Seq.Empty. This type can be implicitly converted to Seq<A>.

public struct SeqEmpty

Set<A>

Immutable set AVL tree implementation AVL tree is a self-balancing binary search tree. http://en.wikipedia.org/wiki/AVL_tree

[Serializable]
public struct Set<A> : IEnumerable<A>,
IEquatable<Set<A>>,
IReadOnlyCollection<A>

Set<OrdA, A>

Immutable set AVL tree implementation AVL tree is a self-balancing binary search tree. http://en.wikipedia.org/wiki/AVL_tree

[Serializable]
public struct Set<OrdA, A> : IEnumerable<A>,
IEquatable<Set<OrdA, A>>
[Serializable]
public struct Some<A> : IEnumerable<A>,
IOptional

Stck<T>

Immutable stack

[Serializable]
public struct Stck<T> : IEnumerable<T>,
IEnumerable,
IEquatable<Stck<T>>

Trans<OuterMonad, OuterType, InnerMonad, InnerType, A>

Default monad transformer, can nest any two monadic types and provide the correct default behaviour based on their Bind operations.

i.e.


Trans<MLst<Option<int>>, Lst<Option<int>>, MOption<int>, Option<int>, int>


public struct Trans<OuterMonad, OuterType, InnerMonad, InnerType, A> : MonadTrans<OuterMonad, OuterType, InnerMonad, InnerType, A>
public struct Trans<OuterMonad, OuterType, InnerMonad, InnerType, NumA, A>
public struct TryAsyncSuccContext<A, B>
public struct TryAsyncSuccUnitContext<A>
public struct TryOptionAsyncSuccContext<A, B>
public struct TryOptionAsyncSuccContext<A>
public struct TryOptionNoneContext<T, R>
public struct TryOptionNoneUnitContext<T>
public struct TryOptionSomeContext<T, R>
public struct TryOptionSomeUnitContext<T>
public struct TrySuccContext<T, R>
public struct TrySuccUnitContext<T>

Unit

A unit type is a type that allows only one value (and thus can hold no information)

[Serializable]
public struct Unit : IEquatable<Unit>

Validation<FAIL, SUCCESS>

Like Either but collects the failed values

public struct Validation<FAIL, SUCCESS> : IEnumerable<ValidationData<FAIL, SUCCESS>>,
IComparable<Validation<FAIL, SUCCESS>>,
IComparable<SUCCESS>,
IEquatable<Validation<FAIL, SUCCESS>>,
IEquatable<SUCCESS>

Validation<MonoidFail, FAIL, SUCCESS>

Like Either but collects the failed values

public struct Validation<MonoidFail, FAIL, SUCCESS> : IEnumerable<ValidationData<MonoidFail, FAIL, SUCCESS>>,
IComparable<Validation<MonoidFail, FAIL, SUCCESS>>,
IComparable<SUCCESS>,
IEquatable<Validation<MonoidFail, FAIL, SUCCESS>>,
IEquatable<SUCCESS>

CLASSES

ActionObservable<T>

Executes an action post-subscription. This is useful when the action is going to publish to the observable. A kind of request/response. Use the IObservable extension method: PostSubscribe(() => ...)

public class ActionObservable<T> : IObservable<T>
public static partial class Arr
public static partial class ArrT

ArrT_Extensions

Monad transformer for Arr, provides functionality for working with the inner value of the nested type.

public static partial class ArrT_Extensions
public class BigIntegerRange : Range<BigIntegerRange, TBigInt, bigint>

BottomException

Value is bottom

[Serializable]
public class BottomException : Exception
public class CharRange : Range<CharRange, TNumericChar, char>
public class ClockEntry
public static class Combinators
public static class Combinators<A, B, C>
public static class Combinators<A, B>
public static class Combinators<A>
public static class CombinatorsDynamic
public static class ComposeExtensions

CondAsyncExt

Extensions to the CondAsync type

public static class CondAsyncExt

CondExt

Extensions to the Cond type

public static class CondExt
public static class CondSyncToAsyncExt
public class DecimalRange : Range<DecimalRange, TDecimal, decimal>
public class DoubleRange : Range<DoubleRange, TDouble, double>

EitherIsNotLeftException

Either is not left

[Serializable]
public class EitherIsNotLeftException : Exception

EitherIsNotRightException

Either is not right

[Serializable]
public class EitherIsNotRightException : Exception
public static partial class EitherT

EitherT_Extensions

Monad transformer for Either, provides functionality for working with the inner value of the nested type.

public static partial class EitherT_Extensions
public static partial class EitherUnsafeT

EitherUnsafeT_Extensions

Monad transformer for EitherUnsafe, provides functionality for working with the inner value of the nested type.

public static partial class EitherUnsafeT_Extensions

ExceptionAsyncExtensions

Exception extensions

public static class ExceptionAsyncExtensions

ExceptionExtensions

Exception extensions

public static class ExceptionExtensions

ExceptionMatch<R>

Pattern matching for exceptions. This is to aid expression based error handling.

[Serializable]
public class ExceptionMatch<R>

ExceptionMatchAsync<R>

Pattern matching for exceptions. This is to aid expression based error handling.

[Serializable]
public class ExceptionMatchAsync<R>

ExceptionMatchOptionalAsync<R>

Pattern matching for exceptions. This is to aid expression based error handling.

[Serializable]
public class ExceptionMatchOptionalAsync<R>
public static class ExceptionOptionalAsyncExtensions
public class FloatRange : Range<FloatRange, TFloat, float>

FloatType<SELF, FLOATING, A, PRED>

FloatType - inspired by Haskell's 'newtype' keyword. This is setup for floating point numeric types,and expects a Floating<A> class-instance as an argument (TFloat, TDouble, TDecimal, etc.)

https://wiki.haskell.org/Newtype

Derive type from this one to get: Equatable, Comparable, Appendable, Foldable, Functor, Iterable: strongly typed values.

For example:

class Metres : FloatType<Metres, TDouble, double> { public Metres(double x) : base(x) {} }


Will not accept null values

[Serializable]
public abstract class FloatType<SELF, FLOATING, A, PRED> : IEquatable<SELF>,
IComparable<SELF>

FloatType<SELF, FLOATING, A>

FloatType - inspired by Haskell's 'newtype' keyword. This is setup for floating point numeric types,and expects a Floating<A> class-instance as an argument (TFloat, TDouble, TDecimal, etc.)

https://wiki.haskell.org/Newtype

Derive type from this one to get: Equatable, Comparable, Appendable, Foldable, Functor, Iterable: strongly typed values.

For example:

class Metres : FloatType<Metres, TDouble, double> { public Metres(double x) : base(x) {} }


Will not accept null values

[Serializable]
public abstract class FloatType<SELF, FLOATING, A> : FloatType<SELF, FLOATING, A, True<A>>
public static class FloatTypeExtensions

HashMap

Immutable hash-map module

public static partial class HashMap

HashSet

Immutable hash-set module

public static partial class HashSet
public static partial class HashSetT

HashSetT_Extensions

Monad transformer for HashSet, provides functionality for working with the inner value of the nested type.

public static partial class HashSetT_Extensions
public static partial class IEnumerableT

IEnumerableT_Extensions

Monad transformer for IEnumerable, provides functionality for working with the inner value of the nested type.

public static partial class IEnumerableT_Extensions
public static class IL
[Serializable]
public class InnerException : Exception
public class IntegerRange : Range<IntegerRange, TInt, int>
public static partial class List
public class LongRange : Range<LongRange, TLong, long>
public static partial class LstT

LstT_Extensions

Monad transformer for Lst, provides functionality for working with the inner value of the nested type.

public static partial class LstT_Extensions

Map

Immutable map module AVL tree implementation AVL tree is a self-balancing binary search tree. http://en.wikipedia.org/wiki/AVL_tree

public static partial class Map
public static class MapExtensions
public static class MapOrdExtensions
public static class MemoExtensions
public static class MonadTransExtensions

NewType<NEWTYPE, A, PRED>

NewType - inspired by Haskell's 'newtype' keyword. https://wiki.haskell.org/Newtype Derive type from this one to get: Equatable, Comparable, Appendable, Subtractable, Multiplicable, Divisible, Foldable, Monadic, Functor, Interable: strongly typed values.

For example:

class Metres : NewType<Metres, double> { public Metres(double x) : base(x) {} }
class Hours : NewType<Hours, double> { public Hours(double x) : base(x) {} }


Will not accept null values

[Serializable]
public abstract class NewType<NEWTYPE, A, PRED> : IEquatable<NEWTYPE>,
IComparable<NEWTYPE>

NewType<NEWTYPE, A>

NewType - inspired by Haskell's 'newtype' keyword. https://wiki.haskell.org/Newtype Derive type from this one to get: Equatable, Comparable, Appendable, Subtractable, Multiplicable, Divisible, Foldable, Functor, Interable: strongly typed values.

For example:

class Metres : NewType<Metres, double> { public Metres(double x) : base(x) {} }
class Hours : NewType<Hours, double> { public Hours(double x) : base(x) {} }


Will not accept null values

[Serializable]
public abstract class NewType<NEWTYPE, A> : NewType<NEWTYPE, A, True<A>>
[Serializable]
public class NotAppendableException : Exception
[Serializable]
public class NotDivisibleException : Exception
[Serializable]
public class NotMultiplicableException : Exception
[Serializable]
public class NotSubtractableException : Exception
public static class NullableExtensions

NumType<SELF, NUM, A, PRED>

NumType - inspired by Haskell's 'newtype' keyword. This is setup for numeric types,and expects a Num<A> class-instance as an argument (TInt, TDouble, etc.)

https://wiki.haskell.org/Newtype

Derive type from this one to get: Equatable, Comparable, Appendable, Foldable, Functor, Iterable: strongly typed values.

For example:

class Metres : NumType<Metres, TDouble, double> { public Metres(double x) : base(x) {} }


Will not accept null values

[Serializable]
public abstract class NumType<SELF, NUM, A, PRED> : IEquatable<SELF>,
IComparable<SELF>

NumType<SELF, NUM, A>

NumType - inspired by Haskell's 'newtype' keyword. This is setup for numeric types,and expects a Num<A> class-instance as an argument (TInt, TDouble, etc.)

https://wiki.haskell.org/Newtype

Derive type from this one to get: Equatable, Comparable, Appendable, Foldable, Functor, Iterable: strongly typed values.

For example:

class Metres : NumType<Metres, TDouble, double> { public Metres(double x) : base(x) {} }


Will not accept null values

[Serializable]
public abstract class NumType<SELF, NUM, A> : NumType<SELF, NUM, A, True<A>>
public static class NumTypeExtensions
public static class ObjectExt

ObservableExt

Observable extensions

public static class ObservableExt
public static partial class OptionAsyncT

OptionAsyncT_Extensions

Monad transformer for OptionAsync, provides functionality for working with the inner value of the nested type.

public static partial class OptionAsyncT_Extensions

OptionIsNoneException

Option T is none

[Serializable]
public class OptionIsNoneException : Exception
public static partial class OptionT

OptionT_Extensions

Monad transformer for Option, provides functionality for working with the inner value of the nested type.

public static partial class OptionT_Extensions
public static partial class OptionUnsafeT

OptionUnsafeT_Extensions

Monad transformer for OptionUnsafe, provides functionality for working with the inner value of the nested type.

public static partial class OptionUnsafeT_Extensions
public static class OutExtensions
public static partial class Prelude
public static class Query
public static class Queue
public static class QueueExtensions

Range<SELF, MonoidOrdA, A>

Represents a range of values

[Serializable]
public class Range<SELF, MonoidOrdA, A> : IEnumerable<A>

ReaderResult

Convenience methods for returning from a Reader<Env,A> computation

public static class ReaderResult

Record<RECORDTYPE>

Base class for types that are 'records'. A record has a set of readonly *fields( that make up its data structure. By deriving from this you get structural equality, structural ordering (IComparable), structural hashing (GetHashCode) as well as the operators ==, !=, <, <=, >, >=,

public abstract class Record<RECORDTYPE> : IEquatable<RECORDTYPE>,
IComparable<RECORDTYPE>

RecordType<A>

Supports the building of record types (classes with sets of readonly field values) Provides structural equality testing, ordering, and hashing

public static class RecordType<A>

ResultIsNullException

Result is null

[Serializable]
public class ResultIsNullException : Exception

Seq

Cons sequence module Represents a sequence of values in a similar way to IEnumerable, but without the issues of multiple evaluation for key LINQ operators like Skip, Count, etc.

public static class Seq

Seq<A>

Cons sequence Represents a sequence of values in a similar way to IEnumerable, but without the issues of multiple evaluation for key LINQ operators like Skip, Count, etc.

public abstract class Seq<A> : ISeq<A>
public static partial class SeqT

SeqT_Extensions

Monad transformer for Seq, provides functionality for working with the inner value of the nested type.

public static partial class SeqT_Extensions

Set

Immutable set module AVL tree implementation AVL tree is a self-balancing binary search tree. http://en.wikipedia.org/wiki/AVL_tree

public static partial class Set
public static partial class SetT

SetT_Extensions

Monad transformer for Set, provides functionality for working with the inner value of the nested type.

public static partial class SetT_Extensions
public class ShortRange : Range<ShortRange, TShort, short>
public static class Some

SomeContext<OPT, OA, A, B>

Provides a fluent context when calling the Some(Func) method from a member of the Optional<A> type-class. Must call None(Func) or None(Value) on this context to complete the matching operation.

public class SomeContext<OPT, OA, A, B>

SomeNotInitialisedException

Some T not initialised

[Serializable]
public class SomeNotInitialisedException : Exception

SomeUnitContext<OPT, OA, A>

Provides a fluent context when calling the Some(Action) method from Optional<A> type-class. Must call None(Action) or None(Value) on this context to complete the matching operation.

public class SomeUnitContext<OPT, OA, A>

Stack

Functional module for working with the Stck T type

public static class Stack

StateResult

Convenience methods for returning from a State<S,A> computation

public static class StateResult
public static partial class TaskT

TaskT_Extensions

Monad transformer for Task, provides functionality for working with the inner value of the nested type.

public static partial class TaskT_Extensions
public static partial class TryAsyncT

TryAsyncT_Extensions

Monad transformer for TryAsync, provides functionality for working with the inner value of the nested type.

public static partial class TryAsyncT_Extensions
public static class TryConfig
public static partial class TryOptionAsyncT

TryOptionAsyncT_Extensions

Monad transformer for TryOptionAsync, provides functionality for working with the inner value of the nested type.

public static partial class TryOptionAsyncT_Extensions
public static partial class TryOptionT

TryOptionT_Extensions

Monad transformer for TryOption, provides functionality for working with the inner value of the nested type.

public static partial class TryOptionT_Extensions
public static partial class TryT

TryT_Extensions

Monad transformer for Try, provides functionality for working with the inner value of the nested type.

public static partial class TryT_Extensions
public static partial class TypeClass
public static partial class TypeClassExtensions
public static partial class ValidationT

ValidationT_Extensions

Monad transformer for Validation, provides functionality for working with the inner value of the nested type.

public static partial class ValidationT_Extensions

ValueIsNoneException

Value is none

[Serializable]
public class ValueIsNoneException : Exception

ValueIsNullException

Value is null

[Serializable]
public class ValueIsNullException : Exception

VectorClock

Vector clock

public class VectorClock : IEquatable<VectorClock>
public static class Versioned
public class Versioned<T> : IEquatable<Versioned<T>>,
IComparable<Versioned<T>>

WriterResult

Convenience methods for returning from a Writer<MonoidW, W, A> computation

public static class WriterResult

INTERFACES

public interface IEither
public interface IOptional
public interface IOptionalAsync

ISeq<A>

Cons sequence Represents a sequence of values in a similar way to IEnumerable, but without the issues of multiple evaluation for key LINQ operators like Skip, Count, etc.

public interface ISeq<A> : IEnumerable<A>,
IEquatable<ISeq<A>>,
IComparable<ISeq<A>>
public interface ListInfo

ENUMS

EitherStatus

Possible states of an Either

public enum EitherStatus : byte