ExtraTopLevelOperators (FSharp.Core)
Special prefix operator for splicing untyped expressions into quotation holes.
Special prefix operator for splicing untyped expressions into quotation holes.
-
expression
:
Expr
-
Returns:
'T
let f v = <@@ (%%v: int) + (%%v: int) @@>
f <@@ 5 + 5 @@>;;
val f: v: Quotations.Expr -> Quotations.Expr
val v: Quotations.Expr
Multiple items
val int: value: 'T -> int (requires member op_Explicit)
--------------------
type int = int32
--------------------
type int<'Measure> =
int
<@@ (5 + 5) + (5 + 5) @@>
Special prefix operator for splicing typed expressions into quotation holes.
Special prefix operator for splicing typed expressions into quotation holes.
-
expression
:
Expr<'T>
-
Returns:
'T
let f v = <@ %v + %v @>
f <@ 5 + 5 @>;;
val f: v: Quotations.Expr<int> -> Quotations.Expr<int>
val v: Quotations.Expr<int>
Evaluates to a quotation equivalent to<@ (5 + 5) + (5 + 5) @>
Builds a 2D array from a sequence of sequences of elements.
Builds a 2D array from a sequence of sequences of elements.
-
rows
:
'a seq
-
Returns:
'T[,]
array2D [ [ 1.0; 2.0 ]; [ 3.0; 4.0 ] ]
val array2D: rows: #('T seq) seq -> 'T array2d
Evaluates to a 2x2 zero-based array with contents[[1.0; 2.0]; [3.0; 4.0]]
Builds an asynchronous workflow using computation expression syntax.
Builds an asynchronous workflow using computation expression syntax.
-
Returns:
AsyncBuilder
let sleepExample() =
async {
printfn "sleeping"
do! Async.Sleep 10
printfn "waking up"
return 6
}
sleepExample() |> Async.RunSynchronously
val sleepExample: unit -> Async<int>
val async: AsyncBuilder
val printfn: format: Printf.TextWriterFormat<'T> -> 'T
Multiple items
type Async =
static member AsBeginEnd: computation: ('Arg -> Async<'T>) -> ('Arg * AsyncCallback * obj -> IAsyncResult) * (IAsyncResult -> 'T) * (IAsyncResult -> unit)
static member AwaitEvent: event: IEvent<'Del,'T> * ?cancelAction: (unit -> unit) -> Async<'T> (requires delegate and 'Del :> Delegate)
static member AwaitIAsyncResult: iar: IAsyncResult * ?millisecondsTimeout: int -> Async<bool>
static member AwaitTask: task: Task<'T> -> Async<'T> + 1 overload
static member AwaitWaitHandle: waitHandle: WaitHandle * ?millisecondsTimeout: int -> Async<bool>
static member CancelDefaultToken: unit -> unit
static member Catch: computation: Async<'T> -> Async<Choice<'T,exn>>
static member Choice: computations: Async<'T option> seq -> Async<'T option>
static member FromBeginEnd: beginAction: (AsyncCallback * obj -> IAsyncResult) * endAction: (IAsyncResult -> 'T) * ?cancelAction: (unit -> unit) -> Async<'T> + 3 overloads
static member FromContinuations: callback: (('T -> unit) * (exn -> unit) * (OperationCanceledException -> unit) -> unit) -> Async<'T>
...
--------------------
type Async<'T>
static member Async.Sleep: dueTime: System.TimeSpan -> Async<unit>
static member Async.Sleep: millisecondsDueTime: int -> Async<unit>
static member Async.RunSynchronously: computation: Async<'T> * ?timeout: int * ?cancellationToken: System.Threading.CancellationToken -> 'T
Builds a read-only lookup table from a sequence of key/value pairs. The key objects are indexed using generic hashing and equality.
Builds a read-only lookup table from a sequence of key/value pairs. The key objects are indexed using generic hashing and equality.
-
keyValuePairs
:
('Key * 'Value) seq
-
Returns:
IDictionary<'Key, 'Value>
let table = dict [ (1, 100); (2, 200) ]
table[1]
val table: System.Collections.Generic.IDictionary<int,int>
val dict: keyValuePairs: ('Key * 'Value) seq -> System.Collections.Generic.IDictionary<'Key,'Value> (requires equality)
Evaluates to100.
let table = dict [ (1, 100); (2, 200) ]
table[3]
val table: System.Collections.Generic.IDictionary<int,int>
val dict: keyValuePairs: ('Key * 'Value) seq -> System.Collections.Generic.IDictionary<'Key,'Value> (requires equality)
ThrowsSystem.Collections.Generic.KeyNotFoundException.
Converts the argument to 64-bit float.
Converts the argument to 64-bit float.
-
value
:
^T
-
Returns:
double
double 45
Multiple items
val double: value: 'T -> double (requires member op_Explicit)
--------------------
type double = System.Double
--------------------
type double<'Measure> = float<'Measure>
45.0.
double 12.3f
Multiple items
val double: value: 'T -> double (requires member op_Explicit)
--------------------
type double = System.Double
--------------------
type double<'Measure> = float<'Measure>
12.30000019.
Print to stderr using the given format.
Print to stderr using the given format.
-
format
:
TextWriterFormat<'T> -
The formatter.
-
Returns:
'T -
The formatted result.
See Printf.eprintf (link: Printf.PrintFormatToError) for examples.
Print to stderr using the given format, and add a newline.
Print to stderr using the given format, and add a newline.
-
format
:
TextWriterFormat<'T> -
The formatter.
-
Returns:
'T -
The formatted result.
See Printf.eprintfn (link: Printf.PrintFormatLineToError) for examples.
Print to a string buffer and raise an exception with the given
result. Helper printers must return strings.
Print to a string buffer and raise an exception with the given result. Helper printers must return strings.
-
format
:
StringFormat<'T, 'Result> -
The formatter.
-
Returns:
'T -
The formatted result.
See Printf.failwithf (link: Printf.PrintFormatToStringThenFail) for examples.
Print to a file using the given format.
Print to a file using the given format.
-
textWriter
:
TextWriter -
The file TextWriter.
-
format
:
TextWriterFormat<'T> -
The formatter.
-
Returns:
'T -
The formatted result.
See Printf.fprintf (link: Printf.PrintFormatToTextWriter) for examples.
Print to a file using the given format, and add a newline.
Print to a file using the given format, and add a newline.
-
textWriter
:
TextWriter -
The file TextWriter.
-
format
:
TextWriterFormat<'T> -
The formatter.
-
Returns:
'T -
The formatted result.
See Printf.fprintfn (link: Printf.PrintFormatLineToTextWriter) for examples.
Converts the argument to signed byte.
Converts the argument to signed byte.
-
value
:
^T
-
Returns:
int8
int8 -12
Multiple items
val int8: value: 'T -> int8 (requires member op_Explicit)
--------------------
type int8 = System.SByte
--------------------
type int8<'Measure> = sbyte<'Measure>
-12y.
int8 "3"
Multiple items
val int8: value: 'T -> int8 (requires member op_Explicit)
--------------------
type int8 = System.SByte
--------------------
type int8<'Measure> = sbyte<'Measure>
3y.
Print to stdout using the given format.
Print to stdout using the given format.
-
format
:
TextWriterFormat<'T> -
The formatter.
-
Returns:
'T -
The formatted result.
See Printf.printf (link: Printf.PrintFormat) for examples.
Print to stdout using the given format, and add a newline.
Print to stdout using the given format, and add a newline.
-
format
:
TextWriterFormat<'T> -
The formatter.
-
Returns:
'T -
The formatted result.
See Printf.printfn (link: Printf.PrintFormatLine) for examples.
Builds a query using query syntax and operators.
Builds a query using query syntax and operators.
-
Returns:
QueryBuilder
let findEvensAndSortAndDouble(xs: System.Linq.IQueryable<int>) =
query {
for x in xs do
where (x % 2 = 0)
sortBy x
select (x+x)
}
let data = [1; 2; 6; 7; 3; 6; 2; 1]
findEvensAndSortAndDouble (data.AsQueryable()) |> Seq.toList
val findEvensAndSortAndDouble: xs: System.Linq.IQueryable<int> -> System.Linq.IQueryable<int>
val xs: System.Linq.IQueryable<int>
namespace System
namespace System.Linq
Multiple items
type IQueryable =
inherit IEnumerable
member ElementType: Type
member Expression: Expression
member Provider: IQueryProvider
<summary>Provides functionality to evaluate queries against a specific data source wherein the type of the data is not specified.</summary>
--------------------
type IQueryable<'T> =
inherit IEnumerable<'T>
inherit IEnumerable
inherit IQueryable
<summary>Provides functionality to evaluate queries against a specific data source wherein the type of the data is known.</summary>
<typeparam name="T">The type of the data in the data source.</typeparam>
Multiple items
val int: value: 'T -> int (requires member op_Explicit)
--------------------
type int = int32
--------------------
type int<'Measure> =
int
val query: Linq.QueryBuilder
val x: int
custom operation: where (bool) Calls Linq.QueryBuilder.Where
custom operation: sortBy ('Key) Calls Linq.QueryBuilder.SortBy
custom operation: select ('Result) Calls Linq.QueryBuilder.Select
val data: int list
module Seq from Microsoft.FSharp.Collections
val toList: source: 'T seq -> 'T list
Evaluates to[4; 4; 12; 12].
Builds a read-only lookup table from a sequence of key/value pairs. The key objects are indexed using generic hashing and equality.
Builds a read-only lookup table from a sequence of key/value pairs. The key objects are indexed using generic hashing and equality.
-
keyValuePairs
:
('Key * 'Value) seq
-
Returns:
IReadOnlyDictionary<'Key, 'Value>
let table = readOnlyDict [ (1, 100); (2, 200) ]
table[1]
val table: System.Collections.Generic.IReadOnlyDictionary<int,int>
val readOnlyDict: keyValuePairs: ('Key * 'Value) seq -> System.Collections.Generic.IReadOnlyDictionary<'Key,'Value> (requires equality)
Evaluates to100.
let table = readOnlyDict [ (1, 100); (2, 200) ]
table[3]
val table: System.Collections.Generic.IReadOnlyDictionary<int,int>
val readOnlyDict: keyValuePairs: ('Key * 'Value) seq -> System.Collections.Generic.IReadOnlyDictionary<'Key,'Value> (requires equality)
ThrowsSystem.Collections.Generic.KeyNotFoundException.
Builds a set from a sequence of objects. The objects are indexed using generic comparison.
Builds a set from a sequence of objects. The objects are indexed using generic comparison.
-
elements
:
'T seq -
The input sequence of elements.
-
Returns:
Set<'T> -
The created set.
let values = set [ 1; 2; 3; 5; 7; 11 ]
val values: Set<int>
val set: elements: 'T seq -> Set<'T> (requires comparison)
Evaluates to a set containing the given numbers.
Converts the argument to 32-bit float.
Converts the argument to 32-bit float.
-
value
:
^T
-
Returns:
single
single 45
Multiple items
val single: value: 'T -> single (requires member op_Explicit)
--------------------
type single = System.Single
--------------------
type single<'Measure> = float32<'Measure>
45.0f.
Print to a string using the given format.
Print to a string using the given format.
-
format
:
StringFormat<'T> -
The formatter.
-
Returns:
'T -
The formatted result.
See Printf.sprintf (link: Printf.PrintFormatToStringThen) for examples.
Converts the argument to byte.
Converts the argument to byte.
-
value
:
^T
-
Returns:
uint8
uint8 12
Multiple items
val uint8: value: 'T -> uint8 (requires member op_Explicit)
--------------------
type uint8 = System.Byte
--------------------
type uint8<'Measure> = byte<'Measure>
12uy.