F# Compiler Guide


Compiler Services: Virtualized File System

The FSharp.Compiler.Service component has a global variable representing the file system. By setting this variable you can host the compiler in situations where a file system is not available.

NOTE: The FSharp.Compiler.Service API is subject to change when later versions of the nuget package are published.

Setting the FileSystem

In the example below, we set the file system to an implementation which reads from disk

#r "FSharp.Compiler.Service.dll"

open System.IO
open System.Text
open FSharp.Compiler.CodeAnalysis
open FSharp.Compiler.IO

let defaultFileSystem = FileSystem

let fileName1 = @"c:\mycode\test1.fs" // note, the path doesn't exist
let fileName2 = @"c:\mycode\test2.fs" // note, the path doesn't exist

type MyFileSystem() =
    let file1 =
        """
module File1

let A = 1"""

    let file2 =
        """
module File2
let B = File1.A + File1.A"""

    let files =
        dict [ (fileName1, file1)
               (fileName2, file2) ]

    interface IFileSystem with
        // Implement the service to open files for reading and writing
        member _.OpenFileForReadShim(fileName, ?useMemoryMappedFile: bool, ?shouldShadowCopy: bool) =
            match files.TryGetValue fileName with
            | true, text -> new MemoryStream(Encoding.UTF8.GetBytes(text)) :> Stream
            | _ ->
                defaultFileSystem.OpenFileForReadShim(
                    fileName,
                    ?useMemoryMappedFile = useMemoryMappedFile,
                    ?shouldShadowCopy = shouldShadowCopy
                )

        member _.OpenFileForWriteShim(fileName, ?fileMode: FileMode, ?fileAccess: FileAccess, ?fileShare: FileShare) =
            defaultFileSystem.OpenFileForWriteShim(
                fileName,
                ?fileMode = fileMode,
                ?fileAccess = fileAccess,
                ?fileShare = fileShare
            )

        // Implement the service related to file existence and deletion
        member _.FileExistsShim(fileName) =
            files.ContainsKey(fileName)
            || defaultFileSystem.FileExistsShim(fileName)

        // Implement the service related to temporary paths and file time stamps
        member _.GetTempPathShim() = defaultFileSystem.GetTempPathShim()

        member _.GetLastWriteTimeShim(fileName) =
            defaultFileSystem.GetLastWriteTimeShim(fileName)

        member _.GetFullPathShim(fileName) =
            defaultFileSystem.GetFullPathShim(fileName)

        member _.IsInvalidPathShim(fileName) =
            defaultFileSystem.IsInvalidPathShim(fileName)

        member _.IsPathRootedShim(fileName) =
            defaultFileSystem.IsPathRootedShim(fileName)

        member _.FileDeleteShim(fileName) =
            defaultFileSystem.FileDeleteShim(fileName)

        member _.AssemblyLoader = defaultFileSystem.AssemblyLoader

        member _.GetFullFilePathInDirectoryShim dir fileName =
            defaultFileSystem.GetFullFilePathInDirectoryShim dir fileName

        member _.NormalizePathShim(path) =
            defaultFileSystem.NormalizePathShim(path)

        member _.GetDirectoryNameShim(path) =
            defaultFileSystem.GetDirectoryNameShim(path)

        member _.GetCreationTimeShim(path) =
            defaultFileSystem.GetCreationTimeShim(path)

        member _.CopyShim(src, dest, overwrite) =
            defaultFileSystem.CopyShim(src, dest, overwrite)

        member _.DirectoryCreateShim(path) =
            defaultFileSystem.DirectoryCreateShim(path)

        member _.DirectoryExistsShim(path) =
            defaultFileSystem.DirectoryExistsShim(path)

        member _.DirectoryDeleteShim(path) =
            defaultFileSystem.DirectoryDeleteShim(path)

        member _.EnumerateFilesShim(path, pattern) =
            defaultFileSystem.EnumerateFilesShim(path, pattern)

        member _.EnumerateDirectoriesShim(path) =
            defaultFileSystem.EnumerateDirectoriesShim(path)

        member _.IsStableFileHeuristic(path) =
            defaultFileSystem.IsStableFileHeuristic(path)

