FSharpx.Extras


Task Module

Types

Type Description

TokenToTask<'a>

Functions and values

Function or value Description

a *> b

Full Usage: a *> b

Parameters:
Returns: Task<'b>
Modifiers: inline

Sequence actions, discarding the value of the first argument.

a : Task<'a>
b : Task<'b>
Returns: Task<'b>

a <* b

Full Usage: a <* b

Parameters:
Returns: Task<'a>
Modifiers: inline

Sequence actions, discarding the value of the second argument.

a : Task<'a>
b : Task<'b>
Returns: Task<'a>

f <!> x

Full Usage: f <!> x

Parameters:
    f : 'a -> 'b
    x : Task<'a>

Returns: Task<'b>
Modifiers: inline

Infix map

f : 'a -> 'b
x : Task<'a>
Returns: Task<'b>

f <*> x

Full Usage: f <*> x

Parameters:
Returns: Task<'b>
Modifiers: inline

Sequential application

f : Task<('a -> 'b)>
x : Task<'a>
Returns: Task<'b>

<=<x

Full Usage: <=<x

Parameters:
    x : 'a -> Task<'b>

Returns: ('c -> 'd) -> 'c -> Task<'b>
Modifiers: inline

Right-to-left Kleisli composition

x : 'a -> Task<'b>
Returns: ('c -> 'd) -> 'c -> Task<'b>

f =<< m

Full Usage: f =<< m

Parameters:
Returns: Task<'b>
Modifiers: inline

Flipped >>=

f : 'a -> Task<'b>
m : Task<'a>
Returns: Task<'b>

(>=>) f g x

Full Usage: (>=>) f g x

Parameters:
    f : 'a -> 'b
    g : 'c -> Task<'d>
    x : 'a

Returns: Task<'d>
Modifiers: inline

Left-to-right Kleisli composition

f : 'a -> 'b
g : 'c -> Task<'d>
x : 'a
Returns: Task<'d>

m1 >>. m2

Full Usage: m1 >>. m2

Parameters:
Returns: Task<'b>
Modifiers: inline

Sequentially compose two either actions, discarding any value produced by the first

m1 : Task<'a>
m2 : Task<'b>
Returns: Task<'b>

m >>= f

Full Usage: m >>= f

Parameters:
Returns: Task<'b>
Modifiers: inline

Sequentially compose two actions, passing any value produced by the first as an argument to the second.

m : Task<'a>
f : 'a -> Task<'b>
Returns: Task<'b>

Catch t

Full Usage: Catch t

Parameters:
Returns: Task<Choice<'a, exn>>

Creates a task that executes a specified task. If this task completes successfully, then this function returns Choice1Of2 with the returned value. If this task raises an exception before it completes then return Choice2Of2 with the raised exception.

t : Task<'a>
Returns: Task<Choice<'a, exn>>

Ignore t

Full Usage: Ignore t

Parameters:
Returns: Task<unit>
Modifiers: inline

Creates a task that runs the given task and ignores its result.

t : Task<'a>
Returns: Task<unit>

Parallel tasks

Full Usage: Parallel tasks

