fslib10 Add a binding for the element to the table Clear all elements from the collection Test if the collection contains any bindings for the given element Make a shallow copy of the collection Create a new empty mutable hash table with key hash/equality based on the F# structural "hash" and (=) functions. This function is always inlined to give compilers the opportunity to optimize the structural hash/equality functions based on any available compile-time knowledge of the key type at the call site. Create a new empty mutable hash table with an internal bucket array of the given approximate size and with key hash/equality based on the F# structural "hash" and (=) functions This function is always inlined to give compilers the opportunity to optimize the structural hash/equality functions based on any available compile-time knowledge of the key type at the call site. 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 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 and the given HashStats collector Build a map that contains the bindings of the given IEnumerable Find all bindings for the given element in the table, if any Apply the given function to each element in the collection threading the accumulating parameter through the sequence of function applications Get the longest chain in the hash table as a list. Use for debugging Apply the given function to each binding in the hash table Remove the latest binding (if any) for the given element from the table Replace the latest binding (if any) for the given element. Lookup the given element in the table, returning the result as an Option Lookup or set the given element in the table. Raise Not_found/IndexOutOfRangeException if the element is not found. Lookup or set the given element in the table. Raise Not_found/IndexOutOfRangeException if the element is not found. Hash tables, by default based on F# structural "hash" and (=) functions. This is precisely the same type as that manipulated by the functions in [[Microsoft.FSharp.Compatibility.OCaml.Hashtbl]]. The table may map a single key to multiple bindings. Add an element to the collection Clear all elements from the set Test if the set contains the given element Make a shallow copy of the set Create a new empty mutable hash set with key hash/equality based on the F# structural "hash" and (=) functions This function is always inlined to give compilers the opportunity to optimize the structural hash/equality functions based on any available compile-time knowledge of the key type at the call site. 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 This function is always inlined to give compilers the opportunity to optimize the structural hash/equality functions based on any available compile-time knowledge of the key type at the call site. 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 empty mutable hash set with an internal bucket array of the given approximate size and with the given key hash/equality functions and the given HashStats collector Create a new mutable hash set containing elements drawn from the given sequence Apply the given function to the set threading the accumulating parameter through the sequence of function applications Use to debug poorly performing hash tables Apply the given function to each binding in the hash table Remove the given element from the set Mutable hash sets based by default on F# structural "hash" and (=) functions. Implemented via a hash table and/or Dictionary. Create a new HashStats sink. The longest ever chain length sampled in all tables traced by this sink. Chain levels are typically sampled only on resizes. The total number of resizes of all hash tables traced by this sink. The total number of tables traced by this sink. Sinks recording statistical properties of one or more hash tables. 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. Possibly-infinite lazy lists. See also IEnumerable, which recomputes elements when needed. The module 'List' contains additional values and functions related to this type. Test if any element of the collection satisfies the given predicate. See also List.exists. The module 'List' contains additional values and functions related to this type. Return a new collection containing only the elements of the collection for which the given predicate returns "true" See also List.filter. The module 'List' contains additional values and functions related to this type. Test if all elements of the collection satisfy the given predicate. See also List.for_all. The module 'List' contains additional values and functions related to this type. See List.iter Apply the given function to each element of the collection. The integer passed to the function indicates the index of element. See also List.iteri. The module 'List' contains additional values and functions related to this type. Build a new list whose elements are the results of applying the given function See also List.map. The module 'List' contains additional values and functions related to this type. 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 (from 0) of element being transformed. See also List.map. The module 'List' contains additional values and functions related to this type. Return a new list with the elements in reverse order See also List.rev. The module 'List' contains additional values and functions related to this type. The module 'List' contains additional values and functions related to this type, e.g. List.fold_left, List.append etc. The module 'List' contains additional values and functions related to this type. The module 'List' contains additional values and functions related to this type. The module 'List' contains additional values and functions related to this type. The module 'List' contains additional values and functions related to this type. The module 'List' contains additional values and functions related to this type. The type of immutable singly-linked lists. Use the constructors [] and '::' (infix) to create values of this type, or the notation [1;2;3]. Use the values in the [[List]] module to manipulate values of this type, or pattern match against the values directly. Return a new map with the binding added to the given map. Test is an element is in the domain of the map Build a map that contains the bindings of the given IEnumerable The empty map Return true if the given predicate returns true for one of the bindings in the map. Always returns false if the map is empty. Build a new map containing the bindings for which the given predicate returns 'true'. Search the map looking for the first element where the given function returns a [[Some]] value Fold over the bindings in the map. Fold over the bindings in the map. 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). Return true if the given predicate returns true for all of the bindings in the map. Always returns true if the map is empty. Apply the given function to each binding in the dictionary 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. Build a new collection whose elements are the results of applying the given function to each of the elements of the collection. Build two new maps, one containing the bindings for which the given predicate returns 'true', and the other the remaining bindings. Remove an element from the domain of the map. No exception is raised if the element is not present. The elements of the set as an array The elements of the set as a list. 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 number of bindings in the map Return true if there are no bindings in the map. Lookup an element in the map, raising [[Not_found]]/[[IndexOutOfRangeException]] if no binding exists in the map. Immutable maps. Keys are ordered by F# structural comparison, potentially using implementations of the IComparable interface on key values. 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. Create a permutation by specifying the result of permuting [| 0 .. n-1 |]. For example, Permutation([| 1;2;0 |]) specifies a permutation that rotates all elements left 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, first applies p1 then applies p2. Return the iddentity permutation Return a permutation that, when applied, maps index 0 to N-1, N-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. Compute the inverse of the permutation Apply the composition to an index within the range 0..Length-1 A type of read-only arrays 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. A useful shortcut for Set.mem. See the Set module for further operations on sets. Build a set that contains the same elements as the given IEnumerable Return a new set with the elements of the second set removed from the first. The empty set based on the default structural comparison operator Test if any element of the collection satisfies the given predicate. If the elements are "i0...iN" then computes "p i0 or ... or p iN". Return a new collection containing only the elements of the collection for which the given predicate returns "true" Apply the given accumulating function to all the elements of the set Test if all elements of the collection satisfy the given predicate. If the elements are "i0...iN" and "j0...jN" then computes "p i0 && ... && p iN". Build a set that contains the same elements as the given array Returns the least element in the set that is greater than the given key according to the ordering being used for the set Returns the greatest element in the set that is less than the given key according to the ordering being used for the set Compute the intersection of the two sets. Compute the intersection of N sets. At least one set must be given. Evaluates to "true" if all elements of the second set are in the first Evaluates to "true" if all elements of the first set are in the second Apply the given function to each binding in the collection Return a new collection containing the results of applying the given function to each element of the input set A useful shortcut for Set.remove. 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. A singleton set based on the default structural comparison operator The elements of the set as a list. Compute the union of the two sets. Compute the union of multiple sets. Return the number of elements in the set A useful shortcut for Set.is_empty. See the Set module for further operations on sets. Returns the highest element in the set according to the ordering being used for the set Returns the lowest element in the set according to the ordering being used for the set A useful shortcut for Set.size. See the Set module for further operations on sets. Compute the union of the two sets. Return a new set with the elements of the second set removed from the first. Immutable sets based on binary trees, where comparison is the F# structural comparison function, potentially using implementations of the IComparable interface on key values. See the Set module for further operations on sets. These sets can be used with elements of any type, but you should check that structural hashing and equality on the element type are correct for your type. Efficiency: Structural comparison is relatively efficient but is not a suitable choice in all circumstances, e.g. it may not compare efficiently on non-reference types and deeply-structured types. 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. 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. 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 Array2 module and types such as "int[,]". Test if any element of the array satisfies the given predicate. If the elements are "i0...iN" then computes "p i0 or ... or p iN". Fill a range of an array 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 Not_found if no such element exists. 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 elements are "i0...iN" then computes "f (... (f s i0)...) iN" Apply a function to each element of the array, threading an 'accumulator' argument through the computation. If the elements are "i0...iN" then computes "f i0 (...(f iN s))". Test if all elements of the array satisfy the given predicate. If the elements are "i0...iN" and "j0...jN" then computes "p i0 && ... && p iN". Fetch an element from an array. You can also use the syntax arr.(idx). Return an enumerator for performing imperative enumerations over the given array. Create an array given the dimension and a generator function to compute the elements. 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. Return the length of an array. You can also use property arr.Length. Create an array whose elements are all initially the given value 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 Array2 module and types such as "int[,]". 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 array from the given enumerable object Build an array from the given list Build an array from the given lazy list Build a new array from the given enumerable object 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. Return a new array with the elements in reverse order Set the value of an element in an array. You can also use the syntax 'arr.(idx) <- e'. Sort the elements of an array, using the given comparison function as the order Split a list of pairs into two lists Build a new array that contains the given subrange specified by starting index and length. Return a view of the array as an enumerable object Build a list from the given array Build a lazy 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. Create an array where the entries are initially the a "default" value. For .NET reference types this will be "null". For other types behaviour is undefined if you access an entry of the array before setting it. 1-dimensional (generic) arrays. Get the address of an element in the array 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 Array2.pin, except that the caller is responsible for calling Free on the returned GCHandle in order to release the pin. Basic operations on 2-dimensional arrays. F# and .NET multi-dimensional arrays are typically zero-based. However, .NET multi-dimensional arrays used in conjunction with external libraries (e.g. libraries associated with Visual Basic) be non-zero based, using a potentially different base for each dimension. The operations in this module will accept such arrays, and the basing on an input array will be propogated to a matching output array on the [[Array2.map]] and [[Array2.mapi]] operations. Non-zero-based arrays can also be created using [[Array2.zero_create_based]], [[Array2.create_based]] and [[Array2.init_based]]. This module is only available for F# on .NET 2.0. If using .NET 1.x then use Microsoft.FSharp.Compatiblity.CompatMatrix instead. Basic operations on 3-dimensional arrays. Only available for F# on .NET 2.0. Compare using the given comparer comparer function Structural comparison. Compare using LanguagePrimitives.StructuralComparer. Compare using any implementation of System.IComparable interfaces. This differs from structural comparison because arrays are not compared structurally, and many optimizations are not applied. Common notions of comparison identity used with sorted data structures. Physical hashing (hash on reference identity of objects, and the contents of value types). Hash using LanguagePrimitives.PhysicalEquality and LanguagePrimitives.PhysicalHash, i.e. for value types use GetHashCode and Object.Equals (if no other optimization available), and for reference types use System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode and reference equality. Hash using Object.GetHashCode and Object.Equals(Object) Physical hashing (hash on reference identity of objects, and the contents of value types). Hash using LanguagePrimitives.PhysicalEquality and LanguagePrimitives.PhysicalHash, i.e. for value types use GetHashCode and Object.Equals (if no other optimization available), and for reference types use System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode and reference equality. Structural hashing. Hash using LanguagePrimitives.StructuralEquality and LanguagePrimitives.StructuralComparer. i.e. for value types use GetHashCode and Object.Equals (if no other optimization available), and for reference types use the F# cooperative structural term hashing scheme. Object.GetHashCode(obj) is used if no other choice is available. Hash using Object.GetHashCode and Object.Equals(Object) Common notions of value identity used with hash tables. Return the stream which contains on demand the elements of the first stream followed by the elements of the second list 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 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 an enumerator for performing imperative enumerations over the given collection. 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 new collection from the given enumerable object 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. Return a view of the collection as an enumerable object 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. Return a new list that contains the elements of the first list followed by elements of the second Lookup key's data in association list, uses (=) equality. Raises [[Not_found]] 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 Apply the given function to each element of the list. Return the list comprised of the results "x" for each element where the function returns Some(x) A synonym for List.combine Return a new list that contains the elements of each the lists in order Test if any element of the collection satisfies the given predicate. If the elements are "i0...iN" then computes "p i0 or ... or p iN". Test if any corresponding elements of the collection satisfy the given predicate pairwise. If the elements are "i0...iN" and "j0...jN" then computes "p i0 j0 or ... or p iN jN". Raises [[Invalid_argument]] exception if the lists do not zip (have different lengths). 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 Not_found if no such element exists. Return a list containing allthe elements for which the given function returns "true". Same as "filter" Raise Not_found if no such element exists. Raise Not_found if no such element exists. Apply the given function to successive elements, returning the first result where function returns "Some(x)" for some x. Return a new list that contains the elements of each the lists in order. Same as concat. Apply a function to each element of the collection, threading an 'accumulator' argument through the computation. Apply the function to the first two elements of the list. Then feed this result into the function along with the third element and so on. Return the final result. If the elements are "i0...iN" then computes "f (... (f i0 i1) i2 ...) iN" Apply a function to each element of the collection, threading an 'accumulator' argument through the computation. Take the second argument, and apply the function to it and the first element of the list. Then feed this result into the function along with the second element and so on. Return the final result. If the elements are "i0...iN" then computes "f (... (f s i0) i1 ...) iN" Apply a function to corresponding elements of two collections, threading an 'accumulator' argument through the computation. The collections must have identical sizes. If the elements are "i0...iN" and "j0...jN" then computes "f (... (f s i0 j0)...) iN jN". Apply a function to each element of the collection, threading an 'accumulator' argument through the computation. If the elements are "i0...iN" then computes "f i0 (...(f iN s))". Apply a function to corresponding elements of two collections, threading an 'accumulator' argument through the computation. The collections must have identical sizes. If the elements are "i0...iN" and "j0...jN" then computes "f i0 j0 (...(f iN jN s))". Test if all elements of the collection satisfy the given predicate. If the elements are "i0...iN" then computes "p i0 && ... && p iN". Test if all corresponding elements of the collection satisfy the given predicate pairwise. If the elements are "i0...iN" and "j0...jN" then computes "p i0 j0 && ... && p iN jN". Raises [[Invalid_argument]] if the lists do not zip (have different lengths). Return an enumerator for performing imperative enumerations over the given collection. Return the first element of the list. Raise (Invalid_argument "hd") if undefined. Create a list by calling the given generator on each index Apply the given function to each element of the collection. Apply the given function to two collections simultaneously. The collections must have identical size. Apply the given function to each element of the collection. The integer passed to the function indicates the index of element. Apply the given function to two collections simultaneously. The collections must have identical size. The integer passed to the function indicates the index of element. Return the length of the list 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. Build a new collection whose elements are the results of applying the given function to the corresponding elements of the three collections simultaneously. 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 (from 0) of element being transformed. Like mapi, but mapping corresponding elements from two lists of equal length. Is an element in the list, uses (=) 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. Index into the list. The first element has index 0. Build a new collection from the given enumerable object Build a collection from the given array Build a collection from the given lazy list Build a new collection from the given enumerable object Split the collection into two collections, containing the elements for which the given predicate returns "true" and "false" respectively Remove pair for key from the association list (if it's there). See [[remove_assoc]], but uses the physical equality operator (==) for equality tests. Return a new list with the elements in reverse order "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)" Apply a function to each element of the collection, threading an 'accumulator' argument through the computation. Take the second argument, and apply the function to it and the first element of the list. Then feed this result into the function along with the second element and so on. Return the list of intermediate results and the final result. Sort the given list using the given comparison function A synonym for List.unzip Sort the given list using the given comparison function, preserving order for equal elements. Return the tail of the list. Raise (Invalid_argument "tl") if undefined. Return a view of the collection as an enumerable object Build an array from the given collection Build a lazy list from the given collection Return a view of the collection as an enumerable object 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. Return the first element for which the given function returns "true". Return None if no such element exists. Return None if no such element exists. Return None if no such element exists. Split a list of pairs into two lists Split a list of triples into three lists Combine the two lists into a list of pairs. The two lists must have equal lengths. Combine the three lists into a list of triples. The lists must have equal lengths. Basic 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 module, e.g. Map.t. Used mainly in OCaml-compatible code. 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()) Return a new map with the binding added to the given map. The empty map Return true if the given predicate returns true for one of the bindings in the map. Build a new map containing only the bindings for which the given predicate returns 'true' Lookup an element in the map, raising [[Not_found]]/[[IndexOutOfRangeException]] if no binding exists in the map. Search the map looking for the first element where the given function returns a [[Some]] value Fold over the bindings in the map Return true if the given predicate returns true for all of the bindings in the map. Is the map empty? Apply the given function to each binding in the dictionary 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. Test is an element is in the domain of the map Return a new map made from the given bindings Return a new map made from the given bindings Return a new map made from the given bindings Return a new map made from the given bindings Build two new maps, one containing the bindings for which the given predicate returns 'true', and the other the remaining bindings. Remove an element from the domain of the map. No exception is raised if the element is not present. View the collection as an enumerable sequence. This collection type is also directly compatible with 'seq<KeyValuePair<_,_> >'. Note this function returns a sequence of tuples, whereas the collection itself is compatible with the logically equivalent sequence of KeyValuePairs. Using sequences of tuples tends to be more convenient in F#, however the collection itself must enumerate KeyValuePairs to conform to the .NET design guidelines and the IDictionary interface. Lookup an element in the map, returning a [[Some]] value if the element is in the domain of the map and [[None]] if not. Immutable maps using structural comparison Maps based on structural comparison are efficient. They are not a suitable choice if keys are recursive data structures or require non-structural comparison semantics. "append a1 a2" is equivalent to "[|a1.(0);...;a1.(n-1);a2.(0);...;a2.(m-1)|]" where "n" is the length of "a1" and "m" is the length of "a2". "concat" is similar to [append] but conjoins a list of read-only array. Only one new roarray is allocated. Apply a function to each element of the collection, threading an 'accumulator' argument through the computation. If 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 elements are "i0...iN" then computes "f i0 (...(f iN s))". Get an element from a read-only array Return an enumerator for performing imperative enumerations over the given collection. Create a read-only array by index "init n f" creates the roarray "[| f 0; ...; f (n-1) |]". 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. Get the length of a read-only array 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 new collection from the given enumerable object Build a collection from the given list Build a collection from the given lazy list Build a new collection from the given enumerable object "sub a n m" is equivalent to "[| a.(n); ...; a.(n+m) |]". Return a view of the collection as an enumerable object Build a list from the given collection Build a lazy list from the given collection Return a view of the collection as an enumerable object Wrap the two given enumeration-of-enumerations as a single concatenated enumeration. The returned IEnumerable may be passed between threads safely. However, individual IEnumerator values generated from the returned IEnumerable should not be accessed from multiple threads simultaneously. Apply the given function to each element of the list. Return the list comprised of the results "x" for each element where the function returns Some(x) The returned IEnumerable may be passed between threads safely. However, individual IEnumerator values generated from the returned IEnumerable should not be accessed from multiple threads simultaneously. Remember IEnumerable is lazy, effects are delayed until it is enumerated. A synonym for Seq.zip Compare two IEnumerable's using the given comparison function. Both input IEnumerables are assumed to be in a canonical order (i.e. sorted) Wrap the given enumeration-of-enumerations as a single concatenated enumeration. The returned IEnumerable may be passed between threads safely. However, individual IEnumerator values generated from the returned IEnumerable should not be accessed from multiple threads simultaneously. Return an IEnumerable that when iterated yields the given item followed by the items in the given sequence Return an IEnumerable that is built from the given delayed specification of an IEnumerable. The input function is evaluated each time an IEnumerator for the IEnumerable is requested. Call the given function every time an enumerator for the returned sequence is disposed. Create an empty IEnumerable Test if any element of the collection satisfies the given predicate. If the elements are "i0...iN" then computes "p i0 or ... or p iN". Return a new collection containing only the elements of the collection for which the given predicate returns "true" The returned IEnumerable may be passed between threads safely. However, individual IEnumerator values generated from the returned IEnumerable should not be accessed from multiple threads simultaneously. Remember IEnumerable is lazy, effects are delayed until it is enumerated. Return the first element for which the given function returns "true". Raise Not_found if no such element exists. Raise Not_found if no such element exists. Raise Not_found if no such element exists. 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 elements are "i0...iN" then computes "f (... (f s i0)...) iN" Apply a function to each element of the sequence, threading an 'accumulator' argument through the computation. Begin by applying the function to the first two elements. Then feed this result into the function along with the third element and so on. Return the final result. Test if all elements of the collection satisfy the given predicate. If the elements are "i0...iN" then computes "p i0 && ... && p iN". Imperative generation of an IEnumerable from a cursor handle (e.g. from a file handle or database connection). A cursor is created by calling the 'open' function, which will typically open a file, a database connection or some other resource. One cursor is created each time an IEnumerator is generated for the IEnumerable, hence you can use this funciton to create IEnumerables for a logical structure (e.g. a file) that has multiple active independent readers (e.g. open file handles). Individual elements are read from the file using the element generator. The element generator is executed on demand as an enumeration proceeds over the IEnumerator, until a None value is returned by the element generator. The 'close' function is called when the None condition is reached or when the IEnumerator object is explicitly disposed. The close function is called at most once per active enumeration (i.e. once per IEnumerator object created for this IEnumerable). The close function is not called during finalization, since the enumerator is not itself the immediate owner of any resources. Note a fresh call to 'opener' will be used and the stream will be recomputed each time an IEnumerator is requested for the IEnumerable. The returned IEnumerable may be passed between threads safely. However, individual IEnumerator values generated from it should not be accessed from multiple threads simultaneously. The 'close' function may also be called from the finalization thread. Similar to generate, except the 'close' function is implicit from the IDisposable interface implemented by the state value Equivalent to "generate opener generator (fun s -> s.Dispose())" Generate a sequence by repeatedly calling the given function and concatenating the results (similar to a while loop) Return the first element of the IEnumerable. Raise (Invalid_argument "hd") if undefined. Generate a new IEnumerable which, when iterated, will return successive elements by calling the given function, up to the given count. The results of calling the function will not be saved, i.e. the function will be reapplied as necessary to regenerate the elements. The function is passed the index of the item being generated. The returned IEnumerable may be passed between threads safely. However, individual IEnumerator values generated from the returned IEnumerable should not be accessed from multiple threads simultaneously. Generate a new IEnumerable which, when iterated, will return successive elements by calling the given function. The results of calling the function will not be saved, i.e. the function will be reapplied as necessary to regenerate the elements. The function is passed the index of the item being generated The returned IEnumerable may be passed between threads safely. However, individual IEnumerator values generated from the returned IEnumerable should not be accessed from multiple threads simultaneously. Apply the given function to each element of the collection. Apply the given function to two collections simultaneously. The collections must have identical size. Apply the given function to each element of the collection. The integer passed to the function indicates the index of element. Return the length of the IEnumerable Build a new collection whose elements are the results of applying the given function to each of the elements of the collection. The function will be applied as elements are demanded using the 'Current' property on iterators retrieved from the object. Generating multiple iterators or calling the 'Current' property multiple times may result in the function being called multiple times. The returned IEnumerable may be passed between threads safely. However, individual IEnumerator values generated from the returned IEnumerable should not be accessed from multiple threads simultaneously. Remember IEnumerable is lazy, effects are delayed until it is enumerated. Build a new collection whose elements are the results of applying the given function to the corresponding elements of the two collections pairwise. Remember IEnumerable is lazy, effects are delayed until it is enumerated. For each element of the enumeration apply the given function and concatenate all the results. Remember IEnumerable is lazy, effects are delayed until it is enumerated. Transform a loosely-typed System.Collections IEnumerable to a new collection whose elements are the results of applying the given function to each of the elements of the collection. The use of this function usually requires a type annotation. An incorrect type annotation may result in runtime type errors. The returned IEnumerable may be passed between threads safely. However, individual IEnumerator values generated from the returned IEnumerable should not be accessed from multiple threads simultaneously. Remember IEnumerable is lazy, effects are delayed until it is enumerated. 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 (from 0) of element being transformed. Remember IEnumerable is lazy, effects are delayed until it is enumerated. Return true if the IEnumerable is not empty. Compute the nth element in the collection. Build a collection from the given array Generate an IEnumerable based on a function that generates an arbitrarily typed enumerator, two functions that are effectively the same as IEnumerator.MoveNext and IEnumerator.Current Build a collection from the given array Return a sequence of each element in the input sequence and its predecessor, with the exception of the first element which is only returned as the predecessor of the second element. Like fold, but compute on-demand and return the sequence of intermediary and final results Like fold1, but compute on-demand and return the sequence of intermediary and final results Return an IEnumerable that yields one item only. Return an IEnumerable that when iterated yields the items in the given sequence followed by the given item Return the first N elements of the IEnumerable. Raise (Invalid_argument "take") if undefined. Build an array from the given collection Build a list from the given collection Return an IEnumerable that when enumerated returns at most N elements. Return the first element for which the given function returns "true". Return None if no such element exists. Return None if no such element exists. Return None if no such element exists. Return an IEnumerable that contains the elements generated by the given computation. The given initial 'state' argument is passed to the element generator. For each IEnumerator elements in the stream are generated on-demand by applying the element generator, until a None value is returned by the element generator. Each call to the element generator returns a new residual 'state'. Note the stream will be recomputed each time an IEnumerator is requested and iterated for the IEnumerable. The returned IEnumerable may be passed between threads safely. However, individual IEnumerator values generated from the returned IEnumerable should not be accessed from multiple threads simultaneously. Return a new collection containing only the elements of the collection for which the given predicate returns "true" The use of this function usually requires a type annotation. An incorrect type annotation may result in runtime type errors. Remember IEnumerable is lazy, effects are delayed until it is enumerated. Apply a function to each element of the collection, threading an 'accumulator' argument through the computation. If the elements are "i0...iN" then computes "f (... (f s i0)...) iN" The use of this function usually requires a type annotation. An incorrect type annotation may result in runtime type errors. Apply the given function to each element of the collection. The use of this function usually requires a type annotation. An incorrect type annotation may result in runtime type errors. Build a new collection whose elements are the results of applying the given function to each of the elements of the collection. The use of this function usually requires a type annotation. An incorrect type annotation may result in runtime type errors. Transform a loosely-typed System.Collections IEnumerable to a strongly typed F# list. The use of this function usually requires a type annotation. An incorrect type annotation may result in runtime type errors. Wrap a loosely-typed System.Collections IEnumerable as a typed System.Collections.Generic.IEnumerable. The use of this function usually requires a type annotation. An incorrect type annotation may result in runtime type errors. Individual IEnumerator values generated from the returned IEnumerable should not be accessed from multiple threads simultaneously. Use the given function to create a resource, then passs the resource to the second function. An instance of the resource will be created each time an IEnumerator for the sequence is created, and disposed when the IEnumerator is disposed. Combine the two sequences into a list of pairs. The two sequences need not have equal lengths: when one sequence is exhausted any remaining elements in the other sequence are ignored. Sets with a user-defined comparison function. 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()) Return a new set with an element added to the set. No exception is raised if the set already contains the given element. Return the number of elements in the set. Same as "size" Choose an arbitrary element from a set Compare two sets. Places sets into a total order. Return a new set with the elements of the second set removed from the first. The elements of the set as a list. The empty set. Test if two sets are equal Test if any element of the collection satisfies the given predicate. If the elements are "i0...iN" then computes "p i0 or ... or p iN". Return a new collection containing only the elements of the collection for which the given predicate returns "true" Apply the given accumulating function to all the elements of the set Test if all elements of the collection satisfy the given predicate. If the elements are "i0...iN" and "j0...jN" then computes "p i0 && ... && p iN". Return an enumerator for performing imperative enumerations over the given collection. Compute the intersection of the two sets. Return "true" if the set is empty Apply the given function to each element of the set, in order according to the comparison function Return a new collection containing the results of applying the given function to each element of the input set Returns the highest element in the set according to the ordering being used for the set Evaluates to "true" if the given element is in the given set Returns the lowest element in the set according to the ordering being used for the set Build a new collection from the given enumerable object Build a set that contains the same elements as the given array Build a set that contains the same elements as the given list Build a set that contains the same elements as the given stream. The stream must be finite. Build a new collection from the given enumerable object Split the set into two sets containing the elements for which the given predicate returns true and false respectively Return a new set with the given element removed. No exception is raised in the set doesn't contain the given element. The set containing the given one element. Return the number of elements in the set Evaluates to "true" if all elements of the first set are in the second Return a view of the collection as an enumerable object Build an array that contains the elements of the set in order Build a list that contains the elements of the set in order Build a lazy list that contains the elements of the set in order Return a view of the collection as an enumerable object Compute the union of the two sets. Add a binding for the element to the table Clear all elements from the collection Test if the collection contains any bindings for the given element Make a shallow copy of the collection 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 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 Find all bindings for the given element in the table, if any Apply the given function to each element in the collection threading the accumulating parameter through the sequence of function applications Get the longest chain in the hash table as a list. Use for debugging Apply the given function to each binding in the hash table Remove the latest binding (if any) for the given element from the table Replace the latest binding (if any) for the given element. Lookup the given element in the table, returning the result as an Option Lookup or set the given element in the table. Raise Not_found/IndexOutOfRangeException if the element is not found. Lookup or set the given element in the table. Raise Not_found/IndexOutOfRangeException if the element is not found. 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. Mutable hash sets based on F# structural "hash" and (=) functions. Implemented via a hash table and/or Dictionary. Add an element to the collection Clear all elements from the set Test if the set contains the given element Make a shallow copy of the set 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 empty mutable hash set with an internal bucket array of the given approximate size and with the given key hash/equality functions and the given HashStats collector Apply the given function to the set threading the accumulating parameter through the sequence of function applications Use to debug poorly performing hash tables Apply the given function to each binding in the hash table Remove the given element from the set 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. Return a new map with the binding added to the given map. Test is an element is in the domain of the map Build a map that contains the bindings of the given IEnumerable and where comparison of elements is based on the given comparison function The empty map, and use the given comparer comparison function for all operations associated with any maps built from this map. Return true if the given predicate returns true for one of the bindings in the map. Always returns false if the map is empty. Build a new map containing the bindings for which the given predicate returns 'true'. Search the map looking for the first element where the given function returns a [[Some]] value Fold over the bindings in the map. Fold over the bindings in the map. 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). Return true if the given predicate returns true for all of the bindings in the map. Always returns true if the map is empty. Apply the given function to each binding in the dictionary 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. Build a new collection whose elements are the results of applying the given function to each of the elements of the collection. Build two new maps, one containing the bindings for which the given predicate returns 'true', and the other the remaining bindings. Remove an element from the domain of the map. No exception is raised if the element is not present. The elements of the set as an array The elements of the set as a list. 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 number of bindings in the map Return true if there are no bindings in the map. Lookup an element in the map, raising [[Not_found]]/[[IndexOutOfRangeException]] if no binding exists in the map. Immutable maps. A constraint tag carries information about the key-comparer being used. If 'comparerTag is Tags.StructuralComparer then this type is the same as Set (the tag can be ignored). Immutable sets based on binary trees, where comparison is the F# structural comparison function. See the Set module for further operations on sets. These sets can be used with elements of any type, but you should check that structural hashing and equality on the element type are correct for your type. Efficiency: Structural comparison is relatively efficient but is not a suitable choice in all circumstances, e.g. it may not compare efficiently on non-reference types and deeply-structured types. 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. A useful shortcut for Set.mem. See the Set module for further operations on sets. The empty set based on the given comparer Return a new set with the elements of the second set removed from the first. Test if any element of the collection satisfies the given predicate. If the elements are "i0...iN" then computes "p i0 or ... or p iN". Return a new collection containing only the elements of the collection for which the given predicate returns "true" Apply the given accumulating function to all the elements of the set Test if all elements of the collection satisfy the given predicate. If the elements are "i0...iN" and "j0...jN" then computes "p i0 && ... && p iN". Compute the intersection of the two sets. Evaluates to "true" if all elements of the second set are in the first Evaluates to "true" if all elements of the first set are in the second Apply the given function to each binding in the collection A useful shortcut for Set.remove. 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. A singleton set based on the given comparison operator The elements of the set as a list. Compute the union of the two sets. Return the number of elements in the set A useful shortcut for Set.is_empty. See the Set module for further operations on sets. Returns the highest element in the set according to the ordering being used for the set Returns the lowest element in the set according to the ordering being used for the set A useful shortcut for Set.size. See the Set module for further operations on sets. Compute the union of the two sets. Return a new set with the elements of the second set removed from the first. Immutable sets where a constraint tag carries information about the key-comparer being used. If 'comparerTag is Tags.StructuralComparer then this type is the same as Set (the tag can be ignored). This tag indicates the collection uses physical hashing (hash on reference identity of objects, and the contents of value types). i.e. for value types use GetHashCode and Object.Equals (if no other optimization available), and for reference types use System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode and reference equality. This tag indicates the collection uses structural comparison on keys, except where the structural comparison semantics has been altered for particular types through re-implementations of the IComparer interface. This tag indicates the collection uses structural hashing on keys, except where the structural hashing semantics has been altered through re-implementations of the IStructuralHash interface 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. 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 a new array of the given length, each entry of which holds the given element Fill a range of an array with the given element Apply a function to each element of the collection, threading an 'accumulator' argument through the computation. If the elements are "i0...iN" then computes "f (... (f s i0)...) iN" Compute f (get arr n) (...(f (get arr n) s)) Fetch the given element of the array, indexed by 0 Build a new array whose elements are f 0, ... f N Execute the given function for each element of the given array Execute the given function for each element of the given array. The integer index indicates the index of the element. The length of the array Build a new array of the given length, each entry of which holds the given element. Same as create. 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 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 funciton indicates the index of the element. Build a .NET compatible array from the F# array. Note that F# arrays and .NET compatible arrays are only different types when using .NET 1.0 or 1.1 Convert the given list to a .NET compatible array suitable for passing to .NET functions Set the given element of the array Build a new .NET compatible array that contains the given subrange specified by starting index and length Build an F# array from the given .NET compatible array. Note that F# arrays and .NET compatible arrays are only different types when using .NET 1.0 or 1.1 Convert the given .NET compatible array to a list Create a new array filled with zero (null or default) values. Warning: Use of this function may result in subsequent exceptions if the elements of the array are accessed before initialized. Operations to manipulate .NET-compatible arrays, only really necessary use when using .NET 1.x. Pseudo-polymorphic 2-dimensional arrays. Only really used when working with .NET 1.x. For any particular 'a , the "'a[,]" type is type-compatible with the corresponding C# 2-dimensional array type. The module contains operations to manipulate these values. The operations may be used on any version of the .NET CLR. See the 'Advanced' section of the manual for when 'Compatibility' array operations are needed to write code that will function on any version of the CLR. See the sample fsharp/Automation/Excel for an example of passing one of these values to fill in the cells of an Excel spreadsheet. Create a matrix containing the given vector along the nth diagonal. The 0th index is the main diagonal, and higher indexes are further to the upper-right of the matrix. The element type of the matrix must have an associated instance of INumeric<'a> (see [[GlobalAssociations]]) (else InvalidArgumentException). The lower triangular part of a matrix including the main diagonal The lower triangular part of a matrix. Positive offsets indicate further into upper upper-right triangular region. The 0th index inculdes the main diagonal. The upper triangular part of a matrix including the main diagonal The upper triangular part of a matrix. Positive offsets indicate further into upper upper-right triangular region. The 0th index inculdes the main diagonal. Functions to make F# math-related code look a bit like MATLAB (TM) code. Fresh .NET-compatible events declared in F# are typically values of type IHandlerEvent<'a>. These hold event handlers of type Handler<'a>. .NET events are revealed to F# code as instances of the type IDelegateEvent, which is a subtype of the type [IEvent]. The delegate type parameter and arguments are determined by the F# type checker based on information stored for the .NET event. F# code may also declare .NET events over any .NET delegate type. For example, DelegateEvent<PaintEventHandler,PaintEventArgs> can be used for an event whose callbacks are of type PaintEventHandler. The delegate and argument types must match. Connect a listener function to the event. The listener will be invoked when the event is fired. First-class listening points (i.e. objects that permit you to register a 'callback' activated when the event is triggered). See the module IEvent for functions to create events, and the type IDelegateEvent which extends this type. Any instance property that has type ICompatEvent will be published as a standard .NET event using standard .NET delegates and metadata, and will be recognized as an event by any language that supports the CLI Common Language Specification. The event will accept handlers of type Handler*lt;'a>. Connect a handler delegate object to the event. A handler can be later removed using RemoveHandler. The listener will be invoked when the event is fired. Remove a listener delegate from an event listener store F# gives special status to non-virtual instance member properties compatible with type IPrimitiveDelegateEvent, generating approriate .NET metadata to make the member appear to other .NET languages as a .NET event. The module 'Lazy' contains additional values and functions related to this type. Force the execution of this value and return its result. Same as Value. Force the execution of this value and return its result, using mutual exclusion to prevent other threads also computing the value. The module 'Lazy' contains additional values and functions related to this type. The module 'Lazy' contains additional values and functions related to this type. The module 'Lazy' contains additional values and functions related to this type. Force the execution of this value and return its result. Same as Value. The type of delayed computations. Use the values in the [[Lazy]] module to manipulate values of this type, and the notation 'lazy expr' to create values of this type. Return a new event which fires on a selection of messages from the original event. The selection function takes an original message to an optional new message. Create an IEvent with no initial listeners. Two items are returned: a function to invoke (trigger) the event, and the event that clients can plug listeners into. Create an IEvent with no initial listeners and at most one active listener. Adding extra listeners causes subsequent listeners to be dropped. Two items are returned: a function to invoke (trigger) the event, and the event that clients can plug listeners into. Create an event that is to be published as a standard .NET event using .NET delegates and metadata, and which will be recognized as an event by any language that supports the CLI Common Language Specification. Two items are returned: a function to invoke (trigger) the event, and the event itself. The event value should be published as a public instance property in order for it to be published as a standard .NET event. When firing the event the "sender" of the event must be specified, e.g. the form or control firing the event. This parameter is not normally of use for F# events, but is used by some other .NET event consumers. The sender is passed to the handler implementation as type 'object' Return a new event that listens to the original event and triggers the resulting event only when the argument to the event passes the given function Return a new event consisting of the results of applying the given accumulating function to successive values triggered on the input event. An item of internal state records the current value of the state parameter. The internal state is not locked during the execution of the accumulation function, so care should be taken that the input IEvent not triggered by multiple threads simultaneously. Return a new event consisting of the observed results of applying the given accumulating function to successive values triggered on the input event. The observed results are the second items in the pairs returned. An item of internal state records the current value of the state parameter. The internal state is not locked during the execution of the accumulation function, so care should be taken that the input IEvent not triggered by multiple threads simultaneously. Run the given function each time the given event is triggered. Create an event that is to be published as standard .NET event using .NET delegates and metadata, and which will be recognized as an event by any language that supports the CLI Common Language Specification. Two items are returned: a function to invoke (trigger) the event, and the event itself. The event value should be published as a public instance property in order for it to be published as a standard .NET event. This function creates event of any .NET EventHandler type (inherited from System.Delegate) and will be exported as event of that type. Function used to invoke the event accepts arguments as a list of objects and the event is invoked dynamically. When possible use 'create_HandlerEvent'. Return a new event that passes values transformed by the given function Fire the output event when either of the input events fire Return a new event that triggers on the second and subsequent triggerings of the input event. The Nth triggering of the input event passes the arguments from the N-1th and Nth triggering as a pair. The argument passed to the N-1th triggering is held in hidden internal state until the Nth triggering occurs. You should ensure that the contents of the values being sent down the event are not mutable. Note that many EventArgs types are mutable, e.g. MouseEventArgs, and each firing of an event using this argument type may reuse the same physical argument obejct with different values. In this case you should extract the necessary information from the argument before using this combinator. Return a new event that listens to the original event and triggers the first resulting event if the application of the predicate to the event arguments returned true, and the second event if it returned false Return a new event that listens to the original event and triggers the first resulting event if the application of the function to the event arguments returned a Choice2_1, and the second event if it returns a Choice2_2 Basic operations on IEvents. Force the computation of the given lazy value if not already forced. Raises an exception if the computation raises (or previously raised) an exception. Raises Undefined if executingg the computation recursively forces the evaluation of the computation. Concurrency: This function does not take a lock while forcing execution Like force, but this function uses the thunks itselfs as a lock while forcing execution If you have multiple threads and your lazy values can be accessed via multiple threads then you should consider using force_with_lock. If you do not the lazy computations may be executed multiple times, and the values produced by some of the computations will be discarded. Equivalent to force 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 Delayed computations. This exception is raised when a lazy or other recursively referential value is used during the execution of its initialization code The status of a lazy computation. A future relases of F# may hid this type and thus it should not be used directly. Adding this attribute to a type causes it to be represented using a .NET class. This may only be used under very limited conditions. This attribute is used to tag generated types and methods in the compiled .NET code with flags indicating the correspondence with original source constructs. It is used by the functions in the Microsoft.FSharp.Reflection library to reverse-map compiled constructs to their original forms. It is not intended for use from use code. This attribute is used to tag types that the 'null' representation may be used for the type. This affects how some constructs are compiled. You may need to add this attribute to some of your types if F# indicates that null may be used as a valid representation for some values your type and you have made the type abstract in a signature. Adding this attribute to a discriminated union with value false turns off the generation of standard helper member tester, constructor and accessor members for the generated .NET class for that type. This attribute is used to tag values that are part of an experimental library feature This attribute is added to generated assemblies to indicate the version of the data schema used to encode additional F# specific information in the resource attached to compiled F# libraries. The .NET type used to represent F# function values. This type is not typically used directly from F# code, though may be used from other .NET languages. F# structural types such as tuples, records and discriminated unions support a form of cooperative structural hashing, via implementations of interface IStructuralHash. Implmentations of this interface are added to concrete types (records, discriminated unions and classes) automatically, though types can also define their own implementations of this interface, thus altering the hashing semantics of the type. The byref argument points to a count of the number of significant nodes remaining to be hashed in the cooperative hash. Substructures and leaf nodes (such as integers) should be hashed by calling Microsoft.FSharp.Core.LanguagePrimitives.StructuralHashParam, but only if the hash count is non-zero. If the hash count is zero StructuralHashParam must not be called. Structural comparison is supported via a similar scheme, using implementations of the System.IComparable interface. Adding this attribute to a type causes it to be represented using a .NET interface. This may only be used under very limited conditions. This attribute is used to tag values, modules and types that are only present in F# to permit a degree of code-compatibility and cross-compilation with other implementations of ML-familty languages, in particular OCaml. The use of the construct will give a warning unless the --ml-compatibility flag is specified. Create an option value that is a 'Some' value. Return 'true' if the option is a 'None' value. Return 'true' if the option is a 'Some' value. Get the value of a 'Some' option. A NullReferenceException is raised if the option is 'None'. The type of optional values. When used from other .NET languages the empty option is the 'null' value. Use the constructors [[Some]] and [[None]] to create values of this type. Use the values in the [[Option]] module to manipulate values of this type, or pattern match against the values directly. 'None' values will appear as the value 'null' to other .NET languages. Instance methods on this type will appear as static methods to other .NET languages due to the use of 'null' as a value representation. This attribute is added automatically for all optional arguments Adding the OverloadID attribute to a member permits it to be part of a group overloaded by the same name and arity. The string must be a unique name amongst those in the overload set. Overrides of this method, if permitted, must be given the same OverloadID, and the OverloadID must be specified in both signature and implementation files if signature files are used. The current value of the reference cell The current value of the reference cell The type of mutable references. Use the functions [:=] and [!] to get and set values of this type. Adding this attribute to the let-binding for the definition of a top-level value makes the quotation expression that implements the value available for use at runtime. The result of an F# typeof operation Adding this attribute to a type causes it to be represented using a .NET struct. This may only be used under very limited conditions. Compiled versions of F# tuple types. These are not used directly from F# code, though these compiled forms are seen by other .NET languages. Compiled versions of F# tuple types. These are not used directly from F# code, though these compiled forms are seen by other .NET languages. Compiled versions of F# tuple types. These are not used directly from F# code, though these compiled forms are seen by other .NET languages. Compiled versions of F# tuple types. These are not used directly from F# code, though these compiled forms are seen by other .NET languages. Compiled versions of F# tuple types. These are not used directly from F# code, though these compiled forms are seen by other .NET languages. Compiled versions of F# tuple types. These are not used directly from F# code, though these compiled forms are seen by other .NET languages. The .NET type used to represent F# first-class type function values. This type is not typically used directly from F# code. The type 'unit', which has only one value "()". This attribute is used to tag values whose use will result in the generation of unverifiable code. These values are inevitably marked 'inline' to ensure that the unverifiable constructs are not present in the actual code for the F# library, but are rather copied to the source code of the caller. Four dimensional arrays, typically zero-based. Non-zero-based arrays can be created using methods on the System.Array type. Three dimensional arrays, typically zero-based. Non-zero-based arrays can be created using methods on the System.Array type. Two dimensional arrays, typically zero-based. Use the values in the [[Array2]] module to manipulate values of this type, or the notation 'arr.[x,y]' to get/set array values. When using .NET 1.x use the values in the [[CompatArray2]] module. Non-zero-based arrays can be created using methods on the System.Array type. Single dimensional, zero-based arrays, written 'int[]', 'string[]' etc. Use the values in the [[Array]] module to manipulate values of this type, or the notation 'arr.[x]' to get/set array values. When using .NET 1.x use the values in the [[CompatArray]] module. The type for by-reference, stack-allocated argument passing. It is used by .NET assemblies and by the type [[IStructuralHash]] to pass the hash-node-count around. Use of this type in F# code may result in unverifiable code being generated. This type is for internal use by the F# code generator The type of floating-point matrices. See Microsoft.FSharp.Math The type of machine pointers assumed to be pointing to unmanaged or pinned memory containing values or an array of values of the given type. This type should only be used when writing F# code that interoperates with C code. Use of this type in F# code may result in unverifiable code being generated. Conversions to and from the [[nativeint]] type may be required. Values of this type can be generated by the functions in the NativeInterop.NativePtr module. The type of floating-point row vectors. See Microsoft.FSharp.Math The type of floating-point vectors. See Microsoft.FSharp.Math 'assert' is used to check conditions and raise AssertionFailure if necessary This exception is precisely the same as the exception 'Failure' in F# code. This exception is precisely the same as the exception 'Invalid_argument' in F# code. Non-exhaustive match failures will raise Match failures Byte (8-bit) operations. 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 ML-like operations on 64-bit System.Double floating point numbers. ML-like operations on 32-bit System.Single floating point numbers. Basic operations on 32-bit integers. The type int32 is identical to [[System.Int64]]. Basic operations on 64-bit integers. The type int64 is identical to [[System.Int64]]. Simple operations on signed bytes Primitive used by pattern match compilation This function implements calls to default constructors acccessed by 'new' constraints. 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. The physical hash. Hashes on the object identity, except for value types, where we hash on the contents. Compare two values structurally Compare two values for structural equality Compare two values structurally. Compare two values structurally. See the IStructuralHash interface. Hash a value according to its structure. See the IStructuralHash interface. Implementations of IStructuralHash for aggregate structured data structures should call this function to hash sub-structures. The byref argument points to a count of the number of significant nodes remaining to be hashed in the cooperative hash. Substructures and leaf nodes (such as integers) should be hashed by calling Microsoft.FSharp.Core.LanguagePrimitives.StructuralHashParam, but only if the hash count is non-zero. If the hash count is zero StructuralHashParam must not be called. Compare two values for structural in-equality Compare two values structurally. Compare two values structurally. Take the maximum of two values structurally according to the order given by StructuralComparison Take the minimum of two values structurally according to the order given by StructuralComparison Binary 'and'. When used as a binary operator the right hand value is evaluated only on demand Binary 'and'. When used as a binary operator the right hand value is evaluated only on demand Binary 'or'. When used as a binary operator the right hand value is evaluated only on demand Address-of. Uses of this value may result in the generation of unverifiable code. Address-of. Uses of this value may result in the generation of unverifiable code. Overloaded unary negation. Binary 'or'. When used as a binary operator the right hand value is evaluated only on demand A primitive entry point used by the F# compiler for optimization purposes. A primitive entry point used by the F# compiler for optimization purposes. A primitive entry point used by the F# compiler for optimization purposes. A primitive entry point used by the F# compiler for optimization purposes. A primitive entry point used by the F# compiler for optimization purposes. A primitive entry point used by the F# compiler for optimization purposes. A primitive entry point used by the F# compiler for optimization purposes. A primitive entry point used by the F# compiler for optimization purposes. A primitive entry point used by the F# compiler for optimization purposes. The standard overloaded 1D-slice operator, generally used on strings, arrays and vectors. The source collection type must support a GetSlice member. The resulting collection type must support an Item property index. The standard overloaded 2D-slice operator Absolute value of the given integer Generic comparison Used to specify a default value for an optional argument in the implementation of a function Throw a 'FailureException' 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). The exact behaviour of the function can be adjusted on a type-by-type basis by implementing the IStructuralHash interface for each type. The "hashq" function is designed to return equal hash values for reference types that are equal according to the physical equality '==' (see also Obj.eq). For .NET value types the implementation of Object.GetHashCode is used on a boxed version of the input. For efficiency reasons this should not typically be used on .NET value types. Throw an 'InvalidArgumentException' exception Throw an 'InvalidOperationException' exception Execute the function as a mutual-exlcusion region using the input value as a lock. Use as: lock (x) (fun () -> ...) Maximum based on generic comparison Minimum based on generic comparison Assign to a mutable reference cell Compose two functions, the function on the right being applied first Compose two functions, the function on the left being applied first Dereference a mutable reference cell Associate other operator values with their corresponding The left-oriented scalar multiplication operator, when the scalar is on the left side. Structural equality Structural greater-than Structural greater-than-or-equal The standard overloaded associative (indexed) mutation operator The standard overloaded associative (2-indexed) mutation operator The standard overloaded associative (3-indexed) mutation operator The standard overloaded associative (indexed) lookup operator The standard overloaded associative (2-indexed) lookup operator The standard overloaded associative (3-indexed) lookup operator Structural inequality Structural less-than comparison Structural less-than-or-equal comparison Overloaded power operator. Apply a function to a value, the value being on the right, the function on the left Apply a function to a value, the value being on the left, the function on the right The standard overloaded range operator, e.g. '[n..m]' for lists, '{n..m}' for sequences The standard overloaded skip range operator, e.g. '[n..m]' for lists, '{n..m}' for sequences Create a mutable reference cell Generate a 'typ' value containing a System.Type runtime represenation of an F# type. The static type is still maintained on the value returned. The syntax '(type ...)' can now be used as a replacement for the use of this operator when a System.Type object is required. Note parentheses are required when using '(type ...)'. Clean up resources associated with the input object after the completion of the given function. Cleanup occurs even when an exception is raised by the protected code. Use as: using (myResource) (fun () -> ... ) Generate a range of byte values Generate a range of char values Generate a range of float values Generate a range of float32 values Generate a range of values using the given zero, add, start, step and stop values Generate a range of integers Generate a range of int16 values Generate a range of int64 values Generate a range of nativeint values Generate a range of sbyte values Generate a range of uint16 values Generate a range of uint32 values Generate a range of uint64 values Generate a range of unativeint values The .NET type used to represent F# function values that accept two iterated (curried) arguments without intervening execution. This type should not typically used directly from either F# code or from other .NET languages. The .NET type used to represent F# function values that accept three iterated (curried) arguments without intervening execution. This type should not typically used directly from either F# code or from other .NET languages. The .NET type used to represent F# function values that accept four iterated (curried) arguments without intervening execution. This type should not typically used directly from either F# code or from other .NET languages. The .NET type used to represent F# function values that accept five iterated (curried) arguments without intervening execution. This type should not typically used directly from either F# code or from other .NET languages. An implementation module used to hold some private implementations of function value invocation. "bind f inp" evaluates to "match inp with None -> None | Some x -> f x" "exists p inp" evaluates to "match inp with None -> false | Some x -> p x" "filter p inp" evaluates to "match inp with None -> None | Some x -> if p x then inp else None" "fold_left f s inp " evaluates to "match inp with None -> s | Some x -> f s x" "fold_right f inp s" evaluates to "match inp with None -> s | Some x -> f x s" "forall p inp" evaluates to "match inp with None -> true | Some x -> p x" Gets the value associated with the option. If the option is None then raises Invalid_argument "Option.get" Returns true if the option is None Returns true if the option is not None "iter f inp" executes "match inp with None -> () | Some x -> f x" "length inp" evaluates to "match inp with None -> 0 | Some _ -> 1" "map f inp" evaluates to "match inp with None -> None | Some x -> Some (f x)" "partition p inp" evaluates to "match inp with None -> None,None | Some x -> if p x then inp,None else None,inp" Convert the option to an array of length 0 or 1 Convert the option to a list of length 0 or 1 Basic operations on options. 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;;
 
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. 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. Decrement a mutable reference cell containing an integer Print to stderr using the given format Print to stderr using the given format, and add a newline Exit the current hardware isolated process, if security settings permit, otherwise raise an exception. Calls System.Environment.Exit. Print to a string buffer and raise an exception with the given result. Helper printers must return strings. Print to a file using the given format Print to a file using the given format, and add a newline Increment a mutable reference cell containing an integer Concatenate two lists. Concatenate two strings. The overlaoded operator '+' may also be used. Ouput any value to a channel using the same set of formatting rules as any_to_string Print any value to stderr using any_to_string. Print any value to stdin using any_to_string. Print to stdout using the given format Print to stdout using the given format, and add a newline Print to a string using the given format Pervasives: Additional bindings available at the top level Simple operations on signed bytes Return a string with the first character converted to uppercase. Compare the given strings using ordinal comparison Return a new string made by concatenating the given strings with separator 'sep', i.e. 'a1 + sep + ... + sep + aN' 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. Test if any character of the string satisfies the given predicate. Test if all characters in the string satisfy the given predicate. Return the first index of the given character in the string. Raise IndexOutOfRangeException (Not_found) 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 IndexOutOfRangeException (Not_found) if the string does not contain the given character. Apply the given function to each character in the string Return the length of the string. Return a new string with all characters converted to lowercase Return a string of the given length containing repetitions of the given character Build a new string whose characters are the results of applying the given function to each of the characters of the input string. Build a new string whose characters are the results of applying the given function to each of the characters of the input string and concatenating the resulting strings. Return s string of length 1 contianing 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. Return a substring of length 'length' starting index 'start'. Raise IndexOutOfRangeException (Not_found) if the start index is out of range or start+length is greatere than the length of the string Return a string with the first character converted to lowercase. Return a string with all characters converted to uppercase. Compatibility module for ML string processing. Richer string operations are available via the member functions on strings and other functionality in System.String and System.Text.RegularExpressions types. UInt32: ML-like operations on 32-bit System.UInt32 numbers. UInt64: basic operations on 64-bit System.UInt64 numbers. Simple operations on unsigned bytes Build a new store of listeneres for an event Fire the event associated with this EventListeners store Return the IEvent object that mediates access to this store. Fresh events declared in F# are typically values of type Idioms.ICompatEvent<'a>. These hold event handlers of type Idioms.Handler<'a>. See Microsoft.FSharp.IDelegateEvent See Microsoft.FSharp.Control.IEvent Combine enum values using 'logical or'. The relevant enumeration type is inferred from context. Convert an enumeration value to an integer. The argument type is inferred from context. Convert an integer to an enumeration value. The result type is inferred from context. Use when calling a method from another .NET language that expects a variable number of arguments. Test if an enumeration value has a particular flag set, using 'logical and'. The relevant enumeration type is inferred from context. Convert a value to the univeral representation type 'obj', where the argument type is inferred from context. This idiom corresponds to the C# "foreach" construct. Use as: 'foreach (collection) (fun (x:expectedType) -> ...)'. Try using 'Idioms.foreachG' before using this function, as that detects if the collection supports a typesafe IEnumerable<T>. If any element of the heterogeneous collection does not have the given type then a runtime error will be raised. Not all F# collection types directly implement the required interfaces, hence you may need to call a projection function such as 'CollectionType.to_IEnumerable'. The idiom corresponding to the C# "lock(x) { ... }" construct. Use as: lock (x) (fun () -> ...) Return a sizeof value containing an integer representing the runtime allocated size of handles to values of a given F# type. Most F# types will have a handle size of 1 native machine word. Generate a 'typ' value containing a System.Type runtime represenation of an F# type. The static type is still maintained on the value returned. The syntax '(type ...)' can now be used as a replacement for the use of this operator when a System.Type object is required. This operator may be marked 'deprecated' in a suture release of F#. Note parentheses are currently required when using '(type ...)'. Convert a value from the univeral representation type 'obj' to another type, where the result type is inferred from context. The idiom corresponding to the C# "using" construct, which uses the IDisposable interface to dispose of a native resource even when an exception is raised by the protected code. Use as: using (myResource) (fun () -> ... ) The type of arbitrary-sized integers The type of arbitrary-sized rational numbers Create a complex number x+ij using rectangular coordinates Create a complex number using magnitude/phase polar coordinates The conjugate of a complex number, i.e. x-yi The imaginary part of a complex number The polar-coordinate magnitude of a complex number The complex number 1+0i The complex number 0+1i The polar-coordinate phase of a complex number The real part of a complex number The complex number 0+0i The imaginary part of a complex number The real part of a complex number Add two complex numbers Complex division of two complex numbers Multiply a scalar by a complex number Multiply two complex numbers Multiply a complex number by a scalar Subtract one complex number from another Unary negation of a complex number The type of complex numbers stored as pairs of 64-bit floating point numbers in rectangular coordinates The type of matrices. The arithmetic operations on the element type are determined by inspection on the element type itself The number of (rows,columns) in the matrix 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 item at the given position in the matrix The number of columns in the matrix The number of rows in the matrix Get the transpose of the matrix Point-wise addition of two matrices. An InvalidArgument exception will be raised if the dimensions do not match. Inplace matrix addition. An InvalidArgument exception will be raised if the dimensions do not match. 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. Inplace pointwise matrix multiplication. 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 Point-wise subtraction of two matrices. An InvalidArgument exception will be raised if the dimensions do not match. Inplace matrix subtraction. An InvalidArgument exception will be raised if the dimensions do not match. Matrix negation. A nop. Get the item at the given position in the matrix The type of matrices. The arithmetic operations on the element type are determined by inspection on the element type itself The type of row vectors. This type is included mostly only for completeness and is used relatively rarely. Multiply each element of a vector by the given scalar value. An InvalidArgument exception will be raised if the dimensions do not match. Pointwise multiplication of two vectors. 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 An abstract representation of the numeric operations supported by this type. 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 square matrix with the constant lying on diagonal 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 Point-wise multiplication of two matrices (operator .*) Pointwise exponential of a matrix. Create a matrix with all entries the given constant Create a square matrix with the given vector lying on diagonal Get the dimensions of a matrix (rows x columns) 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 Select a column from a matrix as a vector. Select a number of columns from a matrix. Return the primary diagonal of a matrix, as a vector. 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. Select a region from a matrix. Select a row from a matrix as a row vector. Select a number of rows from a matrix. Create a square matrix with the constant 1.0 lying on diagonal In-place addition mutates first matrix argument. In-place assign mutates matrix argument. In-place componentwise-multiplication mutates first matrix argument. In-place map mutates matrix argument. In-place scaling mutates 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 Multiply two matrices (operator * ) Multiply row vector by matrix (operator *% ) Multiply matrix by vector (operator *% ) Get the number of columns of a matrix Negation of the matrix (each element is negated) (unary operator -) Create a matrix with the given entries. sum(x*x) of all the elements of a matrix Get the number of rows 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. Pointwise multiplication of a matrix by a scalar Set an element of a matrix Subtract one matrix from another (operator -) 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 Operations to manipulate floating point matrices. The submodule [[Matrix.Generic]] contains a matching set of operations to manipulate matrix types carrying arbitrary element types. 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 Convert a matrix to a scalar. Convert a matrix to a column vector. Create a matrix from a scalar. Create a matrix from a column vector. Create a complex number x+ij using rectangular coordinates Create a matrix from lists of floats. Create a row vector from lists of floats. Create a column vector from lists of floats. This module contains notation related to matrices and vectors Abstract internal type fp is type for the finite field. Currently using p = 2^27.15+1 but do not rely on that. Also, do not rely on fp being represented as uint32. "2^max_bits_inside_fp - 1" fits inside fp Maximum value in Fp is p-1. FFT multiplication used by BigNat. Implements polynomial multiplication provided the coefficients of the result (and hence of the arguments too) fit inside Fp. 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 Operations to manipulate floating point row vectors. These are included for completeness and are nearly always transposed to column vectors. Add two vectors (operator +) Point-wise multiplication of two vectors (operator .*) 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]] Negation of the vector (each element is negated) (unary operator -) sum(x*x) of all or some of the matrix Get the number of rows of a column vector. 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] 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 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 'a. 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 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 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 'a. 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 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 C-style one-dimensional array of items compatible with the (presumably blittable) type 'a. 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 WARNING: use of this function may lead to unverifiable or invalid code WARNING: use of this function may lead to unverifiable or invalid code WARNING: use of this function may lead to unverifiable or invalid code WARNING: use of this function may lead to unverifiable or invalid code WARNING: use of this function may lead to unverifiable or invalid code WARNING: use of this function may lead to unverifiable or invalid code WARNING: use of this function may lead to unverifiable or invalid code WARNING: use of this function may lead to unverifiable or invalid code Definitions internal for this library. A handle that represents the compiled form of the F# module. Fetch the list of concrete values in the F# Module, i.e. those that have a canonical corresponding construct in the compiled IL version of the F# code. Inlined values and private values optimized away during compilation are not returned. Fetch the list of public nexted module definitions in the F# Module. Fetch the list of public type definitions in the F# Module. Private types and type abbreviations are not returned. A handle that represents the compiled form of the F# type definition. This can be used to access all the features of the type definition, e.g. the type parameters, properties and other members. Return the GetTypeInfoOfType decomposition of a generic instance of the type. Represents the one-level decomposition of an F# type according to the various structural types supported by the F# language. Note: Most attributes associated with a System.Type value can be accessed via regular .NET reflection. However, it is useful to be able to view some F# type definitions from the perspective of the F# language, in particular for record, tuple and discriminated-union definitions. Although these types are ultimately compiled as .NET types, the details of the encoding used is often irrelevant, and this type and other items in this API help hide the details of this encoding. A handle that represents the compiled form of the F# value Represents the one-level decomposition of an F# value according to the various structural types supported by the F# language. A convenience function A convenience function A convenience function Get an enumeration of handles to the F#-defined concrete module definitions in an assembly. Nested module definitions are not returned. Get handles to the F#-defined concrete type definitions in an assembly. Type definitions nested inside modules are not returned, nor are type definitions hidden inside modules, and nor are type abbreviations. Get the TypeInfo for a System.Type Throw away extraneous compiler-specific information from a runtime type to return a true F# type. A convenience function A convenience function A convenience function The maximum size for which the structure of tuple types are faithfully reported by reflection Precompute a function for constructing a record value. Assumes the given type is a RecordType. If not an unspecified exception is raised during pre-computation. Precompute a function for reading a particular field from a record. Assumes the given type is a RecordType with a field of the given name. If not an unspecified exception is raised during pre-computation. Using the computed function will be much faster than executing a corresponding call to Value.GetInfo because the path executed by the computed function is optimized given the knowledge that it will be used to read values of the given type. Precompute a function for reading all the fields from a record. The fields are returned in the same order as the fields reported by a call to Microsoft.FSharp.Reflection.Type.GetInfo for this type. Assumes the given type is a RecordType. If not an unspecified exception is raised during pre-computation. Using the computed function will be much faster than executing a corresponding call to Value.GetInfo because the path executed by the computed function is optimized given the knowledge that it will be used to read values of the given type. Precompute a function for constructing a discriminated union value for a particular tag. Assumes the given type is a SumType where the tag is a legitimate tag for the type. If not an unspecified exception is raised during pre-computation. Precompute a function for reading all the fields for a particular discriminator tag of a sum type Assumes the given type is a SumType where the tag is a legitimate tag for the type. If not an unspecified exception is raised during pre-computation. Tags can be mapped to and from names using the functions returned by GetSumTagConverters Using the computed function will be much faster than executing a corresponding call to Value.GetInfo because the path executed by the computed function is optimized given the knowledge that it will be used to read values of the given type. Precompute a pair of functions for converting between integer discriminator tags the names of the discriminators for the given sum type. Assumes the given type is a SumType. If not an unspecified exception is raised during pre-computation. Precompute a function for reading an integer representing the discriminator tag of a sum type. Assumes the given type is a SumType. If not an unspecified exception is raised during pre-computation. Using the computed function will be much faster than executing a corresponding call to Value.GetInfo because the path executed by the computed function is optimized given the knowledge that it will be used to read values of the given type. Precompute a function for reading the values of a particular tuple type Assumes the given type is a TupleType. If not an unspecified exception is raised during pre-computation. Precompute a function for reading the values of a particular tuple type Assumes the given type is a TupleType. If not an unspecified exception is raised during pre-computation. The type of formats accepted by printers that produce strings but print intermediate results to buffers The type of formats accepted by printers that write to buffers The type of formats accepted by print-then-call printers that write to buffers The type of formats accepted by print-then-call printers that produce strings The type of formats accepted by print-then-call printers that write to an instance of the .NET type System.IO.TextWriter The type of formats accepted by printers that produce strings The type of formats accepted by printers that write to an instance of the .NET type System.IO.TextWriter Print to a string buffer and raise an exception with the given result. Helper printers must print to string buffers. Print to a text writer or an OCaml-compatible channel, but intermediary printers write via a buffer, which is often the most convenient way to write intermediary printers. Useful if your primitive printing functions are defined to write to buffers, but you ultimately want to go to a file. Print to a string buffer, which is a StringBuilder Print to a string buffer, which is a StringBuilder. Return the result as a string. Helper printers must print to string buffers. Print to any subtype of TextWriter, but intermediary printers write via a buffer, which is often the most convenient way to write intermediary printers. Useful if your primitive printing functions are defined to write to buffers, but you ultimately want to go to a file. Formatted printing to stderr Formatted printing to stderr, adding a newline Print to a string buffer and raise an exception with the given result. Helper printers must return strings. Print to a text writer or an OCaml-compatible channel Print to a text writer or an OCaml-compatible channel, adding a newline A building block for processing format strings. This processes the format character at the given position (which normally follows a '%' in a format string) and produces an 'obj' which can be dynamically cast to a type that depends on the format specifier. The function 'cont' is called to produce the object that will be returned after this part of the format is processed. The function 'outa' is called to process the 'c values returned by 'a' and 't' specifiers. The function 'outc' is called to emit characters. The intentional type representation 'ty' should be the representation of the expected return type for the formatting. bprintf, but call the given 'final' function to generate the result. See [[kprintf]]. bsprintf, but call the given 'final' function to generate the result. See [[kprintf]]. fprintf, but call the given 'final' function to generate the result. See [[kprintf]]. printf, but call the given 'final' function to generate the result. For example, these let the printing force a flush after all output has been entered onto the channel, but not before. sprintf, but call the given 'final' function to generate the result. See [[kprintf]]. twprintf, but call the given 'final' function to generate the result. See [[kprintf]]. Formatted printing to stdout Formatted printing to stdout, adding a newline Print to a string via an internal string buffer and return the result as a string. Helper printers must return strings. Print to any subtype of the .NET type System.IO.TextWriter Print to any subtype of the .NET type System.IO.TextWriter, and add a newline Extensible printf-style formatting for numbers and other datatypes