let myFileSystem = MyFileSystem()
FileSystem <- MyFileSystem()

Doing a compilation with the FileSystem

let checker = FSharpChecker.Create()

let projectOptions =
    let sysLib nm =
        if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then // file references only valid on Windows
            System.Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFilesX86)
            + @"\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\"
            + nm
            + ".dll"
        else
            let sysDir =
                System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory()

            let (++) a b = System.IO.Path.Combine(a, b)
            sysDir ++ nm + ".dll"

    let fsCore4300 () =
        if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then // file references only valid on Windows
            System.Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFilesX86)
            + @"\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.0.0\FSharp.Core.dll"
        else
            sysLib "FSharp.Core"

    let allFlags =
        [| "--simpleresolution"
           "--noframework"
           "--debug:full"
           "--define:DEBUG"
           "--optimize-"
           "--doc:test.xml"
           "--warn:3"
           "--fullpaths"
           "--flaterrors"
           "--target:library"
           let references =
               [ sysLib "mscorlib"
                 sysLib "System"
                 sysLib "System.Core"
                 fsCore4300 () ]

           for r in references do
               "-r:" + r |]

    { ProjectFileName = @"c:\mycode\compilation.fsproj" // Make a name that is unique in this directory.
      ProjectId = None
      SourceFiles = [| fileName1; fileName2 |]
      OriginalLoadReferences = []
      Stamp = None
      OtherOptions = allFlags
      ReferencedProjects = [||]
      IsIncompleteTypeCheckEnvironment = false
      UseScriptResolutionRules = true
      LoadTime = System.DateTime.Now // Note using 'Now' forces reloading
      UnresolvedReferences = None }

let results =
    checker.ParseAndCheckProject(projectOptions)
    |> Async.RunSynchronously

results.Diagnostics
results.AssemblySignature.Entities.Count //2

results.AssemblySignature.Entities.[0]
    .MembersFunctionsAndValues
    .Count

results.AssemblySignature.Entities.[0]
    .MembersFunctionsAndValues.[0]
    .DisplayName

Summary

In this tutorial, we've seen how to globally customize the view of the file system used by the FSharp.Compiler.Service component.

At the time of writing, the following System.IO operations are not considered part of the virtualized file system API. Future iterations on the compiler service implementation may add these to the API.

NOTE: Several operations in the SourceCodeServices API accept the contents of a file to parse or check as a parameter, in addition to a file name. In these cases, the file name is only used for error reporting.

NOTE: Type provider components do not use the virtualized file system.

NOTE: The compiler service may use MSBuild for assembly resolutions unless --simpleresolution is provided. When using the FileSystem API you will normally want to specify --simpleresolution as one of your compiler flags. Also specify --noframework. You will need to supply explicit resolutions of all referenced .NET assemblies.

namespace System
namespace System.IO
namespace System.Text
Multiple items
namespace FSharp

--------------------
namespace Microsoft.FSharp
namespace FSharp.Compiler
namespace FSharp.Compiler.CodeAnalysis
namespace FSharp.Compiler.IO
val defaultFileSystem : IFileSystem
val mutable FileSystem : IFileSystem
<summary> The global hook into the file system </summary>
val fileName1 : string
val fileName2 : string
Multiple items
type MyFileSystem = interface IFileSystem new : unit -> MyFileSystem

