FSharp.PowerPack
Lookup or set the given element in the table. Set replaces all existing bindings for a value with a single
bindings. Raise KeyNotFoundException if the element is not found.
Lookup or set the given element in the table. Set replaces all existing bindings for a value with a single
bindings. Raise KeyNotFoundException if the element is not found.
The total number of keys in the hash table
Lookup the given element in the table, returning the result as an Option
Replace the latest binding (if any) for the given element.
Remove the latest binding (if any) for the given element from the table
Apply the given function to each binding in the hash table
Apply the given function to each element in the collection threading the accumulating parameter
through the sequence of function applications
Find all bindings for the given element in the table, if any
Make a shallow copy of the collection
Test if the collection contains any bindings for the given element
Test if the collection contains any bindings for the given element
Clear all elements from the collection
Add a binding for the element to the table
Create a new empty mutable HashMultiMap
with key hash/equality based on the F# structural "hash" and (=) functions.
Create a new empty mutable HashMultiMap with an internal bucket array of the given approximate size
and with key hash/equality based on the F# structural "hash" and (=) functions
Create a new empty mutable HashMultiMap with an internal bucket array of the given approximate size
and with the given key hash/equality functions
Build a map that contains the bindings of the given IEnumerable
Hash tables, by default based on F# structural "hash" and (=) functions.
The table may map a single key to multiple bindings.
The total number of elements in the set
Remove the given element from the set
Apply the given function to each binding in the hash table
Apply the given function to the set threading the accumulating parameter
through the sequence of function applications
Create a new empty mutable hash set
with key hash/equality based on the F# structural "hash" and (=) functions
Create a new empty mutable hash set with an internal bucket array of the given approximate size
and with key hash/equality based on the F# structural "hash" and (=) functions
Create a new empty mutable hash set with an internal bucket array of the given approximate size
and with the given key hash/equality functions
Create a new mutable hash set containing elements drawn from the given sequence
Make a shallow copy of the set
Test if the set contains the given element
Clear all elements from the set
Add an element to the collection
Create a new empty mutable hash set
with key hash/equality based on the F# structural "hash" and (=) functions
Create a new empty mutable hash set with an internal bucket array of the given approximate size
and with key hash/equality based on the F# structural "hash" and (=) functions
Create a new empty mutable hash set with an internal bucket array of the given approximate size
and with the given key hash/equality functions
Create a new mutable hash set containing elements drawn from the given sequence
Mutable hash sets based by default on F# structural "hash" and (=) functions. Implemented via a hash table and/or Dictionary.
LazyLists are possibly-infinite, cached sequences. See also IEnumerable/Seq for
uncached sequences. Calling "get" on the same lazy list value you will keep
getting the same (cached) result. LazyLists normally involve delayed computations
without side-effects, and calling "get" may cause these computations to be executed. The results
of these computations are cached - evaluations will be performed
only once for each element of the lazy list. This is different to IEnumerable/Seq where
recomputation happens each time an enumerator is created and the sequence traversed.
LazyLists can represent cached potentially-infinite computations. Because they are cached they may cause
memory leaks if some part of your code maintains a live reference to
the head of an infinite or very large lazy list while iterating it, or if a reference is
maintained after the list is no longer required.
Although lazy lists are an abstract type you may pattern match against them using the
LazyList.Cons and LazyList.Nil active patterns. These may force the computation of elements
of the list.
Return the stream which contains on demand the elements of the first stream followed
by the elements of the second list
Return the stream which contains on demand the pair of elements of the first and second list
Return the stream which contains on demand the list of elements of the list of lazy lists.
Return a new stream which contains on demand the given item followed by the
given stream.
Return a new stream which contains on demand the given item followed by the
stream returned by the given computation. The computation is
not executed until the elements of the stream are consumed. The
computation is only executed once.
Return a stream that is in effect the stream returned by the given computation.
The given computation is not executed until the first element on the stream is
consumed.
Return the stream without the first 'n' elements of the given stream. Does
not force the evaluation of any cells in the stream.
Evaluates to the stream that contains no items
Return a new collection which on consumption will consist of only the elements of the collection
for which the given predicate returns "true"
Return the first element for which the given function returns true.
Raise KeyNotFoundException if no such element exists.
Apply the given function to successive elements of the list, returning the first
result where function returns Some(x) for some x. If the function never returns
true, 'None' is returned.
Return a new stream consisting of the results of applying the given accumulating function
to successive elements of the stream
Get the first cell of the stream.
Return the first element of the stream. Raise 'Invalid_argument "hd"' if the
stream is empty. Forces the evaluation of
the first cell of the stream if it is not already evaluated.
Build a new collection whose elements are the results of applying the given function
to each of the elements of the collection.
Build a new collection whose elements are the results of applying the given function
to the corresponding elements of the two collections pairwise.
Test if a stream contains at least one element. Forces the evaluation of
the first element of the stream if it is not already evaluated.
Build a collection from the given array. This function will eagerly evaluate all of the
stream (and thus may not terminate).
Build a collection from the given list. This function will eagerly evaluate all of the
stream (and thus may not terminate).
Build a new collection from the given enumerable object
Return the stream which on consumption will consist of an infinite sequence of the given item
Return the stream which on consumption will consist of at most 'n' elements of
the given stream. Does not force the evaluation of any cells in the stream.
Return the stream corresponding to the remaining items in the sequence.
Raise 'Invalid_argument "tl"' if the stream is empty. Forces the evaluation of
the first cell of the stream if it is not already evaluated.
Build an array from the given collection
Build a list from the given collection This function will eagerly evaluate all of the
stream (and thus may not terminate).
Return a view of the collection as an enumerable object
Return a stream that contains the elements returned by the given computation.
The given computation is not executed until the first element on the stream is
consumed. The given argument is passed to the computation. Subsequent elements
in the stream are generated by again applying the residual 'b to the computation.
Build a new array that contains the elements of the first array followed by the elements of the second array
Read a range of elements from the first array and write them into the second.
Apply the given function to each element of the array. Return
the array comprised of the results "x" for each element where
the function returns Some(x)
Combine the two arrays into an array of pairs. The two arrays must have equal lengths.
Build a new array that contains the elements of each of the given list of arrays
Build a new array that contains the elements of the given array
Create an array whose elements are all initially the given value.
Test if any element of the array satisfies the given predicate.
If the input function is f and the elements are i0...iN
then computes p i0 or ... or p iN.
Test elements of the two arrays pairwise to see if any pair of element satisfies the given predicate.
Raise ArgumentException if the arrays have different lengths.
Fill a range of the collection with the given element
Return a new collection containing only the elements of the collection
for which the given predicate returns true
Return the first element for which the given function returns true.
Raise KeyNotFoundException if no such element exists.
Return the index of the first element in the array
that satisfies the given predicate. Raise KeyNotFoundException if
none of the elements satisy the predicate.
Return the index of the first element in the array
that satisfies the given predicate. Raise KeyNotFoundException if
none of the elements satisy the predicate.
Apply the given function to successive elements, returning the first
result where function returns "Some(x)" for some x.
Apply a function to each element of the collection, threading an accumulator argument
through the computation. If the input function is f and the elements are i0...iN
then computes f (... (f s i0)...) iN
Apply a function to pairs of elements drawn from the two collections,
left-to-right, threading an accumulator argument
through the computation. The two input
arrays must have the same lengths, otherwise an ArgumentException is
raised.
Apply a function to each element of the array, threading an accumulator argument
through the computation. If the input function is f and the elements are i0...iN then
computes f i0 (...(f iN s)).
Apply a function to pairs of elements drawn from the two collections, right-to-left,
threading an accumulator argument through the computation. The two input
arrays must have the same lengths, otherwise an ArgumentException is
raised.
Test if all elements of the array satisfy the given predicate.
If the input function is f and the elements are i0...iN and "j0...jN"
then computes p i0 && ... && p iN.
Test elements of the two arrays pairwise to see if all pairs of elements satisfy the given predicate.
Raise ArgumentException if the arrays have different lengths.
Fetch an element from the collection. You can also use the syntax arr.[idx].
Create an array by calling the given generator on each index.
Return true if the given array is empty, otherwise false
Apply the given function to each element of the array.
Apply the given function to two arrays simultaneously. The
two arrays must have the same lengths, otherwise an Invalid_argument exception is
raised.
Apply the given function to each element of the array. The integer passed to the
function indicates the index of element.
Apply the given function to pair of elements drawn from matching indices in two arrays,
also passing the index of the elements. The two arrays must have the same lengths,
otherwise an ArgumentException is raised.
Return the length of the collection. You can also use property arr.Length.
Build a new array whose elements are the results of applying the given function
to each of the elements of the array.
Build a new collection whose elements are the results of applying the given function
to the corresponding elements of the two collections pairwise. The two input
arrays must have the same lengths.
Build a new array whose elements are the results of applying the given function
to each of the elements of the array. The integer index passed to the
function indicates the index of element being transformed.
Build a new collection whose elements are the results of applying the given function
to the corresponding elements of the two collections pairwise. The two input
arrays must have the same lengths, otherwise an ArgumentException is
raised.
Build an array from the given list
Split the collection into two collections, containing the
elements for which the given predicate returns true and false
respectively
Apply a function to each element of the array, threading an accumulator argument
through the computation. If the input function is f and the elements are i0...iN
then computes f (... (f i0 i1)...) iN. Raises ArgumentException if the array has size zero.
Apply a function to each element of the array, threading an accumulator argument
through the computation. If the input function is f and the elements are i0...iN then
computes f i0 (...(f iN-1 iN)). Raises ArgumentException if the array has size zero.
Return a new array with the elements in reverse order
Like fold_left, but return the intermediary and final results
Like fold_right, but return both the intermediary and final results
Set the value of an element in the collection. You can also use the syntax arr.[idx] <- e.
Return an array containing the given element
Sort the elements using the given comparison function
Sort the elements using the key extractor and generic comparison on the keys
Split a list of pairs into two lists
Build a new array that contains the given subrange specified by
starting index and length.
Build a list from the given array
Return a view of the array as an enumerable object
Return the first element for which the given function returns true.
Return None if no such element exists.
Return the index of the first element in the array
that satisfies the given predicate.
Return the index of the first element in the array
that satisfies the given predicate.
Split an array of pairs into two arrays
Combine the two arrays into an array of pairs. The two arrays must have equal lengths, otherwise an ArgumentException is
raised..
Generic operations on the type System.Collections.Generic.List, which is called ResizeArray in the F# libraries.
Lookup or set the given element in the table. Raise KeyNotFoundException if the element is not found.
Lookup or set the given element in the table. Raise KeyNotFoundException if the element is not found.
The number of bindings in the hash table
Lookup the given element in the table, returning the result as an Option
Replace the latest binding (if any) for the given element.
Remove the latest binding (if any) for the given element from the table
Apply the given function to each binding in the hash table
Apply the given function to each element in the collection threading the accumulating parameter
through the sequence of function applications
Find all bindings for the given element in the table, if any
Create a new empty mutable hash table with an internal bucket array of the given approximate size
and with the given key hash/equality functions
Make a shallow copy of the collection
Test if the collection contains any bindings for the given element
Test if the collection contains any bindings for the given element
Clear all elements from the collection
Add a binding for the element to the table
HashMultiMap, but where a constraint tag tracks information about the hash/equality functions used
for the hashing. When the tag is Tags.StructuralHash this is identical to HashMultiMap.
The number of elements in the set
Remove the given element from the set
Apply the given function to each binding in the hash table
Apply the given function to the set threading the accumulating parameter
through the sequence of function applications
Create a new empty mutable hash set with an internal bucket array of the given approximate size
and with the given key hash/equality functions
Make a shallow copy of the set
Test if the set contains the given element
Clear all elements from the set
Add an element to the collection
Mutable hash sets based on F# structural "hash" and (=) functions. Implemented via a hash table and/or Dictionary.
Mutable hash sets where a constraint tag tracks information about the hash/equality functions used
for the hashing. When the tag is Tags.StructuralHash this is identical to HashSet.
Immutable maps. Keys are ordered by construction function specified
when creating empty maps or by F# structural comparison if no
construction function is specified.
Maps based on structural comparison are
efficient for small keys. They are not a suitable choice if keys are recursive data structures
or require non-structural comparison semantics.
Lookup an element in the map. Raise KeyNotFoundException if no binding
exists in the map.
Return true if there are no bindings in the map.
The number of bindings in the map
Lookup an element in the map, returning a Some value if the element is in the domain
of the map and None if not.
The elements of the set as a list.
The elements of the set as an array
Remove an element from the domain of the map. No exception is raised if the element is not present.
Build two new maps, one containing the bindings for which the given predicate returns 'true',
and the other the remaining bindings.
Build a new collection whose elements are the results of applying the given function
to each of the elements of the collection.
Build a new collection whose elements are the results of applying the given function
to each of the elements of the collection. The index passed to the
function indicates the index of element being transformed.
Apply the given function to each binding in the dictionary
Return true if the given predicate returns true for all of the
bindings in the map. Always returns true if the map is empty.
Given the start and end points of a key range,
Fold over the bindings in the map that are in the range,
and the end points are included if present (the range is considered a closed interval).
Fold over the bindings in the map.
Fold over the bindings in the map.
Search the map looking for the first element where the given function returns a Some value
Build a new map containing the bindings for which the given predicate returns 'true'.
Return true if the given predicate returns true for one of the
bindings in the map. Always returns false if the map is empty.
The empty map, and use the given comparer comparison function for all operations associated
with any maps built from this map.
Build a map that contains the bindings of the given IEnumerable
and where comparison of elements is based on the given comparison function
Test is an element is in the domain of the map
Return a new map with the binding added to the given map.
Immutable maps. A constraint tag carries information about the class of key-comparers being used.
Immutable sets based on binary trees, default tag
Return a new set with the elements of the second set removed from the first.
Compute the union of the two sets.
Returns the lowest element in the set according to the ordering being used for the set
Returns the highest element in the set according to the ordering being used for the set
A useful shortcut for Set.is_empty. See the Set module for further operations on sets.
Return the number of elements in the set
The number of elements in the set
Compute the union of the two sets.
The elements of the set as a list.
The elements of the set as an array.
A singleton set based on the given comparison operator
A useful shortcut for Set.remove. Note this operation produces a new set
and does not mutate the original set. The new set will share many storage
nodes with the original. See the Set module for further operations on sets.
Build two new sets, one containing the elements for which the given predicate returns 'true',
and the other the remaining elements.
Apply the given function to each binding in the collection
Evaluates to "true" if all elements of the first set are in the second
Evaluates to "true" if all elements of the second set are in the first
Compute the intersection of the two sets.
Test if all elements of the collection satisfy the given predicate.
If the input function is f and the elements are i0...iN and j0...jN then
computes p i0 && ... && p iN.
Apply the given accumulating function to all the elements of the set
Return a new collection containing only the elements of the collection
for which the given predicate returns "true"
Test if any element of the collection satisfies the given predicate.
If the input function is f and the elements are i0...iN then computes
p i0 or ... or p iN.
Compares two sets and returns true if they are equal or false otherwise
The empty set based on the given comparer
Return a new set with the elements of the second set removed from the first.
A set based on the given comparer containing the given initial elements
A useful shortcut for Set.mem. See the Set module for further operations on sets.
Compares a and b and returns 1 if a > b, -1 if b < a and 0 if a = b
A useful shortcut for Set.add. Note this operation prodcues a new set
and does not mutate the original set. The new set will share many storage
nodes with the original. See the Set module for further operations on sets.
Immutable sets where a constraint tag carries information about the class of key-comparer being used.
The spec value describes the action of the argument,
and whether it expects a following parameter.
"parse specs f use" parses the arguments given by Sys.argv
according to the argument processing specifications "specs".
Arguments begin with "-". Non-arguments are passed to "f" in
order. "use" is printed as part of the usage line if an error occurs.
Permitted arguments are specified using triples: (arg, action, help).
Actions are:
Unit(f): call f, no subseq. arg
Set(br): set ref to 'true', no subseq. arg.
Clear(br): set ref to 'false, no subseq. arg.
String(f): pass the subseq. arg to f
Int(f): pass the subseq. arg to f
Float(f): pass the subseq. arg to f
Rest(f): pass all subseq. args to f in order
"usage specs use" prints the help for each argument.
A simple command-line argument processor.
Is an element in the array, uses (=) equality.
Create a jagged 2 dimensional array.
This member is primarily provided for compatibility with implementations
of ML. F# also supports non-jagged 2D arrays - see the Array2D module and
types such as "int[,]".
Create a jagged 2 dimensional array. Synonym for create.
This member is primarily provided for compatibility with implementations
of ML. F# also supports non-jagged 2D arrays - see the Array2D module and
types such as "int[,]".
Return true if the list is not empty.
Pin the given array for the duration of a single call to the given function. A native pointer to
the first element in the array is passed to the given function. Cleanup the GCHandle associated with the
pin when the function completes, even if an exception is raised.
As for Array.pin, except that the caller is responsible for calling Free on the returned GCHandle in order
to release the pin.
Like reduce, but return both the intermediary and final results
Like reduceBack, but return both the intermediary and final results
Compatibility operations on arrays.
Pin the given array for the duration of a single call to the given function. A native pointer to
the first element in the array is passed to the given function. Cleanup the GCHandle associated with the
pin when the function completes, even if an exception is raised.
As for Array2D.pin, except that the caller is responsible for calling Free on the returned GCHandle in order
to release the pin.
Returns the sum of a and b
Compares a and b and returns 1 if a > b, -1 if b < a and 0 if a = b
Returns a divided by b
Combines the binary representation of a and b by bitwise and
Returns the bitwise logical negation of a
Combines the binary representation of a and b by bitwise or
Combines the binary representation of a and b by bitwise xor
Returns a multiplied by b
Converts a char to a byte
Converts a 32-bit integer to a byte
Converts a 32-bit integer to a byte
Converts a string to a byte
Converts a 16-bit integer to a byte
Converts an unsigned 32-bit integer to a byte
The value one as a System.Byte
Returns the predeccessor of the argument wrapped around 0uy
Returns the remainder of a divided by b
Shifts the binary representation a by n bits to the left
Shifts the binary representation a by n bits to the right
Returns a minus b
Returns the successor of the argument wrapped around 255uy
Converts a byte to a char
Converts a byte to a 32-bit integer
Converts a byte to a 32-bit integer
Converts a byte to a string
Converts a byte to a 16-bit integer
Converts a byte to an unsigned 32-bit integer
The value zero as a System.Byte
Byte (8-bit) operations.
Apply a function to each element of the collection, threading an accumulator argument
through the computation. If the input function is f and the elements are i0...iN
then computes f (... (f s i0)...) iN
Apply a function to each element of the collection, threading an accumulator argument
through the computation. If the input function is f and the elements are i0...iN
then computes f i0 (...(f iN s)).
Apply the given function to each element of the collection.
Apply the given function to each element of the collection. The integer passed to the
function indicates the index of element.
Build a new collection whose elements are the results of applying the given function
to each of the elements of the collection.
Build a new collection whose elements are the results of applying the given function
to each of the elements of the collection. The integer index passed to the
function indicates the index of element being transformed.
Build a collection from the given list
Build a list from the given collection
Byte arrays. Arrays of bytes type-compatible with the C# byte[] type
Converts the value of the specified 32-bit signed integer to its equivalent Unicode character
Converts the value of the specified Unicode character to the equivalent 32-bit signed integer
Compares a and b and returns 1 if a > b, -1 if b < a and 0 if a = b
Converts the value of a Unicode character to its lowercase equivalent
Converts the value of a Unicode character to its uppercase equivalent
Unicode characters, i.e. the System.Char type. see also the operations
in System.Char and the System.Text.Encoding interfaces if necessary.
Combine enum values using 'logical or'. The relevant enumeration type is inferred from context.
Convert an integer to an enumeration value. The result type is inferred from context.
Test if an enumeration value has a particular flag set, using 'logical and'.
The relevant enumeration type is inferred from context.
Convert an enumeration value to an integer. The argument type is inferred from context.
Simple operations to convert between .NET enuemration types and integers
Returns the sum of a and b
Compares a and b and returns 1 if a > b, -1 if b < a and 0 if a = b
Returns a divided by b
Returns a multiplied by b
Returns -a
Converts a raw 32-bit representation to a 32-bit float
Converts a 64-bit float to a 32-bit float
Converts a 32-bit integer to a 32-bit float
Converts a 32-bit integer to a 32-bit float
Converts a 64-bit integer to a 32-bit float
Converts a string to a 32-bit float
Returns a minus b
Converts a 32-bit float to raw 32-bit representation
Converts a 32-bit float to a 64-bit float
Converts a 32-bit float to a 32-bit integer
Converts a 32-bit float to a 32-bit integer
Converts a 32-bit float to a 64-bit integer
Converts a 32-bit float to a string
ML-like operations on 32-bit System.Single floating point numbers.
Returns the sum of a and b
Compares a and b and returns 1 if a > b, -1 if b < a and 0 if a = b
Returns a divided by b
Returns a multiplied by b
Returns -a
Converts a raw 64-bit representation to a 64-bit float
Converts a 32-bit float to a 64-bit float
Converts a 32-bit integer to a 64-bit float
Converts a 32-bit integer to a 64-bit float
Converts a 64-bit integer to a 64-bit float
Converts a string to a 64-bit float
Returns a minus b
Converts a 64-bit float to raw 64-bit representation
Converts a 64-bit float to a 32-bit float
Converts a 64-bit float to a 32-bit integer
Converts a 64-bit float to a 32-bit integer
Converts a 64-bit float to a 64-bit integer
Converts a 64-bit float to a string
ML-like operations on 64-bit System.Double floating point numbers.
Returns the absolute value of the argument
Returns the sum of a and b
Converts a 64-bit float to a raw 32-bit representation
Converts a 32-bit float to a raw 32-bit representation
Compares a and b and returns 1 if a > b, -1 if b < a and 0 if a = b
Returns a divided by b
Converts a raw 32-bit representation to a 32-bit float
Converts a raw 32-bit representation to a 64-bit float
Combines the binary representation of a and b by bitwise and
Returns the bitwise logical negation of a
Combines the binary representation of a and b by bitwise or
Combines the binary representation of a and b by bitwise xor
Returns the largest 32-bit signed integer
Returns the smallest 32-bit signed integer
The value minus one as a System.Int32
Returns a multiplied by b
Returns -a
Converts a 64-bit float to a 32-bit integer
Converts a 32-bit float to a 32-bit integer
Converts a 32-bit integer to a 32-bit integer (included for ML compatability)
Converts a 64-bit unsigned integer to a 32-bit integer
Converts a 32-bit unsigned integer to a 32-bit integer
Converts a string to a 32-bit integer
Converts a 32-bit unsigned integer to a 32-bit integer
The value one as a System.Int32
Returns the predeccessor of the argument
Returns the remainder of a divided by b
Shifts the binary representation a by n bits to the left
Shifts the binary representation a by n bits to the right; high-order empty bits are set to the sign bit
Shifts the binary representation a by n bits to the right; high-order bits are zero-filled
Returns a minus b
Returns the successor of the argument
Converts a 32-bit integer to a 64-bit float
Converts a 32-bit integer to a 32-bit float
Converts a 32-bit integer to a 32-bit integer (included for ML compatability)
Converts a 32-bit unsigned integer to a 64-bit integer
Converts a 32-bit unsigned integer to a 32-bit integer
Converts a 32-bit integer to a string
Converts a 32-bit integer to a 32-bit unsigned integer
The value zero as a System.Int32
Basic operations on 32-bit integers. The type int32 is identical to System.Int32.
Returns the absolute value of the argument
Returns the sum of a and b
Converts a 64-bit float to a raw 64-bit representation
Compares a and b and returns 1 if a > b, -1 if b < a and 0 if a = b
Returns a divided by b
Converts a raw 64-bit representation to a 64-bit float
Combines the binary representation of a and b by bitwise and
Returns the bitwise logical negation of a
Combines the binary representation of a and b by bitwise or
Combines the binary representation of a and b by bitwise xor
Returns the largest 64-bit signed integer
Returns the smallest 64-bit signed integer
The value minus one as a System.Int64
Returns a multiplied by b
Returns -a
Converts a 64-bit float to a 64-bit integer
Converts a 32-bit float to a 64-bit integer
Converts a 32-bit integer to a 64-bit integer
Converts a 32-bit integer to a 64-bit integer
Converts a native integer to a 64-bit integer
Converts a string to a 64-bit integer
Converts an unsigned 64-bit integer to a 64-bit integer
The value one as a System.Int64
Returns the predeccessor of the argument
Returns the remainder of a divided by b
Shifts the binary representation a by n bits to the left
Shifts the binary representation a by n bits to the right; high-order empty bits are set to the sign bit
Shifts the binary representation a by n bits to the right; high-order bits are zero-filled
Returns a minus b
Returns the successor of the argument
Converts a 64-bit integer to a 64-bit float
Converts a 64-bit integer to a 32-bit float
Converts a 64-bit integer to a 32-bit integer
Converts a 64-bit integer to a 32-bit integer
Converts a 64-bit integer to a native integer
Converts a 64-bit integer to a string
Converts a 64-bit integer to an unsigned 64-bit integer
The value zero as a System.Int64
Basic operations on 64-bit integers. The type int64 is identical to System.Int64.
Build a lazy (delayed) value from the given computation
See Lazy.Force
See Lazy.Force.
See Lazy.SynchronizedForce.
See Lazy.UnsynchronizedForce
Build a lazy (delayed) value from the given computation
Build a lazy (delayed) value from the given pre-computed value.
Check if a lazy (delayed) value has already been computed
Lookup key's data in association list, uses (=) equality.
Raise System.IndexOutOfRangeException exception if key not found, in which case you should typically use try_assoc instead.
See assoc, but uses the physical equality operator (==) for equality tests
Is an element in the list. Elements are compared using generic equality.
Is an element in the list. Elements are compared using generic equality.
Does the key have pair in the association list?
See mem_assoc, but uses the physical equality operator (==) for equality tests.
See mem, but uses the physical equality operator (==) for equality tests.
Return true if the list is not empty.
Remove pair for key from the association list (if it's there).
See remove_assoc, but uses the physical equality operator (==) for equality tests.
"rev_append l1 l2" evaluates to "append (rev l1) l2"
"rev_map f l1" evaluates to "map f (rev l1)"
"rev_map2 f l1 l2" evaluates to "map2 f (rev l1) (rev l2)"
Like reduce_left, but return both the intermediary and final results
Like reduce_right, but return both the intermediary and final results
Lookup key's data in association list, uses (=) equality,
returning "Some data" or "None".
See try_assoc, but uses the physical equality operator (==) for equality tests.
Compatibility operations on lists.
A collection of operations for creating and using maps based on a particular comparison function.
The 'Tag type parameter is used to track information about the comparison function.
For use when not opening the Map module, e.g. Map.t
A functor to build a collection of operations for creating and using
maps based on the given comparison function. This returns a record that
contains the functions you use to create and manipulate maps of
this kind. The returned value is much like an ML module.
Language restrictions related to polymorphism may mean you
have to create a new instantiation of for each toplevel
key/value type pair.
To use this function you need to define a new named class that implements IComparer and
pass an instance of that class as the first argument. For example:
type MyComparer =
new() = { }
interface IComparer<string> with
member self.Compare(x,y) = ...
let MyStringMapProvider : Map.Provider < string,int > = Map.MakeTagged(new MyComparer())
Fold over the bindings in the map
Extension functionality for maps using structural comparison
Big_int compatability module for arbitrary sized integers.
Add second buffer to the first.
Read the given number of bytes as ASCII and add the resulting string
to the buffer. Warning: this assumes an ASCII encoding for the I/O channel, i.e. it uses
Pervasives.really_input and then use ascii_to_string to produce the string
to add.
Add character to the buffer.
Add string to the buffer.
Given a string, start position and length add that substring to the buffer.
Clears the buffer.
Gets the string built from the buffer.
Create a buffer with suggested size.
Number of characters in the buffer.
Clears the buffer (same as Buffer.clear).
Imperative buffers for building strings, a shallow interface to System.Text.StringBuilder
"dirname" and "basename" decompose a filename into a directory name
and a filename, i.e. "concat (dirname s) (basename s) = s"
"check_suffix f s" returns true if filename "f" ends in suffix "s",
e.g. check_suffix "abc.fs" ".fs" returns true.
"chop_extension f" removes the extension from the given
filename. Raises ArgumentException if no extension is present.
Assuming "check_suffix f s" holds, "chop_suffix f s" returns the
filename "f" with the suffix "s" removed.
"concat a b" returns System.IO.Path.Combine(a,b), i.e. the
two names conjoined by the appropriate directory separator character
for this architecture.
The name used for the current directory on this OS.
"dirname" and "basename" decompose a filename into a directory name
and a filename, i.e. "concat (dirname s) (basename s) = s"
Return true if the filename has a "." extension
Returns true if the path is relative to the current directory but does not begin with
an explicit "." or ".."
Is the path is relative to the current directory or absolute.
"parent_dir_name" returns the name for the directory above the current directory on
this OS.
"quote s" is designed for use to quote a filename when using it
for a system command. It returns ("\'" ^ s ^ "\'").
"temp_file f s" returns a hitherto unused new file name. "f" and "s"
are hints as to a suitable file name and suffix for the file.
Common filename operations. This module is included to make it possible to cross-compile
code with other ML compilers. See also System.IO.Path
A collection of operations for creating and using hash tables based on particular type-tracked hash/equality functions.
Generated by the Hashtbl.Make and Hashtbl.MakeTagged functors. This type is for use when you wish to
specify a comparison function once and carry around an object that is a provider of (i.e. a factory for) hashtables
that utilize that comparison function.
The 'Tag' type parameter is used to track information about the comparison function, which helps ensure
that you don't mixup maps created with different comparison functions
OCaml compatible type name, for use when not opening module, e.g. Hashtbl.t
Build a collection of operations for creating and using
hashtables based on the given hash/equality functions. This returns a record
that contains the functions you use to create and manipulate tables of
this kind. The returned value is much like an ML module. You should call Make once for
each new pair of key/value types. You may need to constrain the result
to be an instantiation of Provider.
let MyStringHashProvider : Provider<string,int> = Hashtbl.Make(myStringHash,myStringEq)
Same as Make, except track the comparison function being used through an additional type parameter.
To use this function accurately you need to define a new named class that implements IEqualityComparer and
pass an instance of that class as the first argument. For example:
type MyHasher =
class
new() = { }
interface IEqualityComparer<string> with
member self.GetHashCode(x) = ...
member self.Equals(x,y) = ...
end
end
let MyStringHashProvider : Hashtbl.Provider<string,int> = Hashtbl.MakeTagged(new MyStringHasher())
Add key and data to the table.
Empty the table.
Create a copy of the table. Remember they are imperative and get mutated.
Create a hash table with the suggested initial size.
Inlined to enable generation of efficient hash routines for the key type in the common case.
Lookup key's data in the table.
Raises exception is key not in table, if this could happen you should be using tryfind.
Return all bindings for the given key
Fold over all bindings
Hash on the structure of a value according to the F# structural hashing
conventions. See Pervasives.hash
Hash on the identity of an object. See Pervasives.hashq.
Apply the given function to each binding in the hash table
Test for the existence of any bindings for the given key
Create a hash table using the given data
Create hash table using the given data
Inlined to enable generation of efficient hash routines for the key type in the common case.
Remove the latest binding for the given key
Replace the latest binding for the given key
Lookup the key's data in the table
Multi-entry hash tables using the structural "hash" and "equals" functions.
These tables can be used with keys of any type, but you should check that
structural hashing and equality are correct for your key type.
Structural hashing is efficient but not a suitable choice in all circumstances,
e.g. may not hash efficiently on non-reference types and deeply-structured types.
Better efficiency is typically achieved if key types are F#-generated
types.
These hash tables may map items to multiple keys (see find_all).
The implementations are not safe for concurrent reading/writing,
and so users of these tables should take an appropriate lock
before reading/writing if used in a concurrent setting.
ASCII LexBuffers
The type "lexbuf" is opaque, but has an internal position information field
that can be updated by setting "lexbuf.EndPos", for example if you wish
to update the other fields in that position data before or during
lexing. You will need to do this if you wish to maintain accurate
line-count information. If you do this and wish to maintain strict
cross-compiling compatibility with OCamlLex and other tools you may need code
to conditionally use lexbuf_set_curr_p when compiling F# code.
Remove all input, though don't discard the except the current lexeme
Fuel a lexer using the given BinaryReader.
Fuel a lexer from an array of bytes
Fuel a lexer using the given in_channel. The bytes are read using Pervasives.input.
If the in_channel is a textual channel the bytes are
presented to the lexer by decoding the characters using System.Text.Encoding.ASCII.
Fuel a lexer from function that fills an array of bytes up to the given length, returning the
number of bytes filled.
Fuel a lexer from a string, converted to ascii using System.Text.Encoding.ASCII.GetBytes
Fuel a lexer using the given TextReader or StreamReader.
The characters read are decoded to bytes using the given encoding (e.g. System.Text.Encoding.ASCII)
and the bytes presented to the lexer. The encoding used to decode the characters
is associated with the expectations of the lexer (e.g. a lexer may be constructed to accept only
ASCII or pseudo-UTF8 bytes) and will typically be different to
the encoding used to decode the file.
same as lexeme_end_p
Return the matched string
Return the bytes for the matched string
Return a character from the matched string, innterpreting the bytes using an ASCII encoding
Return absolute positions into the entire stream of characters
Return the positions stored in the lexbuf for the matched string
Return absolute positions into the entire stream of characters
Return the positions stored in the lexbuf for the matched string
Return the matched string interpreting the bytes using the given Unicode text encoding
Lexing: ML-like lexing support
This file maintains rough compatibility for lexbuffers used by some ML
laxer generators. The lexbuf carries an associated pair of positions.
Beware that only the "cnum" (absolute character number) field is automatically
updated as each lexeme is matched. Upon each successful match the prior end
position is transferred to be the start position and a new start position
is allocated with an updated pos_cnum field.
See Microsoft.FSharp.Core.LanguagePrimitives.PhysicalEquality
Negation of Obj.eq (i.e. reference/physical inequality)
See Microsoft.FSharp.Core.Operators.unbox
See Microsoft.FSharp.Core.Operators.box
You can initialize error recovery by raising the Parse_error exception.
Parsing: parser support for parsers produced by fsyacc.
Parsers generated by fsyacc provide location information within parser
actions. However that information is not available globally, but
rather is accessed via the functions available on the following local
variable which is available in all parser actions:
parseState : 'a Microsoft.FSharp.Text.Parsing.IParseState
However, this is not compatible with the parser specifications used
with ocamlyacc and similar tools, which make a single parser state available
globally. If you wish to use a global parser state (e.g. so your code will
cross-compile with OCaml) then you can use the functions in this file.
You will need to either generate the parser with '--ml-compatibility' option
or add the code
Parsing.set_parse_state parseState;
at the start of each action of your grammar. The functions below
simply report the results of corresponding calls to the latest object
specified by a call to set_parse_state.
Note that there could be unprotected multi-threaded concurrent access for the
parser information, so you should not in general use these
functions if there may be more than one parser active, and
should instead use the functions directly available from the parseState
object.
A pseudo-abstraction over binary and textual input channels.
OCaml-compatible channels conflate binary and text IO, and for this reasons their
use from F# is somewhat deprecated (direct use of System.IO StreamReader, TextReader and
BinaryReader objects is preferred, e.g. see System.IO.File.OpenText).
Well-written OCaml-compatible code that simply opens either a channel in text or binary
mode and then does text or binary I/O using the OCaml-compatible functions below
will work, though care must be taken with regard to end-of-line characters (see
input_char below).
This library pretends that an in_channel is just a System.IO.TextReader. Channel values
created using open_in_bin maintain a private System.IO.BinaryReader, which will be used whenever
you do I/O using this channel.
InChannel.of_BinaryReader and InChannel.of_StreamReader allow you to build input
channels out of the corresponding .NET abstractions.
This type is present primarily for compatibility with other versions of ML. When
not cross-compiling we recommend using the .NET I/O libraries
An pseudo-abstraction over binary and textual output channels.
OCaml-compatible channels conflate binary and text IO, and for this reasons their
use from F# is somewhat deprecated The direct use of System.IO StreamWriter, TextWriter and
BinaryWriter objects is preferred, e.g. see System.IO.File.CreateText). Well-written OCaml code
that simply opens either a channel in text or binary mode and then does text
or binary I/O using the OCaml functions will work, though care must
be taken with regard to end-of-line characters (see output_char below).
This library pretends that an out_channel is just a System.IO.TextWriter. Channels
created using open_out_bin maintain a private System.IO.BinaryWriter, which will be used whenever
do I/O using this channel.
The exception thrown by invalid_arg and misues of F# library functions
Close the channel
Close the given output channel
This value is present primarily for compatibility with other versions of ML
The smallest value that when added to 1.0 gives a different value to 1.0
Flush all pending output on the channel to the physical
output device.
Return the length of the input channel
Attempt to input the given number of bytes from the channel, writing them into the
buffer at the given start position. Does not block if the bytes are not available.
The use of this function with a channel performing byte-to-character translation (e.g. one
created with open_in, open_in_utf8 or open_in_encoded, or one
or built from a StreamReader or TextReader) is not recommended.
Instead, open the channel using open_in_bin or InChannel.of_BinaryReader.
If used with a StreamReader channel, i.e. one created using
open_in, open_in_utf8 or open_in_encoded, or one
or built from a StreamReader, this function reads bytes directly from the underlying
BaseStream. This may not be appropriate if any other input techniques are being
used on the channel.
If used with a TextReader channel (e.g. stdin), this function reads characters from the
stream and then fills some of the byte array with the decoding of these into
bytes, where the decoding is performed using the System.Text.Encoding.Default encoding
Raise End_of_file (= System.IO.EndOfStreamException) if end of file reached.
Input a binary integer from a binary channel. Compatible with output_binary_int.
Input a single byte.
For text channels this only accepts characters with a UTF16 encoding that fits in a byte, e.g. ASCII.
Raise End_of_file (= System.IO.EndOfStreamException) if end of file reached.
Input a single character. Raise End_of_file (= System.IO.EndOfStreamException) if end of file reached.
Attempt to input characters from a channel. Does not block if inpout is not available.
Raise End_of_file (= System.IO.EndOfStreamException) if end of file reached.
No CRLF translation is done on input, even in text mode. That is, if an input file
has '\r\n' (CRLF) line terminators both characters will be seen in the input.
Input a single line. Raise End_of_file (= System.IO.EndOfStreamException) if end of file reached.
Input a single serialized value from a binary stream. Raise End_of_file (= System.IO.EndOfStreamException) if end of file reached.
Negation on integers of the 'int' type
Throw an Invalid_argument exception
This value is present primarily for compatibility with other versions of ML
The highest representable positive value in the 'float' type
The highest representable value in the 'int' type
This value is present primarily for compatibility with other versions of ML
The lowest non-denormalized positive IEEE64 float
The lowest representable value in the 'int' type
This value is present primarily for compatibility with other versions of ML
This value is present primarily for compatibility with other versions of ML
This value is present primarily for compatibility with other versions of ML
1D Array element set-accessor ('setter')
1D Array element get-accessor ('getter')
Negation of the '==' operator, see also Obj.eq
This value is present primarily for compatibility with other versions of ML. In F#
the overloaded operators may be used.
Reference/physical equality.
True if boxed versions of the inputs are reference-equal, OR if
both are value types and the implementation of Object.Equals for the type
of the first argument returns true on the boxed versions of the inputs.
In normal use on reference types or non-mutable value types this function
has the following properties:
- returns 'true' for two F# values where mutation of data
in mutable fields of one affects mutation of data in the other
- will return 'true' if (=) returns true
- hashq will return equal hashes if (==) returns 'true'
The use on mutable value types is not recommended.
This value is present primarily for compatibility with other versions of ML. In F#
the overloaded operators may be used.
This value is present primarily for compatibility with other versions of ML
This value is present primarily for compatibility with other versions of ML. In F#
the overloaded operators may be used.
This value is present primarily for compatibility with other versions of ML. In F#
the overloaded operators may be used.
This value is present primarily for compatibility with other versions of ML. In F#
the overloaded operators may be used.
Open the given file to read.
In the absence of an explicit encoding (e.g. using Open_encoding) open_in
uses the default text encoding (System.Text.Encoding.Default). If you want to read a file
regardless of encoding then you should use binary modes. Note that .NET's
"new StreamReader" function defaults to use a utf8 encoding, and also attempts
to determine an automatic encoding by looking for "byteorder-marks" at the head
of a text file. This function does not do this.
No CR-LF translation is done on input.
Open the given file to read in binary-mode
Open the given file in the mode specified by the given flags
Open the given file to read in text-mode using the UTF8 encoding
Open the given file to write in text-mode using the
System.Text.Encoding.Default encoding
See output_char for a description of CR-LF translation
done on output.
Open the given file to write in binary-mode
Open the given file to write in text-mode using the given encoding
Open the given file to write in the mode according to the specified flags
Open the given file to write in text-mode using the UTF8 encoding
Return the length of the output channel.
Raise an exception if not an app
Write the given range of bytes to the output channel.
Write the given integer to the output channel in binary format.
Only valid on binary channels.
Write the given byte to the output channel. No CRLF translation is
performed.
Write all the given bytes to the output channel. No CRLF translation is
performed.
Write the given Unicode character to the output channel.
If the output channel is a binary stream and the UTF-16 value of the Unicode character is greater
than 255 then ArgumentException is thrown.
No CRLF translation is done on output. That is, if the output character is
'\n' (LF) characters they will not be written as '\r\n' (CRLF) characters, regardless
of whether the underlying operating system or output stream uses CRLF as the default
line-feed character.
Write the given Unicode string to the output channel. See output_char for the treatment of
'\n' characters within the string.
Serialize the given value to the output channel.
Report the current position in the input channel
Return the current position in the output channel, measured from the
start of the channel. Not valid on all channels.
n-1 (no overflow checking)
Print a character to the stderr stream
Read a floating point number from the console.
Read an integer from the console.
Read a line from the console, without the end-of-line character.
Reads bytes from the channel. Blocks if the bytes are not available.
See 'input' for treatment of text channels.
Raise End_of_file (= System.IO.EndOfStreamException) if end of file reached.
Reads bytes from the channel. Blocks if the bytes are not available.
For text channels this only accepts UTF-16 bytes with an encoding less than 256.
Raise End_of_file (= System.IO.EndOfStreamException) if end of file reached.
Set the current position in the output channel, measured from the
start of the channel.
Set the binary mode to true or false. If the binary mode is changed from "true" to
"false" then a StreamReader is created to read the binary stream. The StreamReader uses
the default text encoding System.Text.Encoding.Default
Set the binary mode. If the binary mode is changed from "true" to
"false" then a StreamWriter is created to write the binary stream. The StreamWriter uses
the default text encoding System.Text.Encoding.Default.
n+1 (no overflow checking)
The exception thrown by 'assert' failures.
A future release of F# may map this exception to a corresponding .NET exception.
Non-exhaustive match failures will raise Match failures
A future release of F# may map this exception to a corresponding .NET exception.
Link .NET IO with the out_channel/in_channel model
Wrap a stream by creating a StreamReader for the
stream and then wrapping is as an input channel.
A text encoding must be given, e.g. System.Text.Encoding.UTF8
Link .NET IO with the out_channel/in_channel model
Link .NET IO with the out_channel/in_channel model
Access the underlying stream-based objects for the channel
Link .NET IO with the out_channel/in_channel model
Access the underlying stream-based objects for the channel
Access the underlying stream-based objects for the channel
Link .NET IO with the out_channel/in_channel model
Wrap a stream by creating a StreamWriter for the
stream and then wrapping is as an output channel.
A text encoding must be given, e.g. System.Text.Encoding.UTF8
Link .NET IO with the out_channel/in_channel model
Link .NET IO with the out_channel/in_channel model
Access the underlying stream-based objects for the channel
Access the underlying stream-based objects for the channel
Access the underlying stream-based objects for the channel
Access the underlying stream-based objects for the channel
The type of simple immutable lists
The type of None/Some options
The type of pointers to mutable reference cells
Absolute value of the given integer
Structural comparison
Decrement a mutable reference cell containing an integer
Exit the current hardware isolated process, if security settings permit,
otherwise raise an exception. Calls System.Environment.Exit.
Throw a 'Failure' exception
The "hash" function is a structural hash function. It is
designed to return equal hash values for items that are
equal according to the polymorphic equality
function Pervasives.(=) (i.e. the standard "=" operator).
Increment a mutable reference cell containing an integer
Maximum based on structural comparison
Minimum based on structural comparison
Concatenate two lists.
Assign to a mutable reference cell
Concatenate two strings. The overlaoded operator '+' may also be used.
Dereference a mutable reference cell
Structural equality
Structural greater-than
Structural greater-than-or-equal
Structural inequality
Structural less-than comparison
Structural less-than-or-equal comparison
Throw an exception
Create a mutable reference cell
The exception thrown by failure and many other F# functions
A future release of F# may map this exception to a corresponding .NET exception.
Pervasives: Additional OCaml-compatible bindings
Compatibility module to display data about exceptions.
The array of command line options. Gives the command line arguments
as returned by System.Environment.GetCommandLineArgs.
Sets the current working directory for the process using System.IO.Directory.SetCurrentDirectory
Run the command and return it's exit code.
Warning: 'command' currently attempts to execute the string using
the 'cmd.exe' shell processor. If it is not present on the system
then the operation will fail. Use System.Diagnostics.Process
directly to run commands in a portable way, which involves specifying
the program to run and the arguments independently.
Path of the current executable, using
System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory,System.AppDomain.CurrentDomain.FriendlyName)
Returns true if a file currently exists, using System.IO.File.Exists(s).
Returns the current working directory for the process using System.IO.Directory.GetCurrentDirectory
Call System.Environment.GetEnvironmentVariable. Raise KeyNotFoundException if the variable is not defined.
Deletes a file using System.IO.File.Delete.
Rename a file on disk using System.IO.File.Move
Time consumed by the main thread. (for approximate timings).
Generally returns only the processor time used by the main
thread of the application.
The number of bits in the "int" type.
Sys: Basic system operations (for ML compatibility)
This module is only included to make it possible to cross-compile
code with other ML compilers. It may be deprecated and/or removed in
a future release. You may wish to use .NET functions directly instead.
The identity permutation over any size
Create a permutation by specifying the result of permuting [| 0 .. n-1 |]. For example,
Permutation.of_array [| 1;2;0 |] specifies a permutation that rotates all elements right one place.
Create a permutation by specifying (source,destination) index pairs. For example,
Permutation(3,[ (0,2);(1,0); (2,1) ]) specifies a permutation that rotates
all elements left one place. Not all elements need be given, e.g.
Permutation(5,[ (1,2);(2,1) |]) specifies a permutation that swaps elements at indexes
1 and 2.
Return a permutation that, when applied, maps index 0 to size-1, size-1 to 0 etc.
Return a permutation that rotates right by the given distance. If the distance
is negative then a left rotation results.
Return a swaps the given two elements over any size
Simple operations on signed bytes
A synonym for Seq.zip
Return an IEnumerable that when iterated yields
the given item followed by the items in the given sequence
Return true if the IEnumerable is not empty.
A collection of operations for creating and using sets based on a particular comparison function.
The 'Tag' type parameter is used to track information about the comparison function.
For use when not opening the Set module, e.g. Set.t
Build a collection of operations for creating and using
maps based on a single consistent comparison function. This returns a record
that contains the functions you use to create and manipulate maps all of which
use this comparison function. The returned value is much like an ML module.
Use MakeTagged if you want additional type safety that guarantees that two sets
based on different comparison functions can never be combined in inconsistent ways.
A functor to build a collection of operations for creating and using
sets based on the given comparison function. This returns a record that
contains the functions you use to create and manipulate maps of
this kind. The returned value is much like an ML module.
To use this function you need to define a new named class that implements IComparer and
pass an instance of that class as the first argument. For example:
type MyComparer() =
interface IComparer<string> with
member self.Compare(x,y) = ...
let MyStringSetProvider = Set.MakeTagged(new MyComparer())
The elements of the set as a list.
Compute the intersection of the two sets.
Immutable sets implemented via binary trees
Return a string with the first character converted to uppercase.
Compare the given strings using ordinal comparison
Return true is the given string contains the given character
Return true is the given string contains the given character in the
range specified by the given start index and the given length
Return true is the given string contains the given character in the
range from the given start index to the end of the string.
Returns the character at the specified position in the string
Return the first index of the given character in the
string. Raise KeyNotFoundException if
the string does not contain the given character.
Return the first index of the given character in the
range from the given start position to the end of the string.
Raise KeyNotFoundException if
the string does not contain the given character.
Return a new string with all characters converted to lowercase
Return a string of the given length containing repetitions of the given character
Return s string of length 1 containing the given character
Return true if the string contains the given character prior to the given index
Return the index of the first occurrence of the given character
from the end of the string proceeding backwards
Return the index of the first occurrence of the given character
starting from the given index proceeding backwards.
Split the string using the given list of separator characters.
Trimming is also performed at both ends of the string and any empty
strings that result from the split are discarded.
Return a substring of length 'length' starting index 'start'.
Removes all occurrences of a set of characters specified in a
list from the beginning and end of this instance.
Return a string with the first character converted to lowercase.
Return a string with all characters converted to uppercase.
Compatibility module for string processing. Richer string operations
are available via the member functions on strings and other functionality in
the System.String type
and the System.Text.RegularExpressions namespace.
UInt32: ML-like operations on 32-bit System.UInt32 numbers.
UInt64: basic operations on 64-bit System.UInt64 numbers.
Wait for the result and commit it
Record the result in the AsyncResultCell.
Subsequent sets of the result are ignored. This can happen,
e.g. for a race between a cancellation and a success.
Create a new result cell
A helper type to store a single result from an asynchronous computation and asynchronously
access its result.
When using .NET 4.0 you can often use Task<'T> instead of this type
Return an asynchronous computation that, when run, either returns a value, raises an exception
of cancels according to the value of the asynchronous result.
Represents the reified result of an asynchronous computation
Extensions to the F# Microsoft.FSharp.Control.Async module
The type of floating-point matrices. See Microsoft.FSharp.Math
The type of floating-point row vectors. See Microsoft.FSharp.Math
The type of floating-point vectors. See Microsoft.FSharp.Math
Constructs a complex number from both the real and imaginary part.
Builds a matrix from a sequence of sequence of floats.
Builds a (row) vector from a sequence of floats.
Builds a (column) vector from a sequence of floats.
Return the given rational number
Return the negation of a rational number
Return the difference of two rational numbers
Return the product of two rational numbers
This operator is for use from other .NET languages
This operator is for use from other .NET languages
This operator is for use from other .NET languages
This operator is for use from other .NET languages
This operator is for use from other .NET languages
This operator is for use from other .NET languages
Return the ratio of two rational numbers
Return the sum of two rational numbers
Get zero as a rational number
Return the sign of a rational number; 0, +1 or -1
Get one as a rational number
Return the numerator of the normalized rational number
Return a boolean indicating if this rational number is strictly positive
Return a boolean indicating if this rational number is strictly negative
Return the denominator of the normalized rational number
Return the result of converting the given rational number to an integer
Return the result of converting the given rational number to a floating point number
Return the result of converting the given rational number to a big integer
Return the result of raising the given rational number to the given power
Return the result of converting the string to a rational number
Return the result of converting the given integer to a rational number
Return the result of converting the given big integer to a rational number
Return the absolute value of a rational number
The type of arbitrary-sized rational numbers
Unary negation of a complex number
Subtract one complex number from another
Multiply two complex numbers
Multiply a scalar by a complex number
Multiply a complex number by a scalar
Complex division of two complex numbers
Add two complex numbers
The real part of a complex number
The imaginary part of a complex number
The complex number 0+0i
The real part of a complex number
The polar-coordinate phase of a complex number
The complex number 0+1i
The complex number 1+0i
The polar-coordinate magnitude of a complex number
The imaginary part of a complex number
The conjugate of a complex number, i.e. x-yi
Create a complex number using magnitude/phase polar coordinates
Create a complex number x+ij using rectangular coordinates
Computes the absolute value of a complex number: e.g. Abs x+iy = sqrt(x**2.0 + y**2.0.)
Note: Complex.Abs(z) is the same as z.Magnitude
The type of complex numbers stored as pairs of 64-bit floating point numbers in rectangular coordinates
Get the item at the given position in the matrix
Prefix '+' operator. A nop.
Matrix negation.
Point-wise subtraction of two matrices. An InvalidArgument exception will be
raised if the dimensions do not match.
Matrix multiplication. An InvalidArgument exception will be
raised if the dimensions do not match.
Matrix-vector multiplication.
Multiply each element of a matrix by the given scalar value
Multiply each element of a matrix by the given scalar value
Pointwise matrix multiplication. An InvalidArgument exception will be
raised if the dimensions do not match.
Point-wise addition of two matrices. An InvalidArgument exception will be
raised if the dimensions do not match.
Get the transpose of the matrix.
Get the number of rows in the matrix
Get the number of columns in the matrix
Returns sqrt(sum(norm(x)*(norm(x))) of all the elements of a matrix.
The element type of the matrix must have an associated instance of INormFloat<'T> (see GlobalAssociations) ((else NotSupportedException)).
Return the non-zero entries of a sparse or dense matrix
Get the item at the given position in the matrix
Indicates if the matrix uses the sparse representation.
Indicates if the matrix uses the dense representation.
Get the internal array of values for a sparse matrix. This property
should only be used when interoperating with other matrix libraries.
Get the internal array of row offsets for a sparse matrix. This property
should only be used when interoperating with other matrix libraries.
Get the internal array of column values for a sparse matrix. This property
should only be used when interoperating with other matrix libraries.
Get the internal array of values for a dense matrix. This property
should only be used when interoperating with other matrix libraries.
Retrieve the dictionary of numeric operations associated with the element
type of this matrix. Accessing the property may raise an NotSupportedException if the element
type doesn't support any numeric operations. The object returned
may support additional numeric operations such as IFractional:
this can be determined by a dynamic type test against the object
returned.
Get the number of (rows,columns) in the matrix
Get the main diagonal of a matrix, as a vector
Convert the matrix to a column vector
Convert the matrix to a row vector
Return a new array containing the elements of the given matrix
Supports the slicing syntax 'A.[idx1..idx2,idx1..idx2] <- B'
Select a range of rows from a matrix
Select a row from a matrix
Select a region from a matrix
Permutes the rows of the matrix.
Permutes the columns of the matrix.
Supports the slicing syntax 'A.[idx1..idx2,idx1..idx2]'
Return the nth diagonal of a matrix, as a vector. Diagonal 0 is the primary
diagonal, positive diagonals are further to the upper-right of the matrix.
Create a new matrix that is a copy of the given array
Select a range of columns from a matrix
Select a column from a matrix
The type of matrices. The arithmetic operations on the element type are determined by inspection on the element type itself.
Two representations are supported: sparse and dense.
Get the transpose of the row vector.
Get the underlying internal array of values for the vector. This property
should only be used when interoperating with other matrix libraries.
Return a new array containing a copy of the elements of the given vector
Supports the slicing syntax 'rv.[idx1..idx2] <- rv2'
Permute the elements of the row vector.
Supports the slicing syntax 'rv.[idx1..idx2]'
Create a new matrix that is a copy of the given array
The type of row vectors.
Gets an item from the the vector
Return the input vector
Negate a vector
Subtract two vectors, pointwise
Multiply each element of a vector by the given scalar value.
Multiply a column vector and a row vector to produce a matrix
Multiply a vector by a scalar
Pointwise multiplication of two vectors.
Add two vectors, pointwise
Get the transpose of the vector.
Gets the number of rows in the vector
Computes the 2-norm of a vector: sqrt(x.Transpose*x).
Gets the number of entries in the vector
Gets an item from the the vector
Get the underlying internal array of values for the vector. This property
should only be used when interoperating with other matrix libraries.
Gets the element operations for the element type of the vector, if any
Return a new array containing a copy of the elements of the given vector
Supports the slicing syntax 'v.[idx1..idx2] <- v2'
Permute the elements of the vector.
Supports the slicing syntax 'v.[idx1..idx2]'
Create a new matrix that is a copy of the given array
The type of column vectors. The arithmetic operations on the element type are determined by inspection
on the element type itself
The type of complex numbers
The type of floating point matrices
The type of floating point row vectors
The type of floating point column vectors
Add two complex numbers
A complex of magnitude 1 and the given phase and , i.e. cis x = mkPolar 1.0 x
The conjugate of a complex number, i.e. x-yi
Cosine
Complex division of two complex numbers
exp(x) = e^x
The imaginary part of a complex number
log(x) is natural log (base e)
The polar-coordinate magnitude of a complex number
Create a complex number using magnitude/phase polar coordinates
Multiply two complex numbers
Multiply a complex number by a scalar
Unary negation of a complex number
The complex number 1+0i
The complex number 0+1i
The polar-coordinate phase of a complex number
pi
The real part of a complex number
Sine
Multiply a scalar by a complex number
sqrt(x) and 0 <= phase(x) < pi
Subtract one complex number from another
Tagent
The complex number 0+0i
Attempt to determine a numeric association for the given type, i.e. a registered dictionary of
numeric operations. The interface can be queried dynamically for additional functionality in the numerics
hierarchy.
Record an AppDomain-wide association between the given type and the given dictionary of
numeric operations. Raise an error if an existing association already exists.
Associations are a way of associating dictionaries of
operations with given types at runtime. Associations are global to a
.NET application domain. Once specified an association may not be deleted
or modified.
In this release the system of associations is simply
limited to a registry of types that support dictionaries (i.e. interface objects)
of numeric operations. The following types are pre-registered with associated numeric
operations: float, int32, int64, bigint, float32, Complex, bignum. Other types must be
registered explicitly by user code.
Add two matrices (operator +)
Create a new matrix that is a copy of the given array
Point-wise maximum element of two matrices
Point-wise minimum element of two matrices
Pointwise exponential of a matrix.
Create a matrix with all entries the given constant
Dot product
Check if a predicate holds for at least one element of a matrix
Check if a predicate holds for at least one element of a matrix
Fold the given function over all elements of a matrix
Fold the given function down each column of a matrix
Fold the given function along each row of a matrix
Fold the given function along a particular column of a matrix
Fold the given function down a particular row of a matrix
Fold the given function over all elements of a matrix
Check if a predicate holds for all elements of a matrix
Check if a predicate holds for all elements of a matrix
Get an element of a matrix
Create a square matrix with the constant 1.0 lying on diagonal
Create a dense representation matrix with the given entries.
Create a square matrix with the given vector lying on diagonal
Create a sparse representation matrix with the given entries. Not all
operations are available for sparse matrices, and mutation is not permitted.
If an operation on sparse matrices raises a runtime exception then consider
converting to a dense matrix using to_dense.
In-place addition mutates first matrix argument.
In-place subtraction mutates first matrix argument.
Map the given function over each element of the matrix, producing a new matrix
Map the given indexed function over each element of the matrix, producing a new matrix
sqrt(sum(x*x)) of all the elements of a matrix
Multiply all the elements of the matrix
Generate a new matrix of the same size as the input with random entries
drawn from the range 0..aij. Random numbers are generated using a globally
shared System.Random instance with the initial seed 99.
Set an element of a matrix
Sum all the elements of a matrix
Ensure that a matrix uses dense representation. See init_sparse
Sum of the diagonal elements of the matrix
Transpose of a matrix. Use also m.Transpose
Create a matrix with all entries zero
Create a new matrix that is a copy of the given array
Take the pointwise maximum of two matrices
Take the pointwise maximum of two matrices
Create a matrix containing the given value at every element.
Sum of the point-wise multiple of the two matrices.
The element type of the matrix must have an associated instance of INumeric<'T> (see GlobalAssociations) ((else NotSupportedException)).
Get an element from a matrix. The indexes are given in row/column order.
Create a square matrix with the one for the element type lying on diagonal
The element type of the matrix must have an associated instance of INumeric<'T> (see GlobalAssociations) ((else NotSupportedException)).
Create a matrix using the given function to compute the item at each index.
Create a matrix containing the given vector along the diagonal.
The element type of the matrix must have an associated instance of INumeric<'T> (see GlobalAssociations) ((else NotSupportedException)).
Create a matrix using the given function to compute the item at each index.
The element type of the matrix must have an associated instance of INumeric<'T> (see GlobalAssociations) ((else NotSupportedException)).
The function is passed the dictionary of associated operations in addition to the index pair.
Returns sqrt(sum(norm(x)*(norm(x))) of all the elements of a matrix.
The element type of the matrix must have an associated instance of INormFloat<'T> (see GlobalAssociations) ((else NotSupportedException)).
Create a matrix from the given (usually constant) data
Create a matrix from the given (usually constant) data
Create a 1x1 matrix containing the given value
Set an element in a matrix. The indexes are given in row/column order.
Return a new array containing the elements of the given matrix
Return a new matrix which is the transpose of the input matrix
Create a matrix containing the zero element at each index.
The element type of the matrix must have an associated instance of INumeric<'T> (see GlobalAssociations) ((else NotSupportedException)).
Operations to manipulate matrix types carrying
arbitrary element types. The names and types of the operations match those
in the containing module Math.Matrix.
The numeric operations on the element type (add, zero etc.) are inferred from the type
argument itself. That is, for some operations
the element type of the matrix must have an associated instance of INumeric<'T>
or some more specific numeric association (see GlobalAssociations) ((else NotSupportedException)).
Operations to manipulate floating
point matrices. The submodule Matrix.Generic contains a
matching set of operations to manipulate matrix types carrying
arbitrary element types.
Faraday constant
Newtonian constant of gravitation
Conductance quantum 2e^2/h
Avogadro constant
Magnetic flux quantum h/2e
Molar gas constant
Rydberg constant
Fine-structure constant
speed of light in vacuum
Elementary charge
Electron volt
electric constant = 1/(mu0 c^2)
Planck constant
Dirac constant, also known as the reduced Planck constant = h/2pi
Boltzmann constant R/N_A
Electron mass
Proton mass
magnetic constant
Stefan-Boltzmann constant
Unified atomic mass unit
Fundamental physical constants, with units-of-measure
Create by constant initialization
Get an element of a column vector
Create by comprehension
Get the dimensions (number of rows) of a column rowvec.
Create a vector from an array of double precision floats
Create a vector from a list of numbers
Set an element of a column rowvec
Return a new array containing a copy of the elements of the given vector
Return a vector of the given length where every entry is zero.
Create by constant initialization
Get an element from a column vector.
Create by comprehension
Get the number of rows in a column vector.
Create a row vector from an array of elements
Create a row vector from a list of elements
Create a row vector from a sequence of elements
Set an element in a column vector.
Return a new array containing a copy of the elements of the given vector
Transpose the row vector
Return a vector of the given length where every entry is zero.
Operations to manipulate row vectors types carrying
arbitrary element types.
Operations to manipulate floating
point row vectors. These are included for completeness and are
nearly always transposed to column vectors.
ampere, SI unit of electric current
becquerel, SI unit of activity referred to a radionuclide
coulomb, SI unit of electric charge, amount of electricity
farad, SI unit of capacitance
gray, SI unit of absorbed dose
henry, SI unit of inductance
hertz, SI unit of frequency
joule, SI unit of energy, work, amount of heat
kelvin, SI unit of thermodynamic temperature
newton, SI unit of force
pascal, SI unit of pressure, stress
siemens, SI unit of electric conductance
sievert, SI unit of does equivalent
tesla, SI unit of magnetic flux density
volt, SI unit of electric potential difference, electromotive force
watt, SI unit of power, radiant flux
weber, SI unit of magnetic flux
candela, SI unit of luminous intensity
katal, SI unit of catalytic activity
kilogram, SI unit of mass
lumen, SI unit of luminous flux
lux, SI unit of illuminance
metre (or meter), SI unit of length
mole, SI unit of amount of substance
ohm, SI unit of electric resistance
second, SI unit of time
The International System of Units (SI)
Pointwise exponential of a vector.
Generate a vector of the given length where each entry contains the given value
Dot product
Get an element of a column vector
Get the dimensions (number of rows) of a column vector. Identical to nrows
Computes the 2-norm of a vector: sqrt(x.Transpose*x).
Create a vector from an array of double precision floats
Create a vector from a list of numbers
Create a 1-element vector
Multiply all the elements of the matrix
Create a vector that represents a integral mesh over the given range
e.g. range 1 5 = vector [ 1.;2.;3.;4.;5. ]
Create a vector that represents a mesh over the given range
e.g. rangef (-1.0) 0.5 1.0 = vector [ -1.0; -0.5; 0.0; 0.5; 1.0]
Set an element of a column vector
Sum all the elements of a vector
Return a new array containing a copy of the elements of the given vector
Transpose of a matrix. Use also m.Transpose
Return a vector of the given length where every entry is zero.
Add two vectors (operator +)
Take the pointwise maximum of two vectors
Take the pointwise minimum of two vectors
Point-wise multiplication of two vectors (operator .*)
Generate a vector of the given length where each entry contains the given value
Dot product
Get an element of a column vector
Creation: general
Creation: useful when the element type has associated operations.
Get the dimensions (number of rows) of a column vector. Identical to nrows
Negation of the vector (each element is negated) (unary operator -)
Computes the 2-norm of a vector: sqrt(x.Transpose*x).
Create a vector from an array of elements
Create a vector from a list of numbers
Create a 1-element vector
Create a vector from a sequence of numbers
Multiply all the elements of the matrix
Pointwise multiplication of a matrix by a scalar
Set an element of a column vector
Subtract one vector from another (operator -)
Sum all the elements of a vector
Return a new array containing a copy of the elements of the given vector
Transpose of a matrix. Use also m.Transpose
Return a vector of the given length where every entry is zero.
Operations to manipulate column vectors carrying
arbitrary element types.
Operations to manipulate floating
point column vectors. The submodule VectorOps.Generic contains a
matching set of operations to manipulate column vectors carrying
arbitrary element types.
See NativeArray2
WARNING: use of this function may lead to unverifiable or invalid code
View a FortranMatrix as a CMatrix. Doesn't actually allocate
a new matirx - just gives a different label to the same bits, and swaps the
row/column count information associated with the bits.
WARNING: use of this function may lead to unverifiable or invalid code
This type wraps a pointer to a blob of unmanaged memory assumed to contain
a Fortran-style column major two-dimensional matrix of items compatible with the (presumably blittable)
type 'T. The blob of memory must be allocated and managed externally,
e.g. by a computation routine written in C.
All operations on this type are marked inlined
because the code used to implement the operations is not verifiable.
Any code that uses these operations will be unverifiable and may
cause memory corruption if not used with extreme care.
WARNING: use of this function may lead to unverifiable or invalid code
Pointer to the C-style row major two-dimensional array
Number of rows of the native array
Number of columns of the native array
View a CMatrix as a FortranMatrix. Doesn't actually allocate
a new matirx - just gives a different label to the same bits, and swaps the
row/column count information associated with the bits.
WARNING: use of this function may lead to unverifiable or invalid code
Creates a C-style row major two-dimensional array from a native pointer, the number of rows and the number of columns.
Nothing is actually copied.
This type wraps a pointer to a blob of unmanaged memory assumed to contain
a C-style row major two-dimensional matrix of items compatible with the (presumably blittable)
type 'T. The blob of memory must be allocated and managed externally,
e.g. by a computation routine written in C.
All operations on this type are marked inlined
because the code used to implement the operations is not verifiable.
Any code that uses these operations will be unverifiable and may
cause memory corruption if not used with extreme care.
WARNING: use of this function may lead to unverifiable or invalid code
Pointer to the C-style one-dimensional array
Length of the C-style one-dimensional array
WARNING: use of this function may lead to unverifiable or invalid code
Creates a C-style one dimensional array from a native pointer and the length of the array
Nothing is actually copied.
This type wraps a pointer to a blob of unmanaged memory assumed to contain
a C-style one-dimensional array of items compatible with the (presumably blittable)
type 'T. The blob of memory must be allocated and managed externally,
e.g. by a computation routine written in C.
All operations on this type are marked inlined
because the code used to implement the operations is not verifiable.
Any code that uses these operations will be unverifiable and may
cause memory corruption if not used with extreme care.
For native interop. Pin the given object
Represents a pinned handle to a structure with an underlying 2D array, i.e. an underlying NativeArray2.
Used when interfacing with native code math libraries such as LAPACK.
For native interop. Pin the given object
Represents a pinned handle to a structure with an underlying 1D array, i.e. an underlying NativeArray.
Used when interfacing with native code math libraries such as LAPACK.
Pin the given ref for the duration of a single call to the given function. A native pointer to
the contents of the ref is passed to the given function. Cleanup the GCHandle associated with the
pin when the function completes, even if an exception is raised.
This function should only be used if 'T is a simple blittable type
such as "int" that does not contain any further heap references.
WARNING: use of this function may lead to unverifiable or invalid code
Interpret tables for an ascii lexer generated by fslex.
Interpret tables for an ascii lexer generated by fslex, processing input asynchronously
The type of tables for an ascii lexer generated by fslex.
The start position for the lexeme
True if the refill of the buffer ever failed , or if explicitly set to true.
The end position for the lexeme
The start position for the lexeme
The length of the matched string
The matched string
True if the refill of the buffer ever failed , or if explicitly set to true.
The end position for the lexeme
Dynamically typed, non-lexically scoped parameter table
Fast helper to turn the matched characters into a string, avoiding an intermediate array
Fetch a particular character in the matched string
Adjust the start position associated with the lexbuf
Remove all input, though don't discard the current lexeme
Return absolute offset of the start of the line marked by the position
The line number in the input stream, assuming fresh positions have been updated
using AsNewLinePos() and by modifying the EndPos property of the LexBuffer.
The file name associated with the input stream.
Get an arbitrary position, with the empty string as filename, and
Return the column number marked by the position, i.e. the difference between the AbsoluteOffset and the StartOfLineAbsoluteOffset
The character number in the input stream
Gives a position shifted by specified number of characters
Get a position corresponding to the first line (line number 1) in a given file
Given a position at the start of a token of length n, return a position just beyond the end of the token
Position information stored for lexing tokens
Interpret tables for a unicode lexer generated by fslex.
Interpret tables for a unicode lexer generated by fslex, processing input asynchronously
The type of tables for an unicode lexer generated by fslex.
Parsers generated by FsPars provide information from within parser
actions. This is accessed via the functions available on the local
variable parseState within parser actions
Tables generated by fsyacc
A record of options to control structural formatting.
For F# Interactive properties matching those of this value can be accessed via the 'fsi'
value.
Floating Point format given in the same format accepted by System.Double.ToString,
e.g. f6 or g15.
If ShowProperties is set the printing process will evaluate properties of the values being
displayed. This may cause additional computation.
The ShowIEnumerable is set the printing process will force the evalution of IEnumerable objects
to a small, finite depth, as determined by the printing parameters.
This may lead to additional computation being performed during printing.
From F# Interactive the default settings can be adjusted using, for example,
open Microsoft.FSharp.Compiler.Interactive.Settings;;
setPrintWidth 120;;
The maximum number of rows for which to generate layout for table-like
structures. -1 if no maximum.
The maximum number of elements for which to generate layout for
list-like structures, or columns in table-like
structures. -1 if no maximum.
Return to the layout-generation
environment to layout any otherwise uninterpreted object
Data representing structured layouts of terms.
Convert any value to a string using a standard formatter
Data is typically formatted in a structured format, e.g.
lists are formatted using the "[1;2]" notation.
The details of the format are not specified and may change
from version to version and according to the flags given
to the F# compiler. The format is intended to be human-readable,
not machine readable. If alternative generic formats are required
you should develop your own formatter, using the code in the
implementation of this file as a starting point.
Data from other .NET languages is formatted using a virtual
call to Object.ToString() on the boxed version of the input.
Convert any value to a layout using the given formatting options. The
layout can then be processed using formatting display engines such as
those in the LayoutOps module. any_to_string and output_any are
built using any_to_layout with default format options.
Ouput any value to a channel using the same set of formatting rules
as any_to_string
Layout two vertically.
Layout list vertically.
Wrap braces around layout.
Wrap round brackets around Layout.
Join layouts into a comma separated list.
The empty layout
Is it the empty layout?
An string which is left parenthesis (no space on the right).
Layout like an F# list.
An uninterpreted leaf, to be interpreted into a string
by the layout engine. This allows leaf layouts for numbers, strings and
other atoms to be customized according to culture.
Join broken with ident=0
Join broken with ident=1
Join broken with ident=2
Join, unbreakable.
Join, possible break with indent=1
Join, possible break with indent=2
Join, possible break with indent=0
Layout like an F# option.
An string which is right parenthesis (no space on it's left).
Join layouts into a semi-colon separated list.
An string which requires no spaces either side.
Join layouts into a list separated using the given Layout.
Join layouts into a space separated list.
Wrap square brackets around layout.
See tagL
Form tuple of layouts.
For limitting layout of list-like sequences (lists,arrays,etc).
unfold a list of items using (project and z) making layout list via itemL.
If reach maxLength (before exhausting) then truncate.
An string leaf
A layout is a sequence of strings which have been joined together.
The strings are classified as words, separators and left and right parenthesis.
This classification determines where spaces are inserted.
A joint is either unbreakable, breakable or broken.
If a joint is broken the RHS layout occurs on the next line with optional indentation.
A layout can be squashed to for given width which forces breaks as required.