Basic F# Operators. This module is automatically opened in all F# code.
Modules | Description |
Function or value | Description |
Full Usage:
x ** y
Parameters:
^T
-
The input base.
y : ^U
-
The input exponent.
Returns: ^T
The base raised to the exponent.
Modifiers: inline Type parameters: ^T, ^U |
|
Example
val count: int ref
Multiple items
val ref: value: 'T -> 'T ref -------------------- type 'T ref = Ref<'T> property Ref.Value: int with get, set
|
|
Full Usage:
x % y
Parameters:
^T1
-
The first parameter.
y : ^T2
-
The second parameter.
Returns: ^T3
The result of the operation.
Modifiers: inline Type parameters: ^T1, ^T2, ^T3 |
|
Full Usage:
x &&& y
Parameters:
^T
-
The first parameter.
y : ^T
-
The second parameter.
Returns: ^T
The result of the operation.
Modifiers: inline Type parameters: ^T |
Example
val a: int
val b: int
val c: int
Evaluates to 9
|
Full Usage:
x * y
Parameters:
^T1
-
The first parameter.
y : ^T2
-
The second parameter.
Returns: ^T3
The result of the operation.
Modifiers: inline Type parameters: ^T1, ^T2, ^T3 |
|
Full Usage:
x + y
Parameters:
^T1
-
The first parameter.
y : ^T2
-
The second parameter.
Returns: ^T3
The result of the operation.
Modifiers: inline Type parameters: ^T1, ^T2, ^T3 |
|
Full Usage:
x - y
Parameters:
^T1
-
The first parameter.
y : ^T2
-
The second parameter.
Returns: ^T3
The result of the operation.
Modifiers: inline Type parameters: ^T1, ^T2, ^T3 |
|
Full Usage:
(....) start step finish
Parameters:
^T
-
The start value of the range.
step : ^Step
-
The step value of the range.
finish : ^T
-
The end value of the range.
Returns: ^T seq
The sequence spanning the range using the specified step size.
Modifiers: inline Type parameters: ^T, ^Step |
Example
|
Full Usage:
(..) start finish
Parameters:
^T
-
The start value of the range.
finish : ^T
-
The end value of the range.
Returns: ^T seq
The sequence spanning the range.
Modifiers: inline Type parameters: ^T |
Example
|
Full Usage:
x / y
Parameters:
^T1
-
The first parameter.
y : ^T2
-
The second parameter.
Returns: ^T3
The result of the operation.
Modifiers: inline Type parameters: ^T1, ^T2, ^T3 |
|
Full Usage:
cell := value
Parameters:
'T ref
-
The cell to mutate.
value : 'T
-
The value to set inside the cell.
|
Example
val count: int ref
Multiple items
val ref: value: 'T -> 'T ref -------------------- type 'T ref = Ref<'T> property Ref.Value: int with get, set
|
Example
|
|
Full Usage:
func2 << func1
Parameters:
'T2 -> 'T3
-
The second function to apply.
func1 : 'T1 -> 'T2
-
The first function to apply.
Returns: 'T1 -> 'T3
The composition of the input functions.
Modifiers: inline Type parameters: 'T2, 'T3, 'T1 |
Example
val addOne: x: int -> int
val x: int
val doubleIt: x: int -> int
val doubleThenAdd: (int -> int)
|
Full Usage:
value <<< shift
Parameters:
^T
-
The input value.
shift : int32
-
The amount to shift.
Returns: ^T
The result of the operation.
Modifiers: inline Type parameters: ^T |
Example
val a: int
val c: int
Evaluates to 208
|
Example
|
|
Example
|
|
Full Usage:
func <| arg1
Parameters:
'T -> 'U
-
The function.
arg1 : 'T
-
The argument.
Returns: 'U
The function result.
Modifiers: inline Type parameters: 'T, 'U |
|
Full Usage:
(<||) func (arg1, arg2)
Parameters:
'T1 -> 'T2 -> 'U
-
The function.
arg1 : 'T1
-
The first argument.
arg2 : 'T2
-
The second argument.
Returns: 'U
The function result.
Modifiers: inline Type parameters: 'T1, 'T2, 'U |
Example
val sum: x: int -> y: int -> int
val x: int
val y: int
|
Full Usage:
(<|||) func (arg1, arg2, arg3)
Parameters:
'T1 -> 'T2 -> 'T3 -> 'U
-
The function.
arg1 : 'T1
-
The first argument.
arg2 : 'T2
-
The second argument.
arg3 : 'T3
-
The third argument.
Returns: 'U
The function result.
Modifiers: inline Type parameters: 'T1, 'T2, 'T3, 'U |
Example
val sum3: x: int -> y: int -> z: int -> int
val x: int
val y: int
val z: int
|
Example
|
|
Example
|
|
Example
|
|
Full Usage:
func1 >> func2
Parameters:
'T1 -> 'T2
-
The first function to apply.
func2 : 'T2 -> 'T3
-
The second function to apply.
Returns: 'T1 -> 'T3
The composition of the input functions.
Modifiers: inline Type parameters: 'T1, 'T2, 'T3 |
Example
val addOne: x: int -> int
val x: int
val doubleIt: x: int -> int
val addThenDouble: (int -> int)
|
Full Usage:
value >>> shift
Parameters:
^T
-
The input value.
shift : int32
-
The amount to shift.
Returns: ^T
The result of the operation.
Modifiers: inline Type parameters: ^T |
Example
val a: int
val c1: int
val c2: int
|
|
|
Full Usage:
x ^^^ y
Parameters:
^T
-
The first parameter.
y : ^T
-
The second parameter.
Returns: ^T
The result of the operation.
Modifiers: inline Type parameters: ^T |
Example
val a: int
val b: int
val c: int
Evaluates to 6
|
Full Usage:
arg |> func
Parameters:
'T1
-
The argument.
func : 'T1 -> 'U
-
The function.
Returns: 'U
The function result.
Modifiers: inline Type parameters: 'T1, 'U |
|
Full Usage:
(||>) (arg1, arg2) func
Parameters:
'T1
-
The first argument.
arg2 : 'T2
-
The second argument.
func : 'T1 -> 'T2 -> 'U
-
The function.
Returns: 'U
The function result.
Modifiers: inline Type parameters: 'T1, 'T2, 'U |
Example
val sum: x: int -> y: int -> int
val x: int
val y: int
|
Full Usage:
x ||| y
Parameters:
^T
-
The first parameter.
y : ^T
-
The second parameter.
Returns: ^T
The result of the operation.
Modifiers: inline Type parameters: ^T |
Example
val a: int
val b: int
val c: int
Evaluates to 15
|
Full Usage:
(|||>) (arg1, arg2, arg3) func
Parameters:
'T1
-
The first argument.
arg2 : 'T2
-
The second argument.
arg3 : 'T3
-
The third argument.
func : 'T1 -> 'T2 -> 'T3 -> 'U
-
The function.
Returns: 'U
The function result.
Modifiers: inline Type parameters: 'T1, 'T2, 'T3, 'U |
Example
val sum3: x: int -> y: int -> z: int -> int
val x: int
val y: int
val z: int
|
Full Usage:
~+value
Parameters:
^T
-
The input value.
Returns: ^T
The result of the operation.
Modifiers: inline Type parameters: ^T |
|
Full Usage:
~-n
Parameters:
^T
-
The value to negate.
Returns: ^T
The result of the operation.
Modifiers: inline Type parameters: ^T |
|
Full Usage:
~~~value
Parameters:
^T
-
The input value.
Returns: ^T
The result of the operation.
Modifiers: inline Type parameters: ^T |
|
|
Example
val throwException: unit -> bool
val raise: exn: System.Exception -> 'T
Multiple items
val Failure: message: string -> exn -------------------- active recognizer Failure: exn -> string option |
|
Example
val fileDoesNotExist: (string -> bool)
namespace System
namespace System.IO
type File =
static member AppendAllLines: path: string * contents: IEnumerable<string> -> unit + 1 overload
static member AppendAllLinesAsync: path: string * contents: IEnumerable<string> * encoding: Encoding * ?cancellationToken: CancellationToken -> Task + 1 overload
static member AppendAllText: path: string * contents: string -> unit + 1 overload
static member AppendAllTextAsync: path: string * contents: string * encoding: Encoding * ?cancellationToken: CancellationToken -> Task + 1 overload
static member AppendText: path: string -> StreamWriter
static member Copy: sourceFileName: string * destFileName: string -> unit + 1 overload
static member Create: path: string -> FileStream + 2 overloads
static member CreateSymbolicLink: path: string * pathToTarget: string -> FileSystemInfo
static member CreateText: path: string -> StreamWriter
static member Decrypt: path: string -> unit
...
<summary>Provides static methods for the creation, copying, deletion, moving, and opening of a single file, and aids in the creation of <see cref="T:System.IO.FileStream" /> objects.</summary> System.IO.File.Exists(path: string) : bool
|
Full Usage:
abs value
Parameters:
^T
-
The input value.
Returns: ^T
The absolute value of the input.
Modifiers: inline Type parameters: ^T |
|
Full Usage:
acos value
Parameters:
^T
-
The input value.
Returns: ^T
The inverse cosine of the input.
Modifiers: inline Type parameters: ^T |
Example
val angleFromAdjacent: adjacent: float -> hypotenuse: float -> float
val adjacent: float
val hypotenuse: float
val acos: value: 'T -> 'T (requires member Acos)
|
Full Usage:
asin value
Parameters:
^T
-
The input value.
Returns: ^T
The inverse sine of the input.
Modifiers: inline Type parameters: ^T |
Example
val angleFromOpposite: opposite: float -> hypotenuse: float -> float
val opposite: float
val hypotenuse: float
val asin: value: 'T -> 'T (requires member Asin)
|
Full Usage:
atan value
Parameters:
^T
-
The input value.
Returns: ^T
The inverse tangent of the input.
Modifiers: inline Type parameters: ^T |
Example
val angleFrom: opposite: float -> adjacent: float -> float
val opposite: float
val adjacent: float
val atan: value: 'T -> 'T (requires member Atan)
|
Full Usage:
atan2 y x
Parameters:
^T1
-
The y input value.
x : ^T1
-
The x input value.
Returns: 'T2
The inverse tangent of the input ratio.
Modifiers: inline Type parameters: ^T1, 'T2 |
Example
val angleFromPlaneAtXY: x: float -> y: float -> float
val x: float
val y: float
val atan2: y: 'T1 -> x: 'T1 -> 'T2 (requires member Atan2)
namespace System
type Math =
static member Abs: value: decimal -> decimal + 7 overloads
static member Acos: d: float -> float
static member Acosh: d: float -> float
static member Asin: d: float -> float
static member Asinh: d: float -> float
static member Atan: d: float -> float
static member Atan2: y: float * x: float -> float
static member Atanh: d: float -> float
static member BigMul: a: int * b: int -> int64 + 2 overloads
static member BitDecrement: x: float -> float
...
<summary>Provides constants and static methods for trigonometric, logarithmic, and other common mathematical functions.</summary> field System.Math.PI: float = 3.14159265359
|
Example
val x: int
Multiple items
val int: value: 'T -> int (requires member op_Explicit) -------------------- type int = int32 -------------------- type int<'Measure> = int val obj1: obj
val box: value: 'T -> obj
val unbox: value: obj -> 'T
Multiple items
val double: value: 'T -> double (requires member op_Explicit) -------------------- type double = System.Double -------------------- type double<'Measure> = float<'Measure> |
|
Full Usage:
byte value
Parameters:
^T
-
The input value.
Returns: byte
The converted byte
Modifiers: inline Type parameters: ^T |
Example
Multiple items
val byte: value: 'T -> byte (requires member op_Explicit) -------------------- type byte = System.Byte -------------------- type byte<'Measure> = byte |
Full Usage:
ceil value
Parameters:
^T
-
The input value.
Returns: ^T
The ceiling of the input.
Modifiers: inline Type parameters: ^T |
|
Full Usage:
char value
Parameters:
^T
-
The input value.
Returns: char
The converted char.
Modifiers: inline Type parameters: ^T |
Example
Multiple items
val char: value: 'T -> char (requires member op_Explicit) -------------------- type char = System.Char |
Full Usage:
compare e1 e2
Parameters:
'T
-
The first value.
e2 : 'T
-
The second value.
Returns: int
The result of the comparison.
Modifiers: inline Type parameters: 'T |
Example
val compare: e1: 'T -> e2: 'T -> int (requires comparison)
|
Full Usage:
cos value
Parameters:
^T
-
The input value.
Returns: ^T
The cosine of the input.
Modifiers: inline Type parameters: ^T |
Example
val cos: value: 'T -> 'T (requires member Cos)
namespace System
type Math =
static member Abs: value: decimal -> decimal + 7 overloads
static member Acos: d: float -> float
static member Acosh: d: float -> float
static member Asin: d: float -> float
static member Asinh: d: float -> float
static member Atan: d: float -> float
static member Atan2: y: float * x: float -> float
static member Atanh: d: float -> float
static member BigMul: a: int * b: int -> int64 + 2 overloads
static member BitDecrement: x: float -> float
...
<summary>Provides constants and static methods for trigonometric, logarithmic, and other common mathematical functions.</summary> field System.Math.PI: float = 3.14159265359
<summary>Represents the ratio of the circumference of a circle to its diameter, specified by the constant, π.</summary> |
Full Usage:
cosh value
Parameters:
^T
-
The input value.
Returns: ^T
The hyperbolic cosine of the input.
Modifiers: inline Type parameters: ^T |
|
Full Usage:
decimal value
Parameters:
^T
-
The input value.
Returns: decimal
The converted decimal.
Modifiers: inline Type parameters: ^T |
Example
Multiple items
val decimal: value: 'T -> decimal (requires member op_Explicit) -------------------- type decimal = System.Decimal -------------------- type decimal<'Measure> = decimal |
Example
val count: int ref
Multiple items
val ref: value: 'T -> 'T ref -------------------- type 'T ref = Ref<'T> val decr: cell: int ref -> unit
property Ref.Value: int with get, set
|
|
Full Usage:
defaultArg arg defaultValue
Parameters:
'T option
-
An option representing the argument.
defaultValue : 'T
-
The default value of the argument.
Returns: 'T
The argument value. If it is None, the defaultValue is returned.
|
Example
Multiple items
type Vector = new: x: double * y: double * ?z: double -> Vector member X: double member Y: double member Z: double -------------------- new: x: double * y: double * ?z: double -> Vector val x: double
Multiple items
val double: value: 'T -> double (requires member op_Explicit) -------------------- type double = System.Double -------------------- type double<'Measure> = float<'Measure> val y: double
val z: double option
val z: double
val defaultArg: arg: 'T option -> defaultValue: 'T -> 'T
val this: Vector
member Vector.X: double
member Vector.Y: double
member Vector.Z: double
val v1: Vector
property Vector.Z: double with get
val v2: Vector
|
Full Usage:
defaultValueArg arg defaultValue
Parameters:
'T voption
-
A value option representing the argument.
defaultValue : 'T
-
The default value of the argument.
Returns: 'T
The argument value. If it is None, the defaultValue is returned.
|
Example
val arg1: int voption
union case ValueOption.ValueSome: 'T -> ValueOption<'T>
val defaultValueArg: arg: 'T voption -> defaultValue: 'T -> 'T
union case ValueOption.ValueNone: ValueOption<'T>
|
Full Usage:
enum value
Parameters:
int32
-
The input value.
Returns: ^U
The converted enum type.
Modifiers: inline Type parameters: ^U |
Example
[<Struct>]
type Color =
| Red = 1
| Green = 2
| Blue = 3
Color.Red: Color = 1
Color.Green: Color = 2
Color.Blue: Color = 3
val c: Color
val enum: value: int32 -> 'U (requires enum)
|
Full Usage:
exit exitcode
Parameters:
int
-
The exit code to use.
Returns: 'T
Never returns.
|
![]() ![]() ![]() ![]() ![]() ![]() Exit the current hardware isolated process, if security settings permit, otherwise raise an exception. Calls Environment.Exit.
Example
Multiple items
type EntryPointAttribute = inherit Attribute new: unit -> EntryPointAttribute -------------------- new: unit -> EntryPointAttribute val main: argv: string array -> int
val argv: string array
property System.Array.Length: int with get
<summary>Gets the total number of elements in all the dimensions of the <see cref="T:System.Array" />.</summary> <exception cref="T:System.OverflowException">The array is multidimensional and contains more than <see cref="F:System.Int32.MaxValue">Int32.MaxValue</see> elements.</exception> <returns>The total number of elements in all the dimensions of the <see cref="T:System.Array" />; zero if there are no elements in the array.</returns> val eprintfn: format: Printf.TextWriterFormat<'T> -> 'T
val exit: exitcode: int -> 'T
val printfn: format: Printf.TextWriterFormat<'T> -> 'T
|
Full Usage:
exp value
Parameters:
^T
-
The input value.
Returns: ^T
The exponential of the input.
Modifiers: inline Type parameters: ^T |
|
Full Usage:
failwith message
Parameters:
string
-
The exception message.
Returns: 'T
Never returns.
Modifiers: inline Type parameters: 'T |
Example
val failingFunction: unit -> bool
val failwith: message: string -> 'T
|
Full Usage:
float value
Parameters:
^T
-
The input value.
Returns: float
The converted float
Modifiers: inline Type parameters: ^T |
Example
Multiple items
val float: value: 'T -> float (requires member op_Explicit) -------------------- type float = System.Double -------------------- type float<'Measure> = float |
Full Usage:
float32 value
Parameters:
^T
-
The input value.
Returns: float32
The converted float32
Modifiers: inline Type parameters: ^T |
Example
Multiple items
val float32: value: 'T -> float32 (requires member op_Explicit) -------------------- type float32 = System.Single -------------------- type float32<'Measure> = float32 |
Full Usage:
floor value
Parameters:
^T
-
The input value.
Returns: ^T
The floor of the input.
Modifiers: inline Type parameters: ^T |
|
Full Usage:
fst tuple
Parameters:
'T1 * 'T2
-
The input tuple.
Returns: 'T1
The first value.
Modifiers: inline Type parameters: 'T1, 'T2 |
|
![]() ![]() ![]() ![]() ![]() ![]() A generic hash function, designed to return equal hash values for items that are equal according to the "=" operator. By default it will use structural hashing for F# union, record and tuple types, hashing the complete contents of the type. The exact behaviour of the function can be adjusted on a type-by-type basis by implementing GetHashCode for each type.
Example
val hash: obj: 'T -> int (requires equality)
|
|
Full Usage:
id x
Parameters:
'T
-
The input value.
Returns: 'T
The same value.
|
|
Full Usage:
ignore value
Parameters:
'T
-
The value to ignore.
Modifiers: inline Type parameters: 'T |
|
Example
val count: int ref
Multiple items
val ref: value: 'T -> 'T ref -------------------- type 'T ref = Ref<'T> val incr: cell: int ref -> unit
property Ref.Value: int with get, set
|
|
|
|
|
|
Example
Multiple items
val int: value: 'T -> int (requires member op_Explicit) -------------------- type int = int32 -------------------- type int<'Measure> = int |
|
Full Usage:
int16 value
Parameters:
^T
-
The input value.
Returns: int16
The converted int16
Modifiers: inline Type parameters: ^T |
Example
Multiple items
val int16: value: 'T -> int16 (requires member op_Explicit) -------------------- type int16 = System.Int16 -------------------- type int16<'Measure> = int16 |
Full Usage:
int32 value
Parameters:
^T
-
The input value.
Returns: int32
The converted int32
Modifiers: inline Type parameters: ^T |
Example
Multiple items
val int32: value: 'T -> int32 (requires member op_Explicit) -------------------- type int32 = System.Int32 -------------------- type int32<'Measure> = int<'Measure> |
Full Usage:
int64 value
Parameters:
^T
-
The input value.
Returns: int64
The converted int64
Modifiers: inline Type parameters: ^T |
Example
Multiple items
val int64: value: 'T -> int64 (requires member op_Explicit) -------------------- type int64 = System.Int64 -------------------- type int64<'Measure> = int64 |
|
Example
val fullName: firstName: string -> lastName: string -> string
val firstName: string
val lastName: string
module String
from Microsoft.FSharp.Core
val invalidArg: argumentName: string -> message: string -> 'T
val nameof: 'T -> string
Throws System.ArgumentException: First name can't be null or blank (Parameter 'firstName')
|
Full Usage:
invalidOp message
Parameters:
string
-
The exception message.
Returns: 'T
The result value.
Modifiers: inline Type parameters: 'T |
Example
Multiple items
type FileReader = new: fileName: string -> FileReader member Open: unit -> unit -------------------- new: fileName: string -> FileReader val fileName: string
Multiple items
val string: value: 'T -> string -------------------- type string = System.String val mutable isOpen: bool
val this: FileReader
val invalidOp: message: string -> 'T
val reader: FileReader
member FileReader.Open: unit -> unit
|
Full Usage:
isNull value
Parameters:
'T
-
The value to check.
Returns: bool
True when value is null, false otherwise.
Modifiers: inline Type parameters: 'T |
Example
val isNull: value: 'T -> bool (requires 'T: null)
|
|
![]() ![]() ![]() ![]() ![]() ![]() A generic hash function. This function has the same behaviour as 'hash', however the default structural hashing for F# union, record and tuple types stops when the given limit of nodes is reached. The exact behaviour of the function can be adjusted on a type-by-type basis by implementing GetHashCode for each type.
|
Full Usage:
lock lockObject action
Parameters:
'Lock
-
The object to be locked.
action : unit -> 'T
-
The action to perform during the lock.
Returns: 'T
The resulting value.
Modifiers: inline Type parameters: 'Lock, 'T |
Example
namespace System
namespace System.Linq
Multiple items
type TestCounter = new: unit -> TestCounter member IncrementWithLock: unit -> unit member IncrementWithoutLock: unit -> unit member Count: int A counter object, supporting unlocked and locked increment -------------------- new: unit -> TestCounter val mutable count: int
val this: TestCounter
val lock: lockObject: 'Lock -> action: (unit -> 'T) -> 'T (requires reference type)
val counter: TestCounter
Multiple items
val seq: sequence: 'T seq -> 'T seq -------------------- type 'T seq = System.Collections.Generic.IEnumerable<'T> member TestCounter.IncrementWithoutLock: unit -> unit
Increment the counter, unlocked property TestCounter.Count: int with get
Get the count val counter2: TestCounter
member TestCounter.IncrementWithLock: unit -> unit
Increment the counter, locked |
Full Usage:
log value
Parameters:
^T
-
The input value.
Returns: ^T
The natural logarithm of the input.
Modifiers: inline Type parameters: ^T |
Example
val logBase: baseNumber: float -> value: float -> float
val baseNumber: float
val value: float
val log: value: 'T -> 'T (requires member Log)
|
Full Usage:
log10 value
Parameters:
^T
-
The input value.
Returns: ^T
The logarithm to base 10 of the input.
Modifiers: inline Type parameters: ^T |
Example
val log10: value: 'T -> 'T (requires member Log10)
|
Full Usage:
max e1 e2
Parameters:
'T
-
The first value.
e2 : 'T
-
The second value.
Returns: 'T
The maximum value.
Modifiers: inline Type parameters: 'T |
|
|
|
Full Usage:
min e1 e2
Parameters:
'T
-
The first value.
e2 : 'T
-
The second value.
Returns: 'T
The minimum value.
Modifiers: inline Type parameters: 'T |
|
|
Example
val myVariableName: string
val nameof: 'T -> string
|
|
|
|
|
Full Usage:
nativeint value
Parameters:
^T
-
The input value.
Returns: nativeint
The converted nativeint
Modifiers: inline Type parameters: ^T |
Example
Multiple items
val nativeint: value: 'T -> nativeint (requires member op_Explicit) -------------------- type nativeint = System.IntPtr -------------------- type nativeint<'Measure> = nativeint |
Full Usage:
nullArg argumentName
Parameters:
string
-
The argument name.
Returns: 'T
Never returns.
Modifiers: inline Type parameters: 'T |
Example
val fullName: firstName: string -> lastName: string -> string
val firstName: string
val lastName: string
val nullArg: argumentName: string -> 'T
val nameof: 'T -> string
|
Example
val pown: x: 'T -> n: int -> 'T (requires member One and member ( * ) and member (/))
|
|
Example
namespace System
namespace System.IO
exception FileNotFoundException of string
Multiple items
val string: value: 'T -> string -------------------- type string = System.String val readFile: fileName: string -> string
val fileName: string
type File =
static member AppendAllLines: path: string * contents: IEnumerable<string> -> unit + 1 overload
static member AppendAllLinesAsync: path: string * contents: IEnumerable<string> * encoding: Encoding * ?cancellationToken: CancellationToken -> Task + 1 overload
static member AppendAllText: path: string * contents: string -> unit + 1 overload
static member AppendAllTextAsync: path: string * contents: string * encoding: Encoding * ?cancellationToken: CancellationToken -> Task + 1 overload
static member AppendText: path: string -> StreamWriter
static member Copy: sourceFileName: string * destFileName: string -> unit + 1 overload
static member Create: path: string -> FileStream + 2 overloads
static member CreateSymbolicLink: path: string * pathToTarget: string -> FileSystemInfo
static member CreateText: path: string -> StreamWriter
static member Decrypt: path: string -> unit
...
<summary>Provides static methods for the creation, copying, deletion, moving, and opening of a single file, and aids in the creation of <see cref="T:System.IO.FileStream" /> objects.</summary> File.Exists(path: string) : bool
val raise: exn: System.Exception -> 'T
File.ReadAllText(path: string) : string
When executed, raises a File.ReadAllText(path: string, encoding: System.Text.Encoding) : string FileNotFoundException .
|
|
Example
val count: int ref
Multiple items
val ref: value: 'T -> 'T ref -------------------- type 'T ref = Ref<'T> property Ref.Value: int with get, set
|
|
Full Usage:
reraise ()
Parameters:
unit
Returns: 'T
The result value.
Modifiers: inline Type parameters: 'T |
Example
val readFile: fileName: string -> 'a
val fileName: string
Multiple items
val string: value: 'T -> string -------------------- type string = System.String val ex: exn
val eprintfn: format: Printf.TextWriterFormat<'T> -> 'T
val reraise: unit -> 'T
|
Full Usage:
round value
Parameters:
^T
-
The input value.
Returns: ^T
The nearest integer to the input value.
Modifiers: inline Type parameters: ^T |
|
Full Usage:
sbyte value
Parameters:
^T
-
The input value.
Returns: sbyte
The converted sbyte
Modifiers: inline Type parameters: ^T |
Example
Multiple items
val sbyte: value: 'T -> sbyte (requires member op_Explicit) -------------------- type sbyte = System.SByte -------------------- type sbyte<'Measure> = sbyte |
|
|
Full Usage:
sign value
Parameters:
^T
-
The input value.
Returns: int
-1, 0, or 1 depending on the sign of the input.
Modifiers: inline Type parameters: ^T |
Example
val sign: value: 'T -> int (requires member Sign)
|
Full Usage:
sin value
Parameters:
^T
-
The input value.
Returns: ^T
The sine of the input.
Modifiers: inline Type parameters: ^T |
Example
val sin: value: 'T -> 'T (requires member Sin)
namespace System
type Math =
static member Abs: value: decimal -> decimal + 7 overloads
static member Acos: d: float -> float
static member Acosh: d: float -> float
static member Asin: d: float -> float
static member Asinh: d: float -> float
static member Atan: d: float -> float
static member Atan2: y: float * x: float -> float
static member Atanh: d: float -> float
static member BigMul: a: int * b: int -> int64 + 2 overloads
static member BitDecrement: x: float -> float
...
<summary>Provides constants and static methods for trigonometric, logarithmic, and other common mathematical functions.</summary> field System.Math.PI: float = 3.14159265359
<summary>Represents the ratio of the circumference of a circle to its diameter, specified by the constant, π.</summary> |
Full Usage:
sinh value
Parameters:
^T
-
The input value.
Returns: ^T
The hyperbolic sine of the input.
Modifiers: inline Type parameters: ^T |
|
Example
val sizeof<'T> : int
type bool = System.Boolean
Multiple items
val byte: value: 'T -> byte (requires member op_Explicit) -------------------- type byte = System.Byte -------------------- type byte<'Measure> = byte Multiple items
val int: value: 'T -> int (requires member op_Explicit) -------------------- type int = int32 -------------------- type int<'Measure> = int Multiple items
val double: value: 'T -> double (requires member op_Explicit) -------------------- type double = System.Double -------------------- type double<'Measure> = float<'Measure> Multiple items
val nativeint: value: 'T -> nativeint (requires member op_Explicit) -------------------- type nativeint = System.IntPtr -------------------- type nativeint<'Measure> = nativeint |
|
Full Usage:
snd tuple
Parameters:
'T1 * 'T2
-
The input tuple.
Returns: 'T2
The second value.
Modifiers: inline Type parameters: 'T1, 'T2 |
|
Full Usage:
sqrt value
Parameters:
^T
-
The input value.
Returns: ^U
The square root of the input.
Modifiers: inline Type parameters: ^T, ^U |
|
|
|
|
|
|
|
Full Usage:
string value
Parameters:
'T
-
The input value.
Returns: string
The converted string.
Modifiers: inline Type parameters: 'T |
For standard integer and floating point values and any type that implements
Example
Multiple items
val string: value: 'T -> string -------------------- type string = System.String |
Full Usage:
tan value
Parameters:
^T
-
The input value.
Returns: ^T
The tangent of the input.
Modifiers: inline Type parameters: ^T |
Example
val tan: value: 'T -> 'T (requires member Tan)
namespace System
type Math =
static member Abs: value: decimal -> decimal + 7 overloads
static member Acos: d: float -> float
static member Acosh: d: float -> float
static member Asin: d: float -> float
static member Asinh: d: float -> float
static member Atan: d: float -> float
static member Atan2: y: float * x: float -> float
static member Atanh: d: float -> float
static member BigMul: a: int * b: int -> int64 + 2 overloads
static member BitDecrement: x: float -> float
...
<summary>Provides constants and static methods for trigonometric, logarithmic, and other common mathematical functions.</summary> field System.Math.PI: float = 3.14159265359
<summary>Represents the ratio of the circumference of a circle to its diameter, specified by the constant, π.</summary> |
Full Usage:
tanh value
Parameters:
^T
-
The input value.
Returns: ^T
The hyperbolic tangent of the input.
Modifiers: inline Type parameters: ^T |
|
Full Usage:
truncate value
Parameters:
^T
-
The input value.
Returns: ^T
The truncated value.
Modifiers: inline Type parameters: ^T |
|
|
Example
val x: int
Multiple items
val int: value: 'T -> int (requires member op_Explicit) -------------------- type int = int32 -------------------- type int<'Measure> = int val obj1: obj
val box: value: 'T -> obj
val tryUnbox: value: obj -> 'T option
Multiple items
val double: value: 'T -> double (requires member op_Explicit) -------------------- type double = System.Double -------------------- type double<'Measure> = float<'Measure> |
Example
val typeof<'T> : System.Type
Multiple items
val int: value: 'T -> int (requires member op_Explicit) -------------------- type int = int32 -------------------- type int<'Measure> = int type 'T list = List<'T>
val typedefof<'T> : System.Type
|
|
Example
val t: System.Type
val typeof<'T> : System.Type
Multiple items
val int: value: 'T -> int (requires member op_Explicit) -------------------- type int = int32 -------------------- type int<'Measure> = int property System.Type.FullName: string with get
|
|
Full Usage:
uint value
Parameters:
^T
-
The input value.
Returns: uint
The converted int
Modifiers: inline Type parameters: ^T |
Example
Multiple items
val uint: value: 'T -> uint (requires member op_Explicit) -------------------- type uint = uint32 -------------------- type uint<'Measure> = uint |
Full Usage:
uint16 value
Parameters:
^T
-
The input value.
Returns: uint16
The converted uint16
Modifiers: inline Type parameters: ^T |
Example
Multiple items
val uint16: value: 'T -> uint16 (requires member op_Explicit) -------------------- type uint16 = System.UInt16 -------------------- type uint16<'Measure> = uint16 |
Full Usage:
uint32 value
Parameters:
^T
-
The input value.
Returns: uint32
The converted uint32
Modifiers: inline Type parameters: ^T |
Example
Multiple items
val uint32: value: 'T -> uint32 (requires member op_Explicit) -------------------- type uint32 = System.UInt32 -------------------- type uint32<'Measure> = uint<'Measure> |
Full Usage:
uint64 value
Parameters:
^T
-
The input value.
Returns: uint64
The converted uint64
Modifiers: inline Type parameters: ^T |
Example
Multiple items
val uint64: value: 'T -> uint64 (requires member op_Explicit) -------------------- type uint64 = System.UInt64 -------------------- type uint64<'Measure> = uint64 |
Full Usage:
unativeint value
Parameters:
^T
-
The input value.
Returns: unativeint
The converted unativeint
Modifiers: inline Type parameters: ^T |
Example
Multiple items
val unativeint: value: 'T -> unativeint (requires member op_Explicit) -------------------- type unativeint = System.UIntPtr -------------------- type unativeint<'Measure> = unativeint |
Full Usage:
unbox value
Parameters:
obj
-
The boxed value.
Returns: 'T
The unboxed result.
Modifiers: inline Type parameters: 'T |
Example
val x: int
Multiple items
val int: value: 'T -> int (requires member op_Explicit) -------------------- type int = int32 -------------------- type int<'Measure> = int val obj1: obj
val box: value: 'T -> obj
val unbox: value: obj -> 'T
Multiple items
val double: value: 'T -> double (requires member op_Explicit) -------------------- type double = System.Double -------------------- type double<'Measure> = float<'Measure> |
Full Usage:
using resource action
Parameters:
'T
-
The resource to be disposed after action is called.
action : 'T -> 'U
-
The action that accepts the resource.
Returns: 'U
The resulting value.
|
ExampleThe following code appends 10 lines to test.txt, then closes the StreamWriter when finished.
namespace System
namespace System.IO
val using: resource: 'T -> action: ('T -> 'U) -> 'U (requires 'T :> System.IDisposable)
type File =
static member AppendAllLines: path: string * contents: IEnumerable<string> -> unit + 1 overload
static member AppendAllLinesAsync: path: string * contents: IEnumerable<string> * encoding: Encoding * ?cancellationToken: CancellationToken -> Task + 1 overload
static member AppendAllText: path: string * contents: string -> unit + 1 overload
static member AppendAllTextAsync: path: string * contents: string * encoding: Encoding * ?cancellationToken: CancellationToken -> Task + 1 overload
static member AppendText: path: string -> StreamWriter
static member Copy: sourceFileName: string * destFileName: string -> unit + 1 overload
static member Create: path: string -> FileStream + 2 overloads
static member CreateSymbolicLink: path: string * pathToTarget: string -> FileSystemInfo
static member CreateText: path: string -> StreamWriter
static member Decrypt: path: string -> unit
...
<summary>Provides static methods for the creation, copying, deletion, moving, and opening of a single file, and aids in the creation of <see cref="T:System.IO.FileStream" /> objects.</summary> File.AppendText(path: string) : StreamWriter
val writer: StreamWriter
val i: int32
TextWriter.WriteLine() : unit
(+0 other overloads) TextWriter.WriteLine(value: uint64) : unit (+0 other overloads) TextWriter.WriteLine(value: uint32) : unit (+0 other overloads) TextWriter.WriteLine(value: System.Text.StringBuilder) : unit (+0 other overloads) TextWriter.WriteLine(value: float32) : unit (+0 other overloads) TextWriter.WriteLine(value: obj) : unit (+0 other overloads) TextWriter.WriteLine(value: int64) : unit (+0 other overloads) TextWriter.WriteLine(value: int) : unit (+0 other overloads) TextWriter.WriteLine(value: float) : unit (+0 other overloads) TextWriter.WriteLine(value: decimal) : unit (+0 other overloads) |
Active pattern | Description |
|
|
Full Usage:
(|KeyValue|) keyValuePair
Parameters:
KeyValuePair<'Key, 'Value>
-
The input key/value pair.
Returns: 'Key * 'Value
A tuple containing the key and value.
|
Example
val kv: System.Collections.Generic.KeyValuePair<int,string>
namespace System
namespace System.Collections
namespace System.Collections.Generic
Multiple items
[<Struct>] type KeyValuePair<'TKey,'TValue> = new: key: 'TKey * value: 'TValue -> unit member Deconstruct: key: byref<'TKey> * value: byref<'TValue> -> unit member ToString: unit -> string member Key: 'TKey member Value: 'TValue <summary>Defines a key/value pair that can be set or retrieved.</summary> <typeparam name="TKey">The type of the key.</typeparam> <typeparam name="TValue">The type of the value.</typeparam> -------------------- type KeyValuePair = static member Create<'TKey,'TValue> : key: 'TKey * value: 'TValue -> KeyValuePair<'TKey,'TValue> <summary>Creates instances of the <see cref="T:System.Collections.Generic.KeyValuePair`2" /> struct.</summary> -------------------- System.Collections.Generic.KeyValuePair () System.Collections.Generic.KeyValuePair(key: 'TKey, value: 'TValue) : System.Collections.Generic.KeyValuePair<'TKey,'TValue> active recognizer KeyValue: System.Collections.Generic.KeyValuePair<'Key,'Value> -> 'Key * 'Value
val v: string
val k: int
|