Format specifications are strings with "%" markers indicating format placeholders. Format placeholders consist of:

    %[flags][width][.precision][type]
 

where the type is interpreted as follows:

    %b:         bool, formatted as "true" or "false"
    %s:         string, formatted as its unescaped contents
    %d, %i:     any basic integer type formatted as a decimal integer, signed if the basic integer type is signed.
    %u:         any basic integer type formatted as an unsigned decimal integer
    %x, %X, %o: any basic integer type formatted as an unsigned hexadecimal 
                (a-f)/Hexadecimal (A-F)/Octal integer
 
    %e, %E, %f, %F, %g, %G: 
                any basic floating point type (float,float32) formatted
                using a C-style floating point format specifications, i.e
 
          %e, %E: Signed value having the form [-]d.dddde[sign]ddd where 
                  d is a single decimal digit, dddd is one or more decimal
                  digits, ddd is exactly three decimal digits, and sign 
                  is + or -
 
          %f:     Signed value having the form [-]dddd.dddd, where dddd is one
                  or more decimal digits. The number of digits before the 
                  decimal point depends on the magnitude of the number, and 
                  the number of digits after the decimal point depends on 
                  the requested precision.
 
          %g, %G: Signed value printed in f or e format, whichever is 
                  more compact for the given value and precision.
 
 
    %M:     System.Decimal value
 
    %O:     Any value, printed by boxing the object and using it's ToString method(s)
 
    %A:     Any value, printed by using Microsoft.FSharp.Text.StructuredFormat.Display.any_to_string with the default layout settings 
 
    %a: a general format specifier, requires two arguments:
          (1) a function which accepts two arguments:
                (a) a context parameter of the appropriate type for the
                    given formatting function (e.g. an #System.IO.TextWriter)
                (b) a value to print
               and which either outputs or returns appropriate text.
 
          (2) the particular value to print
 
 
    %t: a general format specifier, requires one argument:
          (1) a function which accepts a context parameter of the
              appropriate type for the given formatting function (e.g. 
              an #System.IO.TextWriter)and which either outputs or returns 
              appropriate text.

 Basic integer types are:
    byte,sbyte,int16,uint16,int32,uint32,int64,uint64,nativeint,unativeint
 Basic floating point types are:
    float, float32

 
 The following format patterns are accepted but a warning is printed:

    %h(d|u|x|X|o)
    %l(d|u|x|X|o)

 The following format patterns are now deprecated:

    %Ld, %Li, %Lu, %Lx, %LX, %Lo: same, but an int64
    %nd, %ni, %nu, %nx, %nX, %no: same, but a nativeint
    %Ud, %Ui, %Uu, %Ux, %UX, %Uo: same, but an unsigned int32 (uint32)
    %ULd, %ULi, %ULu, %ULx, %ULX, %ULo: same, but an unsigned int64 (uint64)
    %Und, %Uni, %Unu, %Unx, %UnX, %Uno: same, but an unsigned nativeint 
                                        (unativeint)
 

Valid flags are:

     0: add zeros instead of spaces to make up the required width
     '-': left justify the result within the width specified
     '+': add a '+' character if the number is positive (to match a '-' sign 
          for negatives)
     ' ': add an extra space if the number is positive (to match a '-' 
              sign for negatives)
 

The printf '#' flag is not supported in this release and a compile-time error will be reported if it is used.

   Printf.printf "Hello %s, %d = %d * %d" "World" 6 2 3;
   Printf.sprintf "Hello %s" "World";
   Printf.printf "Hello %a" output_string "World";
 
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;;
 
Return to the layout-generation environment to layout any otherwise uninterpreted object The maximum number of elements for which to generate layout for list-like structures, or columns in table-like structures. -1 if no maximum. The maximum number of rows for which to generate layout for table-like structures. -1 if no maximum. Generate an object representing a structured formatting of the term. Data representing joints in structured layouts of terms. The representation of this data type is only for the consumption of formatting engines. Data representing structured layouts of terms. The representation of this data type is only for the consumption of formatting engines. Data representing joints in structured layouts of terms. The representation of this data type is only for the consumption of formatting engines. Data representing structured layouts of terms. The representation of this data type is only for the consumption of formatting engines. 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. 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. 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, possible break with indent=1 Join, unbreakable. Join, possible break with indent=0 Join, possible break with indent=2 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 An tag is a name which can be wrapped around a layout. Tag names convey structure to renderers, e.g. for syntax coloring or hyperlinks. Standard tag names are in the process of being finalized, though 'html:a' may be used for hyperlinks. tagAttrL provides settings for attributes associated with the tag, e.g. 'href' for 'html:a'. 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. Interpret tables for an ascii lexer generated by fslex. The type of tables for an ascii lexer generated by fslex. Remove all input, though don't discard the current lexeme Adjust the start position associated with the lexbuf Fetch a particular character in the matched string The end position for the lexeme True if the refill of the buffer ever failed , or if explicitly set to true. The matched string The length of the matched string This event is fired each time a lexeme is matched by a client lexer The start position for the lexeme The end position for the lexeme True if the refill of the buffer ever failed , or if explicitly set to true. The start position for the lexeme