Parameters:
    tasks : (unit -> Task<'a>) seq

Returns: Task<'a[]>

Creates a task that executes all the given tasks.

tasks : (unit -> Task<'a>) seq
Returns: Task<'a[]>

ParallelCatch tasks

Full Usage: ParallelCatch tasks

Parameters:
    tasks : (unit -> Task<'a>) seq

Returns: Task<Choice<'a, exn>[]>

Creates a task that executes all the given tasks. This function doesn't throw exceptions, but instead returns an array of Choices.

tasks : (unit -> Task<'a>) seq
Returns: Task<Choice<'a, exn>[]>

ParallelCatchWithThrottle throttle tasks

Full Usage: ParallelCatchWithThrottle throttle tasks

Parameters:
    throttle : int
    tasks : (unit -> Task<'a>) seq

Returns: Task<Choice<'a, exn>[]>

Creates a task that executes all the given tasks. This function doesn't throw exceptions, but instead returns an array of Choices. The paralelism is throttled, so that at most `throttle` tasks run at one time.

throttle : int
tasks : (unit -> Task<'a>) seq
Returns: Task<Choice<'a, exn>[]>

ParallelWithThrottle throttle tasks

Full Usage: ParallelWithThrottle throttle tasks

Parameters:
    throttle : int
    tasks : (unit -> Task<'a>) seq

Returns: Task<'a[]>

Creates a task that executes all the given tasks. The paralelism is throttled, so that at most `throttle` tasks run at one time.

throttle : int
tasks : (unit -> Task<'a>) seq
Returns: Task<'a[]>

ToTaskUnit t

Full Usage: ToTaskUnit t

Parameters:
Returns: Task<unit>
Modifiers: inline

Converts a Task into Task

t : Task
Returns: Task<unit>

WhenAllUnits units

Full Usage: WhenAllUnits units

Parameters:
    units : Task<unit> seq

Returns: Task<unit>

Creates a single Task that will complete when all of the Task objects in an enumerable collection have completed.

units : Task<unit> seq
Returns: Task<unit>

ap x f

Full Usage: ap x f

Parameters:
Returns: Task<'b>
Modifiers: inline

Sequential application

x : Task<'a>
f : Task<('a -> 'b)>
Returns: Task<'b>

bind f m

Full Usage: bind f m

Parameters:
Returns: Task<'U>
Modifiers: inline
Type parameters: 'T, 'U
f : 'T -> Task<'U>
m : Task<'T>
Returns: Task<'U>

bindWithOptions token continuationOptions scheduler f m

Full Usage: bindWithOptions token continuationOptions scheduler f m

Parameters:
Returns: Task<'U>
Modifiers: inline
Type parameters: 'T, 'U
token : CancellationToken
continuationOptions : TaskContinuationOptions
scheduler : TaskScheduler
f : 'T -> Task<'U>
m : Task<'T>
Returns: Task<'U>

foldM f s

Full Usage: foldM f s

Parameters:
    f : 'a -> 'b -> Task<'a>
    s : 'a

Returns: 'b seq -> Task<'a>
f : 'a -> 'b -> Task<'a>
s : 'a
Returns: 'b seq -> Task<'a>

lift2 f a b

Full Usage: lift2 f a b

Parameters:
    f : 'a -> 'b -> 'c
    a : Task<'a>
    b : Task<'b>

Returns: Task<'c>
Modifiers: inline

Promote a function to a monad/applicative, scanning the monadic/applicative arguments from left to right.

f : 'a -> 'b -> 'c
a : Task<'a>
b : Task<'b>
Returns: Task<'c>

map f m

Full Usage: map f m

Parameters:
    f : 'a -> 'b
    m : Task<'a>

Returns: Task<'b>
Modifiers: inline

Transforms a Task's first value by using a specified mapping function.

f : 'a -> 'b
m : Task<'a>
Returns: Task<'b>

mapM f x

Full Usage: mapM f x

Parameters:
    f : 'a -> Task<'b>
    x : 'a list

Returns: Task<'b list>
Modifiers: inline
f : 'a -> Task<'b>
x : 'a list
Returns: Task<'b list>

mapWithOptions token continuationOptions scheduler f m

Full Usage: mapWithOptions token continuationOptions scheduler f m

Parameters:
Returns: Task<'b>
Modifiers: inline

Transforms a Task's first value by using a specified mapping function.

token : CancellationToken
continuationOptions : TaskContinuationOptions
scheduler : TaskScheduler
f : 'a -> 'b
m : Task<'a>
Returns: Task<'b>

returnM a

Full Usage: returnM a

Parameters:
    a : 'a

Returns: Task<'a>
Modifiers: inline
a : 'a
Returns: Task<'a>

sequence s

Full Usage: sequence s

Parameters:
Returns: Task<'a list>
Modifiers: inline
Type parameters: 'a
s : Task<'a> list
Returns: Task<'a list>

toAsync t

Full Usage: toAsync t

Parameters:
Returns: Async<'T>
t : Task<'T>
Returns: Async<'T>

Active patterns

Active pattern Description

(|AggregateExn|_|) e

Full Usage: (|AggregateExn|_|) e

Parameters:
    e : exn

Returns: exn list option

Active pattern that matches on flattened inner exceptions in an AggregateException

e : exn
Returns: exn list option