--------------------
new : unit -> MyFileSystem
val file1 : string
val file2 : string
val files : System.Collections.Generic.IDictionary<string,string>
val dict : keyValuePairs:seq<'Key * 'Value> -> System.Collections.Generic.IDictionary<'Key,'Value> (requires equality)
<summary>Builds a read-only lookup table from a sequence of key/value pairs. The key objects are indexed using generic hashing and equality.</summary>
type IFileSystem = abstract member CopyShim : src:string * dest:string * overwrite:bool -> unit abstract member DirectoryCreateShim : path:string -> string abstract member DirectoryDeleteShim : path:string -> unit abstract member DirectoryExistsShim : path:string -> bool abstract member EnumerateDirectoriesShim : path:string -> seq<string> abstract member EnumerateFilesShim : path:string * pattern:string -> seq<string> abstract member FileDeleteShim : fileName:string -> unit abstract member FileExistsShim : fileName:string -> bool abstract member GetCreationTimeShim : path:string -> DateTime abstract member GetDirectoryNameShim : path:string -> string ...
<summary> Represents a shim for the file system </summary>
val fileName : string
val useMemoryMappedFile : bool option
[<Struct>] type bool = System.Boolean
<summary>An abbreviation for the CLI type <see cref="T:System.Boolean" />.</summary>
<category>Basic Types</category>
val shouldShadowCopy : bool option
System.Collections.Generic.IDictionary.TryGetValue(key: string, value: byref<string>) : bool
val text : string
Multiple items
type MemoryStream = inherit Stream new : unit -> unit + 6 overloads member BeginRead : buffer: byte [] * offset: int * count: int * callback: AsyncCallback * state: obj -> IAsyncResult member BeginWrite : buffer: byte [] * offset: int * count: int * callback: AsyncCallback * state: obj -> IAsyncResult member CopyTo : destination: Stream * bufferSize: int -> unit member CopyToAsync : destination: Stream * bufferSize: int * cancellationToken: CancellationToken -> Task member Dispose : disposing: bool -> unit member EndRead : asyncResult: IAsyncResult -> int member EndWrite : asyncResult: IAsyncResult -> unit member Flush : unit -> unit ...
<summary>Creates a stream whose backing store is memory.</summary>

--------------------
MemoryStream() : MemoryStream
MemoryStream(buffer: byte []) : MemoryStream
MemoryStream(capacity: int) : MemoryStream
MemoryStream(buffer: byte [], writable: bool) : MemoryStream
MemoryStream(buffer: byte [], index: int, count: int) : MemoryStream
MemoryStream(buffer: byte [], index: int, count: int, writable: bool) : MemoryStream
MemoryStream(buffer: byte [], index: int, count: int, writable: bool, publiclyVisible: bool) : MemoryStream
type Encoding = interface ICloneable new : unit -> unit + 2 overloads member Clone : unit -> obj member Equals : value: obj -> bool member GetByteCount : chars: nativeptr<char> * count: int -> int + 5 overloads member GetBytes : chars: nativeptr<char> * charCount: int * bytes: nativeptr<byte> * byteCount: int -> int + 7 overloads member GetCharCount : bytes: nativeptr<byte> * count: int -> int + 3 overloads member GetChars : bytes: nativeptr<byte> * byteCount: int * chars: nativeptr<char> * charCount: int -> int + 4 overloads member GetDecoder : unit -> Decoder member GetEncoder : unit -> Encoder ...
<summary>Represents a character encoding.</summary>
property Encoding.UTF8: Encoding with get
<summary>Gets an encoding for the UTF-8 format.</summary>
<returns>An encoding for the UTF-8 format.</returns>
(extension) Encoding.GetBytes(chars: inref<System.Buffers.ReadOnlySequence<char>>) : byte []
   (+0 other overloads)
Encoding.GetBytes(s: string) : byte []
   (+0 other overloads)
Encoding.GetBytes(chars: char []) : byte []
   (+0 other overloads)
(extension) Encoding.GetBytes(chars: inref<System.Buffers.ReadOnlySequence<char>>, writer: System.Buffers.IBufferWriter<byte>) : int64
   (+0 other overloads)
(extension) Encoding.GetBytes(chars: inref<System.Buffers.ReadOnlySequence<char>>, bytes: System.Span<byte>) : int
   (+0 other overloads)
(extension) Encoding.GetBytes(chars: System.ReadOnlySpan<char>, writer: System.Buffers.IBufferWriter<byte>) : int64
   (+0 other overloads)
Encoding.GetBytes(chars: System.ReadOnlySpan<char>, bytes: System.Span<byte>) : int
   (+0 other overloads)
