If you're new to this library, you may need a few pointers of where to look for features:
Prelude
is astatic partial class
, this type is loaded with functions for constructing the key data types, as well as many of the things you'd expect in a functional programming language's prelude. Note, thePrelude
type extends into many other parts of the source-tree. It's the same type, but spread all over the code-base. And so, you may seePrelude
in other areas of the documentation: it's the same type.Because it's so fundamental, you'll want to add this to the top of every code file (or in your global usings):
using static LanguageExt.Prelude;
This makes all functions in the
Prelude
available as though they were local.Traits
are the powerhouse of this library and allow for true higher-kinded abstract behviours to be leveraged throughout. The topic of traits is huge, so if you're looking for an introduction, take a look at Paul Louth's Higher Kinds series on his blog.Monads
contains the common monads likeOption<A>
andEither<L, R>
, as well as state-managing monads likeReader
,Writer
, andState
. It also is home to many monad-transformers (types with aT
suffix, likeOptionT
). Transformers allow 'stacking' of monadic effects into 'super monads'.Immutable Collections
contains the high-performance functional collection types this library is famous for.Effects
is where the pure IO functionality of language-ext resides. It is also where you'll find theStreamT
for 'effectful' streaming. To understand more about how to deal with side-effects, check the wiki.Concurrency
is where you'll find lots of help in atomically managing shared data without locks.
- CatchM <E, M, A> (Func<E, bool> Match, Func<E, K<M, A>> Action)
- CombinatorsDynamic
- I = (dynamic x) => x
- M = (dynamic x) => (dynamic a) => x(x(a))
- K = (dynamic x) => (dynamic y) => x
- T = (dynamic x) => (dynamic y) => y(x)
- Q = (dynamic x) => (dynamic y) => (dynamic z) => y(x(z))
- S = (dynamic x) => (dynamic y) => (dynamic z) => x(z)(y(z))
- Y = (dynamic f) => (dynamic x) => f(Y(f), x)
- Combinators <A>
- Combinators <A, B>
- Combinators <A, B, C>
- Q = (Func<A, B> x) => (Func<B, C> y) => (A z) => y(x(z))
- S = (Func<A, Func<B, C>> x) => (Func<A, B> y) => (A z) => x(z)(y(z))
- Y = (Func<Func<A, B>, A, B> f) => (A x) => f(Y!(f), x)
- Combinators
- I <A> (A x)
- K <A, B> (A x)
- M <A> (Func<A, A> x)
- T <A, B> (A x)
- Q <A, B, C> (Func<A, B> x)
- S <A, B, C> (Func<A, B, C> x)
- Comment_Alternatives
- Guard <E, A>
- Flag
- Cast <B> ()
- OnFalse
- SelectMany <C> (Func<E, Guard<E, Unit>> bind, Func<Unit, Unit, C> project)
- Select <B> (Func<B, B> _)
- ToEither ()
- Bind <B> (Func<Unit, Either<E, B>> f)
- SelectMany <B, C> ( Func<Unit, Either<E, B>> bind, Func<Unit, B, C> project)
- GuardExtensions
- Bind <B> ( this Guard<Error, Unit> guard, Func<Unit, IO<B>> f)
- SelectMany <B, C> ( this Guard<Error, Unit> guard, Func<Unit, IO<B>> bind, Func<Unit, B, C> project)
- ToIO (this Guard<Error, Unit> guard)
- ToEff (this Guard<Error, Unit> guard)
- Bind <B> ( this Guard<Error, Unit> guard, Func<Unit, Eff<B>> f)
- SelectMany <B, C> ( this Guard<Error, Unit> guard, Func<Unit, Eff<B>> bind, Func<Unit, B, C> project)
- ToEff <RT> (this Guard<Error, Unit> guard)
- Bind <RT, B> ( this Guard<Error, Unit> guard, Func<Unit, Eff<RT, B>> f)
- SelectMany <RT, B, C> ( this Guard<Error, Unit> guard, Func<Unit, Eff<RT, B>> bind, Func<Unit, B, C> project)
- ToValidation <F> (this Guard<F, Unit> guard)
- Bind <F, B> ( this Guard<F, Unit> guard, Func<Unit, Validation<F, B>> f)
- SelectMany <F, B, C> ( this Guard<F, Unit> guard, Func<Unit, Validation<F, B>> bind, Func<Unit, B, C> project)
- Number <A>
Sub modules
Async |
Class Instances |
Common |
Concurrency |
DataTypes |
Effects |
Exceptions |
Extensions |
Immutable Collections |
Lens |
Monads |
Obsolete and Deprecated |
Prelude |
Pretty |
Prism |
Traits |
Units of Measure |
Utility |
record CatchM <E, M, A> (Func<E, bool> Match, Func<E, K<M, A>> Action) Source #
Used by @catch
, @exceptional
, @expected
to represent the catching of errors
class CombinatorsDynamic Source #
field Func<dynamic, dynamic> I = (dynamic x) => x Source #
Identity function, or the Idiot bird dkeenan.com/Lambda/
field Func<dynamic, Func<dynamic, dynamic>> M = (dynamic x) => (dynamic a) => x(x(a)) Source #
The Mockingbird dkeenan.com/Lambda/
field Func<dynamic, Func<dynamic, dynamic>> K = (dynamic x) => (dynamic y) => x Source #
The Kestrel dkeenan.com/Lambda/
field Func<dynamic, Func<dynamic, dynamic>> T = (dynamic x) => (dynamic y) => y(x) Source #
The Thrush dkeenan.com/Lambda/
field Func<dynamic, Func<dynamic, Func<dynamic, dynamic>>> Q = (dynamic x) => (dynamic y) => (dynamic z) => y(x(z)) Source #
The Queer bird dkeenan.com/Lambda/
field Func<dynamic, Func<dynamic, Func<dynamic, dynamic>>> S = (dynamic x) => (dynamic y) => (dynamic z) => x(z)(y(z)) Source #
The Starling dkeenan.com/Lambda/
field Func<dynamic, Func<dynamic, dynamic>> Y = (dynamic f) => (dynamic x) => f(Y(f), x) Source #
The infamous Y-combinator, or Sage bird dkeenan.com/Lambda/
class Combinators <A> Source #
field Func<A, A> I = (A x) => x Source #
Identity function, or the Idiot bird dkeenan.com/Lambda/
field Func<Func<A, A>, Func<A, A>> M = (Func<A, A> x) => a => x(x(a)) Source #
The Mockingbird dkeenan.com/Lambda/
class Combinators <A, B> Source #
field Func<A, Func<B, A>> K = (A x) => (B y) => x Source #
The Kestrel dkeenan.com/Lambda/
field Func<A, Func<Func<A, B>, B>> T = (A x) => (Func<A, B> y) => y(x) Source #
The Thrush dkeenan.com/Lambda/
class Combinators <A, B, C> Source #
field Func<Func<A, B>, Func<Func<B, C>, Func<A, C>>> Q = (Func<A, B> x) => (Func<B, C> y) => (A z) => y(x(z)) Source #
The Queer bird dkeenan.com/Lambda/
field Func<Func<A, Func<B, C>>, Func<Func<A, B>, Func<A, C>>> S = (Func<A, Func<B, C>> x) => (Func<A, B> y) => (A z) => x(z)(y(z)) Source #
The Starling dkeenan.com/Lambda/
field Func<Func<Func<A, B>, A, B>, Func<A, B>> Y = (Func<Func<A, B>, A, B> f) => (A x) => f(Y!(f), x) Source #
The infamous Y-combinator, or Sage bird dkeenan.com/Lambda/
class Combinators Source #
Identity function, or the Idiot bird dkeenan.com/Lambda/
method Func<B, A> K <A, B> (A x) Source #
The Kestrel dkeenan.com/Lambda/
method Func<A, A> M <A> (Func<A, A> x) Source #
The Mockingbird dkeenan.com/Lambda/
method Func<Func<A, B>, B> T <A, B> (A x) Source #
The Thrush dkeenan.com/Lambda/
method Func<Func<B, C>, Func<A, C>> Q <A, B, C> (Func<A, B> x) Source #
The Queer bird dkeenan.com/Lambda/
method Func<Func<A, B>, Func<A, C>> S <A, B, C> (Func<A, B, C> x) Source #
The Starling dkeenan.com/Lambda/
class Comment_Alternatives Source #
Certain characters don't work in the XML comments, so we use these alternatives
< becomes 〈 (Unicode 3008)
> becomes 〉 (Unicode 3009)
& becomes & (Unicode FF06)
Used by various error producing monads to have a contextual where
See Prelude.guard(...)
method Guard<E, C> SelectMany <C> (Func<E, Guard<E, Unit>> bind, Func<Unit, Unit, C> project) Source #
method Either<E, B> Bind <B> (Func<Unit, Either<E, B>> f) Source #
Monadic binding support for Either
method Either<E, C> SelectMany <B, C> ( Func<Unit, Either<E, B>> bind, Func<Unit, B, C> project) Source #
Monadic binding SelectMany
extension for Guard
class GuardExtensions Source #
method IO<B> Bind <B> ( this Guard<Error, Unit> guard, Func<Unit, IO<B>> f) Source #
Monadic binding support for Eff
method IO<C> SelectMany <B, C> ( this Guard<Error, Unit> guard, Func<Unit, IO<B>> bind, Func<Unit, B, C> project) Source #
Monadic binding support for Eff
method Eff<B> Bind <B> ( this Guard<Error, Unit> guard, Func<Unit, Eff<B>> f) Source #
Monadic binding support for Eff
method Eff<C> SelectMany <B, C> ( this Guard<Error, Unit> guard, Func<Unit, Eff<B>> bind, Func<Unit, B, C> project) Source #
Monadic binding support for Eff
method Eff<RT, Unit> ToEff <RT> (this Guard<Error, Unit> guard) Source #
Natural transformation to Eff
method Eff<RT, B> Bind <RT, B> ( this Guard<Error, Unit> guard, Func<Unit, Eff<RT, B>> f) Source #
Monadic binding support for Eff
method Eff<RT, C> SelectMany <RT, B, C> ( this Guard<Error, Unit> guard, Func<Unit, Eff<RT, B>> bind, Func<Unit, B, C> project) Source #
Monadic binding support for Eff
method Validation<F, Unit> ToValidation <F> (this Guard<F, Unit> guard) Source #
Natural transformation to Validation
method Validation<F, B> Bind <F, B> ( this Guard<F, Unit> guard, Func<Unit, Validation<F, B>> f) Source #
Monadic binding support for Validation
method Validation<F, C> SelectMany <F, B, C> ( this Guard<F, Unit> guard, Func<Unit, Validation<F, B>> bind, Func<Unit, B, C> project) Source #
Monadic binding support for Validation
Num〈A〉
trait for INumber〈A〉
type | A |
method int GetHashCode (A x) Source #
method A FromInteger (int x) Source #
method A FromDecimal (decimal x) Source #
method A FromDouble (double x) Source #