Encoding.GetBytes(s: string, index: int, count: int) : byte []
   (+0 other overloads)
Encoding.GetBytes(chars: char [], index: int, count: int) : byte []
   (+0 other overloads)
Encoding.GetBytes(chars: nativeptr<char>, charCount: int, bytes: nativeptr<byte>, byteCount: int) : int
   (+0 other overloads)
type Stream = inherit MarshalByRefObject interface IAsyncDisposable interface IDisposable new : unit -> unit member BeginRead : buffer: byte [] * offset: int * count: int * callback: AsyncCallback * state: obj -> IAsyncResult member BeginWrite : buffer: byte [] * offset: int * count: int * callback: AsyncCallback * state: obj -> IAsyncResult member Close : unit -> unit member CopyTo : destination: Stream -> unit + 1 overload member CopyToAsync : destination: Stream -> Task + 3 overloads member CreateWaitHandle : unit -> WaitHandle ...
<summary>Provides a generic view of a sequence of bytes. This is an abstract class.</summary>
abstract member IFileSystem.OpenFileForReadShim : filePath:string * ?useMemoryMappedFile:bool * ?shouldShadowCopy:bool -> Stream
val fileMode : FileMode option
type FileMode = | CreateNew = 1 | Create = 2 | Open = 3 | OpenOrCreate = 4 | Truncate = 5 | Append = 6
<summary>Specifies how the operating system should open a file.</summary>
val fileAccess : FileAccess option
type FileAccess = | Read = 1 | Write = 2 | ReadWrite = 3
<summary>Defines constants for read, write, or read/write access to a file.</summary>
val fileShare : FileShare option
type FileShare = | None = 0 | Read = 1 | Write = 2 | ReadWrite = 3 | Delete = 4 | Inheritable = 16
<summary>Contains constants for controlling the kind of access other <see cref="T:System.IO.FileStream" /> objects can have to the same file.</summary>
abstract member IFileSystem.OpenFileForWriteShim : filePath:string * ?fileMode:FileMode * ?fileAccess:FileAccess * ?fileShare:FileShare -> Stream
System.Collections.Generic.IDictionary.ContainsKey(key: string) : bool
abstract member IFileSystem.FileExistsShim : fileName:string -> bool
abstract member IFileSystem.GetTempPathShim : unit -> string
abstract member IFileSystem.GetLastWriteTimeShim : fileName:string -> System.DateTime
abstract member IFileSystem.GetFullPathShim : fileName:string -> string
abstract member IFileSystem.IsInvalidPathShim : path:string -> bool
abstract member IFileSystem.IsPathRootedShim : path:string -> bool
abstract member IFileSystem.FileDeleteShim : fileName:string -> unit
property IFileSystem.AssemblyLoader: IAssemblyLoader with get
val dir : string
abstract member IFileSystem.GetFullFilePathInDirectoryShim : dir:string -> fileName:string -> string
val path : string
abstract member IFileSystem.NormalizePathShim : path:string -> string
abstract member IFileSystem.GetDirectoryNameShim : path:string -> string
abstract member IFileSystem.GetCreationTimeShim : path:string -> System.DateTime
val src : string
val dest : string
val overwrite : bool
abstract member IFileSystem.CopyShim : src:string * dest:string * overwrite:bool -> unit
abstract member IFileSystem.DirectoryCreateShim : path:string -> string
abstract member IFileSystem.DirectoryExistsShim : path:string -> bool
abstract member IFileSystem.DirectoryDeleteShim : path:string -> unit
val pattern : string
abstract member IFileSystem.EnumerateFilesShim : path:string * pattern:string -> seq<string>
abstract member IFileSystem.EnumerateDirectoriesShim : path:string -> seq<string>
abstract member IFileSystem.IsStableFileHeuristic : fileName:string -> bool
val myFileSystem : MyFileSystem
val checker : FSharpChecker
type FSharpChecker = member CheckFileInProject : parseResults:FSharpParseFileResults * fileName:string * fileVersion:int * sourceText:ISourceText * options:FSharpProjectOptions * ?userOpName:string -> Async<FSharpCheckFileAnswer> member ClearCache : options:seq<FSharpProjectOptions> * ?userOpName:string -> unit member ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients : unit -> unit member Compile : argv:string [] * ?userOpName:string -> Async<FSharpDiagnostic [] * int> + 1 overload member CompileToDynamicAssembly : otherFlags:string [] * execute:(TextWriter * TextWriter) option * ?userOpName:string -> Async<FSharpDiagnostic [] * int * Assembly option> + 1 overload member FindBackgroundReferencesInFile : fileName:string * options:FSharpProjectOptions * symbol:FSharpSymbol * ?canInvalidateProject:bool * ?userOpName:string -> Async<seq<range>> member GetBackgroundCheckResultsForFileInProject : fileName:string * options:FSharpProjectOptions * ?userOpName:string -> Async<FSharpParseFileResults * FSharpCheckFileResults> member GetBackgroundParseResultsForFileInProject : fileName:string * options:FSharpProjectOptions * ?userOpName:string -> Async<FSharpParseFileResults> member GetBackgroundSemanticClassificationForFile : fileName:string * options:FSharpProjectOptions * ?userOpName:string -> Async<SemanticClassificationView option> member GetParsingOptionsFromCommandLineArgs : sourceFiles:string list * argv:string list * ?isInteractive:bool * ?isEditing:bool -> FSharpParsingOptions * FSharpDiagnostic list + 1 overload ...
<summary> Used to parse and check F# source code. </summary>
static member FSharpChecker.Create : ?projectCacheSize:int * ?keepAssemblyContents:bool * ?keepAllBackgroundResolutions:bool * ?legacyReferenceResolver:LegacyReferenceResolver * ?tryGetMetadataSnapshot:FSharp.Compiler.AbstractIL.ILBinaryReader.ILReaderTryGetMetadataSnapshot * ?suggestNamesForErrors:bool * ?keepAllBackgroundSymbolUses:bool * ?enableBackgroundItemKeyStoreAndSemanticClassification:bool * ?enablePartialTypeChecking:bool -> FSharpChecker
val projectOptions : FSharpProjectOptions
val sysLib : (string -> string)
val nm : string
type Environment = static member Exit : exitCode: int -> unit static member ExpandEnvironmentVariables : name: string -> string static member FailFast : message: string -> unit + 1 overload static member GetCommandLineArgs : unit -> string [] static member GetEnvironmentVariable : variable: string -> string + 1 overload static member GetEnvironmentVariables : unit -> IDictionary + 1 overload static member GetFolderPath : folder: SpecialFolder -> string + 1 overload static member GetLogicalDrives : unit -> string [] static member SetEnvironmentVariable : variable: string * value: string -> unit + 1 overload static member CommandLine : string ...
<summary>Provides information about, and means to manipulate, the current environment and platform. This class cannot be inherited.</summary>
property System.Environment.OSVersion: System.OperatingSystem with get
<summary>Gets the current platform identifier and version number.</summary>
<exception cref="T:System.InvalidOperationException">This property was unable to obtain the system version. -or- The obtained platform identifier is not a member of <see cref="T:System.PlatformID" /></exception>
<returns>The platform identifier and version number.</returns>
property System.OperatingSystem.Platform: System.PlatformID with get
<summary>Gets a <see cref="T:System.PlatformID" /> enumeration value that identifies the operating system platform.</summary>
<returns>One of the <see cref="T:System.PlatformID" /> values.</returns>
type PlatformID = | Win32S = 0 | Win32Windows = 1 | Win32NT = 2 | WinCE = 3 | Unix = 4 | Xbox = 5 | MacOSX = 6 | Other = 7
<summary>Identifies the operating system, or platform, supported by an assembly.</summary>
field System.PlatformID.Win32NT: System.PlatformID = 2
<summary>The operating system is Windows NT or later.</summary>
System.Environment.GetFolderPath(folder: System.Environment.SpecialFolder) : string
System.Environment.GetFolderPath(folder: System.Environment.SpecialFolder, option: System.Environment.SpecialFolderOption) : string
type SpecialFolder = | Desktop = 0 | Programs = 2 | MyDocuments = 5 | Personal = 5 | Favorites = 6 | Startup = 7 | Recent = 8 | SendTo = 9 | StartMenu = 11 | MyMusic = 13 ...
<summary>Specifies enumerated constants used to retrieve directory paths to system special folders.</summary>
field System.Environment.SpecialFolder.ProgramFilesX86: System.Environment.SpecialFolder = 42
<summary>The x86 Program Files folder. Added in the .NET Framework 4.</summary>
val sysDir : string
namespace System.Runtime
namespace System.Runtime.InteropServices
type RuntimeEnvironment = static member FromGlobalAccessCache : a: Assembly -> bool static member GetRuntimeDirectory : unit -> string static member GetRuntimeInterfaceAsIntPtr : clsid: Guid * riid: Guid -> nativeint static member GetRuntimeInterfaceAsObject : clsid: Guid * riid: Guid -> obj static member GetSystemVersion : unit -> string static member SystemConfigurationFile : string
<summary>Provides a collection of <see langword="static" /> methods that return information about the common language runtime environment.</summary>
System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() : string
val a : string
val b : string
type Path = static member ChangeExtension : path: string * extension: string -> string static member Combine : path1: string * path2: string -> string + 3 overloads static member EndsInDirectorySeparator : path: ReadOnlySpan<char> -> bool + 1 overload static member GetDirectoryName : path: ReadOnlySpan<char> -> ReadOnlySpan<char> + 1 overload static member GetExtension : path: ReadOnlySpan<char> -> ReadOnlySpan<char> + 1 overload static member GetFileName : path: ReadOnlySpan<char> -> ReadOnlySpan<char> + 1 overload static member GetFileNameWithoutExtension : path: ReadOnlySpan<char> -> ReadOnlySpan<char> + 1 overload static member GetFullPath : path: string -> string + 1 overload static member GetInvalidFileNameChars : unit -> char [] static member GetInvalidPathChars : unit -> char [] ...
<summary>Performs operations on <see cref="T:System.String" /> instances that contain file or directory path information. These operations are performed in a cross-platform manner.</summary>
Path.Combine([<System.ParamArray>] paths: string []) : string
Path.Combine(path1: string, path2: string) : string
Path.Combine(path1: string, path2: string, path3: string) : string
Path.Combine(path1: string, path2: string, path3: string, path4: string) : string
val fsCore4300 : (unit -> string)
val allFlags : string []
val references : string list
val r : string
union case Option.None: Option<'T>
<summary>The representation of "No value"</summary>
Multiple items
[<Struct>] type DateTime = new : year: int * month: int * day: int -> unit + 10 overloads member Add : value: TimeSpan -> DateTime member AddDays : value: float -> DateTime member AddHours : value: float -> DateTime member AddMilliseconds : value: float -> DateTime member AddMinutes : value: float -> DateTime member AddMonths : months: int -> DateTime member AddSeconds : value: float -> DateTime member AddTicks : value: int64 -> DateTime member AddYears : value: int -> DateTime ...
<summary>Represents an instant in time, typically expressed as a date and time of day.</summary>

--------------------
System.DateTime ()
   (+0 other overloads)
System.DateTime(ticks: int64) : System.DateTime
   (+0 other overloads)
System.DateTime(ticks: int64, kind: System.DateTimeKind) : System.DateTime
   (+0 other overloads)
System.DateTime(year: int, month: int, day: int) : System.DateTime
   (+0 other overloads)
System.DateTime(year: int, month: int, day: int, calendar: System.Globalization.Calendar) : System.DateTime
   (+0 other overloads)
System.DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int) : System.DateTime
   (+0 other overloads)
System.DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, kind: System.DateTimeKind) : System.DateTime
   (+0 other overloads)
System.DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, calendar: System.Globalization.Calendar) : System.DateTime
   (+0 other overloads)
System.DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, millisecond: int) : System.DateTime
   (+0 other overloads)
System.DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, millisecond: int, kind: System.DateTimeKind) : System.DateTime
   (+0 other overloads)
property System.DateTime.Now: System.DateTime with get
<summary>Gets a <see cref="T:System.DateTime" /> object that is set to the current date and time on this computer, expressed as the local time.</summary>
<returns>An object whose value is the current local date and time.</returns>
val results : FSharpCheckProjectResults
member FSharpChecker.ParseAndCheckProject : options:FSharpProjectOptions * ?userOpName:string -> Async<FSharpCheckProjectResults>
Multiple items
type Async = static member AsBeginEnd : computation:('Arg -> Async<'T>) -> ('Arg * AsyncCallback * obj -> IAsyncResult) * (IAsyncResult -> 'T) * (IAsyncResult -> unit) static member AwaitEvent : event:IEvent<'Del,'T> * ?cancelAction:(unit -> unit) -> Async<'T> (requires delegate and 'Del :> Delegate) static member AwaitIAsyncResult : iar:IAsyncResult * ?millisecondsTimeout:int -> Async<bool> static member AwaitTask : task:Task<'T> -> Async<'T> + 1 overload static member AwaitWaitHandle : waitHandle:WaitHandle * ?millisecondsTimeout:int -> Async<bool> static member CancelDefaultToken : unit -> unit static member Catch : computation:Async<'T> -> Async<Choice<'T,exn>> static member Choice : computations:seq<Async<'T option>> -> Async<'T option> static member FromBeginEnd : beginAction:(AsyncCallback * obj -> IAsyncResult) * endAction:(IAsyncResult -> 'T) * ?cancelAction:(unit -> unit) -> Async<'T> + 3 overloads static member FromContinuations : callback:(('T -> unit) * (exn -> unit) * (OperationCanceledException -> unit) -> unit) -> Async<'T> ...
<summary>Holds static members for creating and manipulating asynchronous computations.</summary>
<remarks> See also <a href="https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/asynchronous-workflows">F# Language Guide - Async Workflows</a>. </remarks>
<category index="1">Async Programming</category>


--------------------
type Async<'T> =
<summary> An asynchronous computation, which, when run, will eventually produce a value of type T, or else raises an exception. </summary>
<remarks> This type has no members. Asynchronous computations are normally specified either by using an async expression or the static methods in the <see cref="T:Microsoft.FSharp.Control.Async" /> type. See also <a href="https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/asynchronous-workflows">F# Language Guide - Async Workflows</a>. </remarks>
<namespacedoc><summary> Library functionality for asynchronous programming, events and agents. See also <a href="https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/asynchronous-workflows">Asynchronous Programming</a>, <a href="https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/members/events">Events</a> and <a href="https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/lazy-expressions">Lazy Expressions</a> in the F# Language Guide. </summary></namespacedoc>
<category index="1">Async Programming</category>
static member Async.RunSynchronously : computation:Async<'T> * ?timeout:int * ?cancellationToken:System.Threading.CancellationToken -> 'T
property FSharpCheckProjectResults.Diagnostics: FSharp.Compiler.Diagnostics.FSharpDiagnostic [] with get
<summary> The errors returned by processing the project </summary>
property FSharpCheckProjectResults.AssemblySignature: FSharp.Compiler.Symbols.FSharpAssemblySignature with get
<summary> Get a view of the overall signature of the assembly. Only valid to use if HasCriticalErrors is false. </summary>
property FSharp.Compiler.Symbols.FSharpAssemblySignature.Entities: System.Collections.Generic.IList<FSharp.Compiler.Symbols.FSharpEntity> with get
<summary> The (non-nested) module and type definitions in this signature </summary>
property System.Collections.Generic.ICollection.Count: int with get
<summary>Gets the number of elements contained in the <see cref="T:System.Collections.Generic.ICollection`1" />.</summary>
<returns>The number of elements contained in the <see cref="T:System.Collections.Generic.ICollection`1" />.</returns>