diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3183e218b4..a6bb6a057d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: '5.0.x' + dotnet-version: '6.0.x' - name: Setup Node.js environment uses: actions/setup-node@v2.4.1 diff --git a/global.json b/global.json index acd6055a84..ff4e0c41d3 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "5.0.300", + "version": "6.0.100", "rollForward": "minor" } } diff --git a/lib/fcs/FSharp.Compiler.Service.deps.json b/lib/fcs/FSharp.Compiler.Service.deps.json index 44fe4cbf91..a0e3e187a4 100644 --- a/lib/fcs/FSharp.Compiler.Service.deps.json +++ b/lib/fcs/FSharp.Compiler.Service.deps.json @@ -7,13 +7,14 @@ "targets": { ".NETStandard,Version=v2.0": {}, ".NETStandard,Version=v2.0/": { - "FSharp.Compiler.Service/40.0.0-dev": { - "dependencies": { - "FSharp.Core": "5.0.2-dev", - "FSharp.DependencyManager.Nuget": "5.0.2-dev", - "Microsoft.Build.Framework": "16.9.0", - "Microsoft.Build.Tasks.Core": "16.9.0", - "Microsoft.Build.Utilities.Core": "16.9.0", + "FSharp.Compiler.Service/41.0.1-dev": { + "dependencies": { + "FSharp.Core": "6.0.1-dev", + "FSharp.DependencyManager.Nuget": "6.0.1-dev", + "Microsoft.Build.Framework": "16.11.0", + "Microsoft.Build.Tasks.Core": "16.11.0", + "Microsoft.Build.Utilities.Core": "16.11.0", + "Microsoft.DotNet.XliffTasks": "1.0.0-beta.21518.1", "Microsoft.SourceLink.AzureRepos.Git": "1.1.0-beta-20206-02", "Microsoft.SourceLink.GitHub": "1.1.0-beta-20206-02", "NETStandard.Library": "2.0.3", @@ -25,11 +26,12 @@ "System.Linq.Queryable": "4.3.0", "System.Memory": "4.5.4", "System.Net.Requests": "4.3.0", - "System.Net.Security": "4.3.0", + "System.Net.Security": "4.3.1", "System.Reflection.Emit": "4.3.0", "System.Reflection.Metadata": "5.0.0", "System.Reflection.TypeExtensions": "4.3.0", "System.Runtime": "4.3.0", + "System.Runtime.CompilerServices.Unsafe": "5.0.0", "System.Runtime.InteropServices": "4.3.0", "System.Runtime.Loader": "4.3.0", "System.Security.Claims": "4.3.0", @@ -37,8 +39,7 @@ "System.Security.Principal": "4.3.0", "System.Threading.Tasks.Parallel": "4.3.0", "System.Threading.Thread": "4.3.0", - "System.Threading.ThreadPool": "4.3.0", - "XliffTasks": "1.0.0-beta.21301.1" + "System.Threading.ThreadPool": "4.3.0" }, "runtime": { "FSharp.Compiler.Service.dll": {} @@ -85,28 +86,27 @@ } } }, - "Microsoft.Build.Framework/16.9.0": { + "Microsoft.Build.Framework/16.11.0": { "dependencies": { "System.Security.Permissions": "4.7.0" }, "runtime": { "lib/netstandard2.0/Microsoft.Build.Framework.dll": { "assemblyVersion": "15.1.0.0", - "fileVersion": "16.9.0.11203" + "fileVersion": "16.11.0.36601" } } }, - "Microsoft.Build.Tasks.Core/16.9.0": { + "Microsoft.Build.Tasks.Core/16.11.0": { "dependencies": { - "Microsoft.Build.Framework": "16.9.0", - "Microsoft.Build.Utilities.Core": "16.9.0", + "Microsoft.Build.Framework": "16.11.0", + "Microsoft.Build.Utilities.Core": "16.11.0", + "Microsoft.NET.StringTools": "1.0.0", "Microsoft.Win32.Registry": "4.3.0", "System.CodeDom": "4.4.0", "System.Collections.Immutable": "5.0.0", "System.Reflection.Metadata": "5.0.0", - "System.Reflection.TypeExtensions": "4.3.0", "System.Resources.Extensions": "4.6.0", - "System.Runtime.InteropServices": "4.3.0", "System.Security.Cryptography.Pkcs": "4.7.0", "System.Security.Cryptography.Xml": "4.7.0", "System.Security.Permissions": "4.7.0", @@ -115,23 +115,38 @@ "runtime": { "lib/netstandard2.0/Microsoft.Build.Tasks.Core.dll": { "assemblyVersion": "15.1.0.0", - "fileVersion": "16.9.0.11203" + "fileVersion": "16.11.0.36601" } } }, "Microsoft.Build.Tasks.Git/1.1.0-beta-20206-02": {}, - "Microsoft.Build.Utilities.Core/16.9.0": { + "Microsoft.Build.Utilities.Core/16.11.0": { "dependencies": { - "Microsoft.Build.Framework": "16.9.0", + "Microsoft.Build.Framework": "16.11.0", + "Microsoft.NET.StringTools": "1.0.0", "Microsoft.Win32.Registry": "4.3.0", "System.Collections.Immutable": "5.0.0", + "System.Configuration.ConfigurationManager": "4.7.0", "System.Security.Permissions": "4.7.0", "System.Text.Encoding.CodePages": "4.0.1" }, "runtime": { "lib/netstandard2.0/Microsoft.Build.Utilities.Core.dll": { "assemblyVersion": "15.1.0.0", - "fileVersion": "16.9.0.11203" + "fileVersion": "16.11.0.36601" + } + } + }, + "Microsoft.DotNet.XliffTasks/1.0.0-beta.21518.1": {}, + "Microsoft.NET.StringTools/1.0.0": { + "dependencies": { + "System.Memory": "4.5.4", + "System.Runtime.CompilerServices.Unsafe": "5.0.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.NET.StringTools.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.26302" } } }, @@ -276,6 +291,18 @@ } } }, + "System.Configuration.ConfigurationManager/4.7.0": { + "dependencies": { + "System.Security.Cryptography.ProtectedData": "4.7.0", + "System.Security.Permissions": "4.7.0" + }, + "runtime": { + "lib/netstandard2.0/System.Configuration.ConfigurationManager.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.700.19.56404" + } + } + }, "System.Diagnostics.Debug/4.3.0": { "dependencies": { "Microsoft.NETCore.Platforms": "1.1.0", @@ -464,7 +491,7 @@ "dependencies": { "System.Buffers": "4.5.1", "System.Numerics.Vectors": "4.4.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Runtime.CompilerServices.Unsafe": "5.0.0" }, "runtime": { "lib/netstandard2.0/System.Memory.dll": { @@ -528,7 +555,7 @@ "System.Threading.Tasks": "4.3.0" } }, - "System.Net.Security/4.3.0": { + "System.Net.Security/4.3.1": { "dependencies": { "Microsoft.NETCore.Platforms": "1.1.0", "Microsoft.Win32.Primitives": "4.3.0", @@ -712,11 +739,11 @@ "Microsoft.NETCore.Targets": "1.1.0" } }, - "System.Runtime.CompilerServices.Unsafe/4.5.3": { + "System.Runtime.CompilerServices.Unsafe/5.0.0": { "runtime": { "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": { - "assemblyVersion": "4.0.4.1", - "fileVersion": "4.0.0.0" + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.0.20.51904" } } }, @@ -911,6 +938,17 @@ } } }, + "System.Security.Cryptography.ProtectedData/4.7.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": { + "assemblyVersion": "4.0.5.0", + "fileVersion": "4.700.19.56404" + } + } + }, "System.Security.Cryptography.X509Certificates/4.3.0": { "dependencies": { "Microsoft.NETCore.Platforms": "1.1.0", @@ -1081,8 +1119,7 @@ } } }, - "XliffTasks/1.0.0-beta.21301.1": {}, - "FSharp.Core/5.0.2-dev": { + "FSharp.Core/6.0.1-dev": { "dependencies": { "System.Linq.Queryable": "4.3.0", "System.Net.Requests": "4.3.0", @@ -1092,57 +1129,57 @@ "FSharp.Core.dll": {} }, "resources": { - "it/FSharp.Core.resources.dll": { - "locale": "it" + "cs/FSharp.Core.resources.dll": { + "locale": "cs" }, - "ru/FSharp.Core.resources.dll": { - "locale": "ru" + "de/FSharp.Core.resources.dll": { + "locale": "de" }, - "pl/FSharp.Core.resources.dll": { - "locale": "pl" + "es/FSharp.Core.resources.dll": { + "locale": "es" }, - "pt-BR/FSharp.Core.resources.dll": { - "locale": "pt-BR" + "fr/FSharp.Core.resources.dll": { + "locale": "fr" + }, + "it/FSharp.Core.resources.dll": { + "locale": "it" }, "ja/FSharp.Core.resources.dll": { "locale": "ja" }, - "cs/FSharp.Core.resources.dll": { - "locale": "cs" - }, "ko/FSharp.Core.resources.dll": { "locale": "ko" }, - "zh-Hans/FSharp.Core.resources.dll": { - "locale": "zh-Hans" + "pl/FSharp.Core.resources.dll": { + "locale": "pl" + }, + "pt-BR/FSharp.Core.resources.dll": { + "locale": "pt-BR" + }, + "ru/FSharp.Core.resources.dll": { + "locale": "ru" }, "tr/FSharp.Core.resources.dll": { "locale": "tr" }, - "fr/FSharp.Core.resources.dll": { - "locale": "fr" + "zh-Hans/FSharp.Core.resources.dll": { + "locale": "zh-Hans" }, "zh-Hant/FSharp.Core.resources.dll": { "locale": "zh-Hant" - }, - "de/FSharp.Core.resources.dll": { - "locale": "de" - }, - "es/FSharp.Core.resources.dll": { - "locale": "es" } } }, - "FSharp.DependencyManager.Nuget/5.0.2-dev": { + "FSharp.DependencyManager.Nuget/6.0.1-dev": { "dependencies": { - "FSharp.Core": "5.0.2-dev", + "FSharp.Core": "6.0.1-dev", "System.Collections.Immutable": "5.0.0", "System.Diagnostics.Process": "4.3.0", "System.Diagnostics.TraceSource": "4.3.0", "System.Linq.Expressions": "4.3.0", "System.Linq.Queryable": "4.3.0", "System.Net.Requests": "4.3.0", - "System.Net.Security": "4.3.0", + "System.Net.Security": "4.3.1", "System.Reflection.Emit": "4.3.0", "System.Reflection.Metadata": "5.0.0", "System.Reflection.TypeExtensions": "4.3.0", @@ -1160,68 +1197,68 @@ "FSharp.DependencyManager.Nuget.dll": {} }, "resources": { - "it/FSharp.DependencyManager.Nuget.resources.dll": { - "locale": "it" + "cs/FSharp.DependencyManager.Nuget.resources.dll": { + "locale": "cs" }, - "ru/FSharp.DependencyManager.Nuget.resources.dll": { - "locale": "ru" + "de/FSharp.DependencyManager.Nuget.resources.dll": { + "locale": "de" }, - "pl/FSharp.DependencyManager.Nuget.resources.dll": { - "locale": "pl" + "es/FSharp.DependencyManager.Nuget.resources.dll": { + "locale": "es" }, - "pt-BR/FSharp.DependencyManager.Nuget.resources.dll": { - "locale": "pt-BR" + "fr/FSharp.DependencyManager.Nuget.resources.dll": { + "locale": "fr" + }, + "it/FSharp.DependencyManager.Nuget.resources.dll": { + "locale": "it" }, "ja/FSharp.DependencyManager.Nuget.resources.dll": { "locale": "ja" }, - "cs/FSharp.DependencyManager.Nuget.resources.dll": { - "locale": "cs" - }, "ko/FSharp.DependencyManager.Nuget.resources.dll": { "locale": "ko" }, - "zh-Hans/FSharp.DependencyManager.Nuget.resources.dll": { - "locale": "zh-Hans" + "pl/FSharp.DependencyManager.Nuget.resources.dll": { + "locale": "pl" + }, + "pt-BR/FSharp.DependencyManager.Nuget.resources.dll": { + "locale": "pt-BR" + }, + "ru/FSharp.DependencyManager.Nuget.resources.dll": { + "locale": "ru" }, "tr/FSharp.DependencyManager.Nuget.resources.dll": { "locale": "tr" }, - "fr/FSharp.DependencyManager.Nuget.resources.dll": { - "locale": "fr" + "zh-Hans/FSharp.DependencyManager.Nuget.resources.dll": { + "locale": "zh-Hans" }, "zh-Hant/FSharp.DependencyManager.Nuget.resources.dll": { "locale": "zh-Hant" - }, - "de/FSharp.DependencyManager.Nuget.resources.dll": { - "locale": "de" - }, - "es/FSharp.DependencyManager.Nuget.resources.dll": { - "locale": "es" } } } } }, "libraries": { - "FSharp.Compiler.Service/40.0.0-dev": { + "FSharp.Compiler.Service/41.0.1-dev": { "type": "project", "serviceable": false, "sha512": "" }, - "Microsoft.Build.Framework/16.9.0": { + "Microsoft.Build.Framework/16.11.0": { "type": "package", "serviceable": true, - "sha512": "sha512-vY9ftq43is1TlHgUz0RBnTwF36QerDJ87/GXUd6G02h6QpfrB+jWD9vEFs7B7ZsyJ4vIFwGy+g3RcgYQrQWxpA==", - "path": "microsoft.build.framework/16.9.0", - "hashPath": "microsoft.build.framework.16.9.0.nupkg.sha512" + "sha512": "sha512-ZBKk+0W/fstpsYg7j1nNvqUQ4vjl4xetKwRf7/CCp956lckEOKuCpNO9yj0yO/UlmUaNGU+8csF+oYWIdOZGPw==", + "path": "microsoft.build.framework/16.11.0", + "hashPath": "microsoft.build.framework.16.11.0.nupkg.sha512" }, - "Microsoft.Build.Tasks.Core/16.9.0": { + "Microsoft.Build.Tasks.Core/16.11.0": { "type": "package", "serviceable": true, - "sha512": "sha512-OZbWzY3CDJf9J7NSPxUUCwqbF7GI4DFkr8dprNTWuUBmifcDlyLcP1XxO7uGmIGBYmtdXgo1g4vTAi+nyDPnKw==", - "path": "microsoft.build.tasks.core/16.9.0", - "hashPath": "microsoft.build.tasks.core.16.9.0.nupkg.sha512" + "sha512": "sha512-nEQgJlskVzK0oaBlPNYGbBpU7uPTwTHJ1T2rid3LRc6/CKOuBPtXEWgF1HxsldlHsx5q79sn8AE0RqAhQm7EVQ==", + "path": "microsoft.build.tasks.core/16.11.0", + "hashPath": "microsoft.build.tasks.core.16.11.0.nupkg.sha512" }, "Microsoft.Build.Tasks.Git/1.1.0-beta-20206-02": { "type": "package", @@ -1230,12 +1267,26 @@ "path": "microsoft.build.tasks.git/1.1.0-beta-20206-02", "hashPath": "microsoft.build.tasks.git.1.1.0-beta-20206-02.nupkg.sha512" }, - "Microsoft.Build.Utilities.Core/16.9.0": { + "Microsoft.Build.Utilities.Core/16.11.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-qJ02OPuYuCkcJRm3AeUV3GT6vQ1yGg4ChKi6wc+X7bSJqu6yuTxwVn7kSPx/4uD/kPyhJkzOPRi1ez5SLdXFeQ==", + "path": "microsoft.build.utilities.core/16.11.0", + "hashPath": "microsoft.build.utilities.core.16.11.0.nupkg.sha512" + }, + "Microsoft.DotNet.XliffTasks/1.0.0-beta.21518.1": { "type": "package", "serviceable": true, - "sha512": "sha512-rpxfQlBo2hkFODFJZKPYxMsl5QGIqQ6GlSYnQGKhl+Fu65cvJDk4jRi/R9i+X5/+lSeHhRlQbo+UUhg6cqMkRw==", - "path": "microsoft.build.utilities.core/16.9.0", - "hashPath": "microsoft.build.utilities.core.16.9.0.nupkg.sha512" + "sha512": "sha512-8iH66HD/cFqtwulncc67YyTUDlodxJ5Ac7/nB6mQtc1nOcVT63Fy3hjrhw6ywjKIinG6tYTN7euRrwknbfUdbg==", + "path": "microsoft.dotnet.xlifftasks/1.0.0-beta.21518.1", + "hashPath": "microsoft.dotnet.xlifftasks.1.0.0-beta.21518.1.nupkg.sha512" + }, + "Microsoft.NET.StringTools/1.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZYVcoDM0LnSyT5nWoRGfShYdOecCw2sOXWwP6j1Z0u48Xq3+BVvZ+EiPCX9/8Gz439giW+O1H1kWF9Eb/w6rVg==", + "path": "microsoft.net.stringtools/1.0.0", + "hashPath": "microsoft.net.stringtools.1.0.0.nupkg.sha512" }, "Microsoft.NETCore.Platforms/1.1.0": { "type": "package", @@ -1440,6 +1491,13 @@ "path": "system.collections.immutable/5.0.0", "hashPath": "system.collections.immutable.5.0.0.nupkg.sha512" }, + "System.Configuration.ConfigurationManager/4.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/anOTeSZCNNI2zDilogWrZ8pNqCmYbzGNexUnNhjW8k0sHqEZ2nHJBp147jBV3hGYswu5lINpNg1vxR7bnqvVA==", + "path": "system.configuration.configurationmanager/4.7.0", + "hashPath": "system.configuration.configurationmanager.4.7.0.nupkg.sha512" + }, "System.Diagnostics.Debug/4.3.0": { "type": "package", "serviceable": true, @@ -1566,12 +1624,12 @@ "path": "system.net.requests/4.3.0", "hashPath": "system.net.requests.4.3.0.nupkg.sha512" }, - "System.Net.Security/4.3.0": { + "System.Net.Security/4.3.1": { "type": "package", "serviceable": true, - "sha512": "sha512-IgJKNfALqw7JRWp5LMQ5SWHNKvXVz094U6wNE3c1i8bOkMQvgBL+MMQuNt3xl9Qg9iWpj3lFxPZEY6XHmROjMQ==", - "path": "system.net.security/4.3.0", - "hashPath": "system.net.security.4.3.0.nupkg.sha512" + "sha512": "sha512-qYnDntmrrHXUAhA+v2Kve8onMjJ2ZryQvx7kjGhW88c0IgA9B+q2M8b3l76HFBeotufDbAJfOvLEP32PS4XIKA==", + "path": "system.net.security/4.3.1", + "hashPath": "system.net.security.4.3.1.nupkg.sha512" }, "System.Net.WebHeaderCollection/4.3.0": { "type": "package", @@ -1671,12 +1729,12 @@ "path": "system.runtime/4.3.0", "hashPath": "system.runtime.4.3.0.nupkg.sha512" }, - "System.Runtime.CompilerServices.Unsafe/4.5.3": { + "System.Runtime.CompilerServices.Unsafe/5.0.0": { "type": "package", "serviceable": true, - "sha512": "sha512-3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==", - "path": "system.runtime.compilerservices.unsafe/4.5.3", - "hashPath": "system.runtime.compilerservices.unsafe.4.5.3.nupkg.sha512" + "sha512": "sha512-ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==", + "path": "system.runtime.compilerservices.unsafe/5.0.0", + "hashPath": "system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512" }, "System.Runtime.Extensions/4.3.0": { "type": "package", @@ -1776,6 +1834,13 @@ "path": "system.security.cryptography.primitives/4.3.0", "hashPath": "system.security.cryptography.primitives.4.3.0.nupkg.sha512" }, + "System.Security.Cryptography.ProtectedData/4.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ehYW0m9ptxpGWvE4zgqongBVWpSDU/JCFD4K7krxkQwSz/sFQjEXCUqpvencjy6DYDbn7Ig09R8GFffu8TtneQ==", + "path": "system.security.cryptography.protecteddata/4.7.0", + "hashPath": "system.security.cryptography.protecteddata.4.7.0.nupkg.sha512" + }, "System.Security.Cryptography.X509Certificates/4.3.0": { "type": "package", "serviceable": true, @@ -1874,19 +1939,12 @@ "path": "system.threading.threadpool/4.3.0", "hashPath": "system.threading.threadpool.4.3.0.nupkg.sha512" }, - "XliffTasks/1.0.0-beta.21301.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-viSIWl/PUkVuXWVkJ5GuJPhIpeK1k5qWY7E7NXCs9qWW1ibD2aZ3iiDkR7sPoaykHk4B0gfsna809IANxhGqQg==", - "path": "xlifftasks/1.0.0-beta.21301.1", - "hashPath": "xlifftasks.1.0.0-beta.21301.1.nupkg.sha512" - }, - "FSharp.Core/5.0.2-dev": { + "FSharp.Core/6.0.1-dev": { "type": "project", "serviceable": false, "sha512": "" }, - "FSharp.DependencyManager.Nuget/5.0.2-dev": { + "FSharp.DependencyManager.Nuget/6.0.1-dev": { "type": "project", "serviceable": false, "sha512": "" diff --git a/lib/fcs/FSharp.Compiler.Service.dll b/lib/fcs/FSharp.Compiler.Service.dll index 97763f866f..149146e268 100644 Binary files a/lib/fcs/FSharp.Compiler.Service.dll and b/lib/fcs/FSharp.Compiler.Service.dll differ diff --git a/lib/fcs/FSharp.Compiler.Service.xml b/lib/fcs/FSharp.Compiler.Service.xml index f472a6de59..b0f37806e4 100644 --- a/lib/fcs/FSharp.Compiler.Service.xml +++ b/lib/fcs/FSharp.Compiler.Service.xml @@ -5,3469 +5,3643 @@ Consider using 'yield!' instead of 'yield'. - (Originally from ../FSComp.txt:32) + (Originally from ..\FSComp.txt:32) This XML comment is invalid: unresolved cross-reference '%s' - (Originally from ../FSComp.txt:1560) + (Originally from ..\FSComp.txt:1605) This XML comment is invalid: missing 'name' attribute for parameter or parameter reference - (Originally from ../FSComp.txt:1556) + (Originally from ..\FSComp.txt:1601) This XML comment is incomplete: no documentation for parameter '%s' - (Originally from ../FSComp.txt:1561) + (Originally from ..\FSComp.txt:1606) This XML comment is invalid: missing 'cref' attribute for cross-reference - (Originally from ../FSComp.txt:1557) + (Originally from ..\FSComp.txt:1602) This XML comment is invalid: unknown parameter '%s' - (Originally from ../FSComp.txt:1558) + (Originally from ..\FSComp.txt:1603) This XML comment is invalid: multiple documentation entries for parameter '%s' - (Originally from ../FSComp.txt:1559) + (Originally from ..\FSComp.txt:1604) This XML comment is invalid: '%s' - (Originally from ../FSComp.txt:1555) + (Originally from ..\FSComp.txt:1600) The byref pointer is readonly, so this write is not permitted. - (Originally from ../FSComp.txt:1468) + (Originally from ..\FSComp.txt:1487) The value '%s' is not accessible from this code location - (Originally from ../FSComp.txt:962) + (Originally from ..\FSComp.txt:965) Use reference assemblies for .NET framework references when available (Enabled by default). - (Originally from ../FSComp.txt:1506) + (Originally from ..\FSComp.txt:1525) + + + + + This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect. + (Originally from ..\FSComp.txt:34) The union cases or fields of the type '%s' are not accessible from this code location - (Originally from ../FSComp.txt:961) + (Originally from ..\FSComp.txt:964) The union case '%s' is not accessible from this code location - (Originally from ../FSComp.txt:963) + (Originally from ..\FSComp.txt:966) The value or constructor '%s' is not defined. - (Originally from ../FSComp.txt:9) + (Originally from ..\FSComp.txt:9) The value, namespace, type or module '%s' is not defined. - (Originally from ../FSComp.txt:10) + (Originally from ..\FSComp.txt:10) The value, constructor, namespace or type '%s' is not defined. - (Originally from ../FSComp.txt:8) + (Originally from ..\FSComp.txt:8) The type parameter %s is not defined. - (Originally from ../FSComp.txt:17) + (Originally from ..\FSComp.txt:17) The type '%s' is not defined in '%s'. - (Originally from ../FSComp.txt:13) + (Originally from ..\FSComp.txt:13) The type '%s' is not defined. - (Originally from ../FSComp.txt:12) + (Originally from ..\FSComp.txt:12) Maybe you want one of the following: - (Originally from ../FSComp.txt:16) + (Originally from ..\FSComp.txt:16) The record label or namespace '%s' is not defined. - (Originally from ../FSComp.txt:14) + (Originally from ..\FSComp.txt:14) The record label '%s' is not defined. - (Originally from ../FSComp.txt:15) + (Originally from ..\FSComp.txt:15) The pattern discriminator '%s' is not defined. - (Originally from ../FSComp.txt:18) + (Originally from ..\FSComp.txt:18) The namespace or module '%s' is not defined. - (Originally from ../FSComp.txt:5) + (Originally from ..\FSComp.txt:5) The namespace '%s' is not defined. - (Originally from ../FSComp.txt:4) + (Originally from ..\FSComp.txt:4) The type '%s' does not define the field, constructor or member '%s'. - (Originally from ../FSComp.txt:7) + (Originally from ..\FSComp.txt:7) The field, constructor or member '%s' is not defined. - (Originally from ../FSComp.txt:6) + (Originally from ..\FSComp.txt:6) The constructor, module or namespace '%s' is not defined. - (Originally from ../FSComp.txt:11) + (Originally from ..\FSComp.txt:11) The type '%s' implements 'System.IComparable'. Consider also adding an explicit override for 'Object.Equals' - (Originally from ../FSComp.txt:170) + (Originally from ..\FSComp.txt:173) The type '%s' implements 'System.IComparable' explicitly but provides no corresponding override for 'Object.Equals'. An implementation of 'Object.Equals' has been automatically provided, implemented via 'System.IComparable'. Consider implementing the override 'Object.Equals' explicitly - (Originally from ../FSComp.txt:171) + (Originally from ..\FSComp.txt:174) The signature and implementation are not compatible because the respective type parameter counts differ - (Originally from ../FSComp.txt:166) + (Originally from ..\FSComp.txt:169) The signature and implementation are not compatible because the type parameter '%s' has a constraint of the form %s but the implementation does not. Either remove this constraint from the signature or add it to the implementation. - (Originally from ../FSComp.txt:169) + (Originally from ..\FSComp.txt:172) The signature and implementation are not compatible because the declaration of the type parameter '%s' requires a constraint of the form %s - (Originally from ../FSComp.txt:168) + (Originally from ..\FSComp.txt:171) The signature and implementation are not compatible because the type parameter in the class/signature has a different compile-time requirement to the one in the member/implementation - (Originally from ../FSComp.txt:167) + (Originally from ..\FSComp.txt:170) The override for '%s' was ambiguous - (Originally from ../FSComp.txt:186) + (Originally from ..\FSComp.txt:189) The override '%s' implements more than one abstract slot, e.g. '%s' and '%s' - (Originally from ../FSComp.txt:189) + (Originally from ..\FSComp.txt:192) No implementations of '%s' had the correct number of arguments and type parameters. The required signature is '%s'. - (Originally from ../FSComp.txt:185) + (Originally from ..\FSComp.txt:188) No implementation was given for '%s'. Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - (Originally from ../FSComp.txt:194) + (Originally from ..\FSComp.txt:197) No implementation was given for those members: %sNote that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - (Originally from ../FSComp.txt:196) + (Originally from ..\FSComp.txt:199) No implementation was given for those members (some results omitted): %sNote that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - (Originally from ../FSComp.txt:198) + (Originally from ..\FSComp.txt:201) No implementation was given for those members (some results omitted): %s - (Originally from ../FSComp.txt:197) + (Originally from ..\FSComp.txt:200) No implementation was given for those members: %s - (Originally from ../FSComp.txt:195) + (Originally from ..\FSComp.txt:198) No implementation was given for '%s' - (Originally from ../FSComp.txt:193) + (Originally from ..\FSComp.txt:196) The interface '%s' is included in multiple explicitly implemented interface types. Add an explicit implementation of this interface. - (Originally from ../FSComp.txt:191) + (Originally from ..\FSComp.txt:194) The named argument '%s' has been assigned more than one value - (Originally from ../FSComp.txt:192) + (Originally from ..\FSComp.txt:195) More than one override implements '%s' - (Originally from ../FSComp.txt:187) + (Originally from ..\FSComp.txt:190) The namespace or module attributes differ between signature and implementation - (Originally from ../FSComp.txt:183) + (Originally from ..\FSComp.txt:186) The method '%s' is sealed and cannot be overridden - (Originally from ../FSComp.txt:188) + (Originally from ..\FSComp.txt:191) This method is over-constrained in its type parameters - (Originally from ../FSComp.txt:184) + (Originally from ..\FSComp.txt:187) The member '%s' matches multiple overloads of the same method.\nPlease restrict it to one of the following:%s. - (Originally from ../FSComp.txt:1368) + (Originally from ..\FSComp.txt:1385) The member '%s' does not have the correct number of method type parameters. The required signature is '%s'. - (Originally from ../FSComp.txt:200) + (Originally from ..\FSComp.txt:203) The member '%s' does not have the correct number of arguments. The required signature is '%s'. - (Originally from ../FSComp.txt:199) + (Originally from ..\FSComp.txt:202) The member '%s' does not have the correct kinds of generic parameters. The required signature is '%s'. - (Originally from ../FSComp.txt:201) + (Originally from ..\FSComp.txt:204) The member '%s' cannot be used to implement '%s'. The required signature is '%s'. - (Originally from ../FSComp.txt:202) + (Originally from ..\FSComp.txt:205) Invalid value - (Originally from ../FSComp.txt:165) + (Originally from ..\FSComp.txt:168) You cannot implement the interface '%s' with the two instantiations '%s' and '%s' because they may unify. - (Originally from ../FSComp.txt:1530) + (Originally from ..\FSComp.txt:1556) '%s' cannot implement the interface '%s' with the two instantiations '%s' and '%s' because they may unify. - (Originally from ../FSComp.txt:1529) + (Originally from ..\FSComp.txt:1555) Interface member '%s' does not have a most specific implementation. - (Originally from ../FSComp.txt:1503) + (Originally from ..\FSComp.txt:1522) The struct, record or union type '%s' has an explicit implementation of 'Object.GetHashCode' or 'Object.Equals'. You must apply the 'CustomEquality' attribute to the type - (Originally from ../FSComp.txt:172) + (Originally from ..\FSComp.txt:175) The struct, record or union type '%s' has an explicit implementation of 'Object.GetHashCode'. Consider implementing a matching override for 'Object.Equals(obj)' - (Originally from ../FSComp.txt:173) + (Originally from ..\FSComp.txt:176) The struct, record or union type '%s' has an explicit implementation of 'Object.Equals'. Consider implementing a matching override for 'Object.GetHashCode()' - (Originally from ../FSComp.txt:174) + (Originally from ..\FSComp.txt:177) Duplicate or redundant interface - (Originally from ../FSComp.txt:190) + (Originally from ..\FSComp.txt:193) The implicit instantiation of a generic construct at or near this point could not be resolved because it could resolve to multiple unrelated types, e.g. '%s' and '%s'. Consider using type annotations to resolve the ambiguity - (Originally from ../FSComp.txt:161) + (Originally from ..\FSComp.txt:164) Could not resolve the ambiguity in the use of a generic construct with an 'unmanaged' constraint at or near this position - (Originally from ../FSComp.txt:1076) + (Originally from ..\FSComp.txt:1079) Could not resolve the ambiguity inherent in the use of a 'printf'-style format string - (Originally from ../FSComp.txt:162) + (Originally from ..\FSComp.txt:165) Could not resolve the ambiguity in the use of a generic construct with an 'enum' constraint at or near this position - (Originally from ../FSComp.txt:163) + (Originally from ..\FSComp.txt:166) Could not resolve the ambiguity in the use of a generic construct with a 'delegate' constraint at or near this position - (Originally from ../FSComp.txt:164) + (Originally from ..\FSComp.txt:167) The type '%s' is not accessible from this code location - (Originally from ../FSComp.txt:960) + (Originally from ..\FSComp.txt:963) union case - (Originally from ../FSComp.txt:935) + (Originally from ..\FSComp.txt:938) property - (Originally from ../FSComp.txt:940) + (Originally from ..\FSComp.txt:943) patvar - (Originally from ../FSComp.txt:945) + (Originally from ..\FSComp.txt:948) and %d other overloads - (Originally from ../FSComp.txt:934) + (Originally from ..\FSComp.txt:937) namespace/module - (Originally from ../FSComp.txt:948) + (Originally from ..\FSComp.txt:951) namespace - (Originally from ../FSComp.txt:946) + (Originally from ..\FSComp.txt:949) module - (Originally from ../FSComp.txt:947) + (Originally from ..\FSComp.txt:950) generated type - (Originally from ../FSComp.txt:952) + (Originally from ..\FSComp.txt:955) generated property - (Originally from ../FSComp.txt:951) + (Originally from ..\FSComp.txt:954) Full name - (Originally from ../FSComp.txt:930) + (Originally from ..\FSComp.txt:933) also from %s - (Originally from ../FSComp.txt:950) + (Originally from ..\FSComp.txt:953) from %s - (Originally from ../FSComp.txt:949) + (Originally from ..\FSComp.txt:952) field - (Originally from ../FSComp.txt:938) + (Originally from ..\FSComp.txt:941) extension - (Originally from ../FSComp.txt:941) + (Originally from ..\FSComp.txt:944) event - (Originally from ../FSComp.txt:939) + (Originally from ..\FSComp.txt:942) custom operation - (Originally from ../FSComp.txt:942) + (Originally from ..\FSComp.txt:945) Calls - (Originally from ../FSComp.txt:1272) + (Originally from ..\FSComp.txt:1289) argument - (Originally from ../FSComp.txt:943) + (Originally from ..\FSComp.txt:946) anonymous record field - (Originally from ../FSComp.txt:944) + (Originally from ..\FSComp.txt:947) active recognizer - (Originally from ../FSComp.txt:937) + (Originally from ..\FSComp.txt:940) active pattern result - (Originally from ../FSComp.txt:936) + (Originally from ..\FSComp.txt:939) \nA tuple type is required for one or more arguments. Consider wrapping the given arguments in additional parentheses or review the definition of the interface. - (Originally from ../FSComp.txt:33) + (Originally from ..\FSComp.txt:33) The specified .NET Framework version '%s' is not supported. Please specify a value from the enumeration Microsoft.Build.Utilities.TargetDotNetFrameworkVersion. - (Originally from ../FSComp.txt:1117) + (Originally from ..\FSComp.txt:1128) Unexpected Expr.TyChoose - (Originally from ../FSComp.txt:970) + (Originally from ..\FSComp.txt:973) Note: Lambda-lifting optimizations have not been applied because of the use of this local constrained generic function as a first class value. Adding type constraints may resolve this condition. - (Originally from ../FSComp.txt:971) + (Originally from ..\FSComp.txt:974) The 'VolatileField' attribute may only be used on 'let' bindings in classes - (Originally from ../FSComp.txt:668) + (Originally from ..\FSComp.txt:671) Volatile fields must be marked 'mutable' and cannot be thread-static - (Originally from ../FSComp.txt:723) + (Originally from ..\FSComp.txt:726) A declaration may only be given a value in a signature if the declaration has the [<Literal>] attribute - (Originally from ../FSComp.txt:721) + (Originally from ..\FSComp.txt:724) In sequence expressions, multiple results are generated using 'yield!' - (Originally from ../FSComp.txt:643) + (Originally from ..\FSComp.txt:646) Character range matches have been removed in F#. Consider using a 'when' pattern guard instead. - (Originally from ../FSComp.txt:576) + (Originally from ..\FSComp.txt:579) 'use' expressions may not be used in queries - (Originally from ../FSComp.txt:1289) + (Originally from ..\FSComp.txt:1306) The use of 'let! x = coll' in sequence expressions is not permitted. Use 'for x in coll' instead. - (Originally from ../FSComp.txt:641) + (Originally from ..\FSComp.txt:644) This declaration is not supported in recursive declaration groups - (Originally from ../FSComp.txt:1358) + (Originally from ..\FSComp.txt:1375) This attribute cannot be used in this version of F# - (Originally from ../FSComp.txt:695) + (Originally from ..\FSComp.txt:698) This is not a known query operator. Query operators are identifiers such as 'select', 'where', 'sortBy', 'thenBy', 'groupBy', 'groupValBy', 'join', 'groupJoin', 'sumBy' and 'averageBy', defined using corresponding methods on the 'QueryBuilder' type. - (Originally from ../FSComp.txt:1292) + (Originally from ..\FSComp.txt:1309) Arguments to query operators may require parentheses, e.g. 'where (x > y)' or 'groupBy (x.Length / 10)' - (Originally from ../FSComp.txt:1300) + (Originally from ..\FSComp.txt:1317) Unrecognized attribute target. Valid attribute targets are 'assembly', 'module', 'type', 'method', 'property', 'return', 'param', 'field', 'event', 'constructor'. - (Originally from ../FSComp.txt:685) + (Originally from ..\FSComp.txt:688) The unnamed arguments do not form a prefix of the arguments of the method called - (Originally from ../FSComp.txt:662) + (Originally from ..\FSComp.txt:665) Unknown union case - (Originally from ../FSComp.txt:515) + (Originally from ..\FSComp.txt:518) Unit-of-measure cannot be used in type constructor application - (Originally from ../FSComp.txt:552) + (Originally from ..\FSComp.txt:555) This union case takes one argument - (Originally from ../FSComp.txt:570) + (Originally from ..\FSComp.txt:573) The union case named '%s' conflicts with the generated type '%s' - (Originally from ../FSComp.txt:1097) + (Originally from ..\FSComp.txt:1108) Union case/exception field '%s' cannot be used more than once. - (Originally from ../FSComp.txt:1327) + (Originally from ..\FSComp.txt:1344) This union case expects %d arguments in tupled form - (Originally from ../FSComp.txt:571) + (Originally from ..\FSComp.txt:574) This union case does not take arguments - (Originally from ../FSComp.txt:569) + (Originally from ..\FSComp.txt:572) The union case '%s' does not have a field named '%s'. - (Originally from ../FSComp.txt:1323) + (Originally from ..\FSComp.txt:1340) Uninitialized 'val' fields must be mutable and marked with the '[<DefaultValue>]' attribute. Consider using a 'let' binding instead of a 'val' field. - (Originally from ../FSComp.txt:724) + (Originally from ..\FSComp.txt:727) Unexpected type arguments - (Originally from ../FSComp.txt:561) + (Originally from ..\FSComp.txt:564) Unexpected %s in type expression - (Originally from ../FSComp.txt:555) + (Originally from ..\FSComp.txt:558) Unexpected / in type - (Originally from ../FSComp.txt:560) + (Originally from ..\FSComp.txt:563) Unexpected source-level property specification - (Originally from ../FSComp.txt:526) + (Originally from ..\FSComp.txt:529) Unexpected source-level property specification in syntax tree - (Originally from ../FSComp.txt:520) + (Originally from ..\FSComp.txt:523) Unexpected SynMeasure.Anon - (Originally from ../FSComp.txt:476) + (Originally from ..\FSComp.txt:479) Unexpected expression at recursive inference point - (Originally from ../FSComp.txt:505) + (Originally from ..\FSComp.txt:508) Unexpected Const_uint16array - (Originally from ../FSComp.txt:481) + (Originally from ..\FSComp.txt:484) Unexpected Const_bytearray - (Originally from ../FSComp.txt:482) + (Originally from ..\FSComp.txt:485) Unexpected condition in imported assembly: failed to decode AttributeUsage attribute - (Originally from ../FSComp.txt:684) + (Originally from ..\FSComp.txt:687) Unexpected big rational constant - (Originally from ../FSComp.txt:479) + (Originally from ..\FSComp.txt:482) The field '%s' has been given a value, but is not present in the type '%s' - (Originally from ../FSComp.txt:608) + (Originally from ..\FSComp.txt:611) Invalid interpolated string. %s - (Originally from ../FSComp.txt:1542) + (Originally from ..\FSComp.txt:1582) Unable to parse format string '%s' - (Originally from ../FSComp.txt:586) + (Originally from ..\FSComp.txt:589) Types cannot inherit from multiple concrete types - (Originally from ../FSComp.txt:774) + (Originally from ..\FSComp.txt:777) Types cannot contain nested type definitions - (Originally from ../FSComp.txt:754) + (Originally from ..\FSComp.txt:757) Struct types are always sealed - (Originally from ../FSComp.txt:786) + (Originally from ..\FSComp.txt:789) Record types are always sealed - (Originally from ../FSComp.txt:784) + (Originally from ..\FSComp.txt:787) Enum types are always sealed - (Originally from ../FSComp.txt:788) + (Originally from ..\FSComp.txt:791) Delegate types are always sealed - (Originally from ../FSComp.txt:787) + (Originally from ..\FSComp.txt:790) Discriminated union types are always sealed - (Originally from ../FSComp.txt:783) + (Originally from ..\FSComp.txt:786) Assembly code types are always sealed - (Originally from ../FSComp.txt:785) + (Originally from ..\FSComp.txt:788) The type '%s' is used in an invalid way. A value prior to '%s' has an inferred type involving '%s', which is an invalid forward reference. - (Originally from ../FSComp.txt:811) + (Originally from ..\FSComp.txt:814) This type test or downcast will erase the provided type '%s' to the type '%s' - (Originally from ../FSComp.txt:1208) + (Originally from ..\FSComp.txt:1219) This type test or downcast will ignore the unit-of-measure '%s' - (Originally from ../FSComp.txt:1108) + (Originally from ..\FSComp.txt:1119) This type test with a provided type '%s' is not allowed because this provided type will be erased to '%s' at runtime. - (Originally from ../FSComp.txt:1210) + (Originally from ..\FSComp.txt:1221) This type requires a definition - (Originally from ../FSComp.txt:771) + (Originally from ..\FSComp.txt:774) The type parameters inferred for this value are not stable under the erasure of type abbreviations. This is due to the use of type abbreviations which drop or reorder type parameters, e.g. \n\ttype taggedInt<'a> = int or\n\ttype swap<'a,'b> = 'b * 'a.\nConsider declaring the type parameters for this value explicitly, e.g.\n\tlet f<'a,'b> ((x,y) : swap<'b,'a>) : swap<'a,'b> = (y,x). - (Originally from ../FSComp.txt:510) + (Originally from ..\FSComp.txt:513) Type parameter cannot be used as type constructor - (Originally from ../FSComp.txt:556) + (Originally from ..\FSComp.txt:559) This type parameter has been used in a way that constrains it to always be '%s' - (Originally from ../FSComp.txt:509) + (Originally from ..\FSComp.txt:512) This value, type or method expects %d type parameter(s) but was given %d - (Originally from ../FSComp.txt:532) + (Originally from ..\FSComp.txt:535) type or module - (Originally from ../FSComp.txt:756) + (Originally from ..\FSComp.txt:759) The type '%s' is not an interface type - (Originally from ../FSComp.txt:731) + (Originally from ..\FSComp.txt:734) This type is not an interface type - (Originally from ../FSComp.txt:749) + (Originally from ..\FSComp.txt:752) This type is not a record type. Values of class and struct types must be created using calls to object constructors. - (Originally from ../FSComp.txt:636) + (Originally from ..\FSComp.txt:639) This type is not a record type - (Originally from ../FSComp.txt:637) + (Originally from ..\FSComp.txt:640) This type is not accessible from this code location - (Originally from ../FSComp.txt:683) + (Originally from ..\FSComp.txt:686) This type has no nested types - (Originally from ../FSComp.txt:554) + (Originally from ..\FSComp.txt:557) This type has no accessible object constructors - (Originally from ../FSComp.txt:646) + (Originally from ..\FSComp.txt:649) type, exception or module - (Originally from ../FSComp.txt:755) + (Originally from ..\FSComp.txt:758) This type does not inherit Attribute, it will not work correctly with other .NET languages. - (Originally from ../FSComp.txt:1484) + (Originally from ..\FSComp.txt:1503) Type definitions may only have one 'inherit' specification and it must be the first declaration - (Originally from ../FSComp.txt:804) + (Originally from ..\FSComp.txt:807) 'let' and 'do' bindings must come before member and interface definitions in type definitions - (Originally from ../FSComp.txt:805) + (Originally from ..\FSComp.txt:808) This type definition involves an immediate cyclic reference through a struct field or inheritance relation - (Originally from ../FSComp.txt:800) + (Originally from ..\FSComp.txt:803) This type definition involves an immediate cyclic reference through an abbreviation - (Originally from ../FSComp.txt:799) + (Originally from ..\FSComp.txt:802) This downcast will erase the provided type '%s' to the type '%s'. - (Originally from ../FSComp.txt:1209) + (Originally from ..\FSComp.txt:1220) The type '%s' is not a type whose values can be enumerated with this syntax, i.e. is not compatible with either seq<_>, IEnumerable<_> or IEnumerable and does not have a GetEnumerator method - (Originally from ../FSComp.txt:539) + (Originally from ..\FSComp.txt:542) Type abbreviations cannot have members - (Originally from ../FSComp.txt:738) + (Originally from ..\FSComp.txt:741) As of F# 4.1, the accessibility of type abbreviations is checked at compile-time. Consider changing the accessibility of the type abbreviation. Ignoring this warning might lead to runtime errors. - (Originally from ../FSComp.txt:739) + (Originally from ..\FSComp.txt:742) Type abbreviations cannot have interface declarations - (Originally from ../FSComp.txt:747) + (Originally from ..\FSComp.txt:750) Type abbreviations cannot have augmentations - (Originally from ../FSComp.txt:809) + (Originally from ..\FSComp.txt:812) This type abbreviation has one or more declared type parameters that do not appear in the type being abbreviated. Type abbreviations must use all declared type parameters in the type being abbreviated. Consider removing one or more type parameters, or use a concrete type definition that wraps an underlying type, such as 'type C<'a> = C of ...'. - (Originally from ../FSComp.txt:772) + (Originally from ..\FSComp.txt:775) One tuple type is a struct tuple, the other is a reference tuple - (Originally from ../FSComp.txt:1351) + (Originally from ..\FSComp.txt:1368) This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. - (Originally from ../FSComp.txt:1464) + (Originally from ..\FSComp.txt:1483) 'try/with' expressions may not be used in queries - (Originally from ../FSComp.txt:1293) + (Originally from ..\FSComp.txt:1310) 'try'/'with' cannot be used within sequence expressions - (Originally from ../FSComp.txt:642) + (Originally from ..\FSComp.txt:645) Thread-static and context-static variables must be static and given the [<DefaultValue>] attribute to indicate that the value is initialized to the default value on each new thread - (Originally from ../FSComp.txt:722) + (Originally from ..\FSComp.txt:725) This member, function or value declaration may not be declared 'inline' - (Originally from ../FSComp.txt:1298) + (Originally from ..\FSComp.txt:1315) This type definition may not have the 'CLIMutable' attribute. Only record types may have this attribute. - (Originally from ../FSComp.txt:1280) + (Originally from ..\FSComp.txt:1297) Invalid provided field. Provided fields of erased provided types must be literals. - (Originally from ../FSComp.txt:1309) + (Originally from ..\FSComp.txt:1326) The syntax 'expr.id' may only be used with record labels, properties and fields - (Originally from ../FSComp.txt:657) + (Originally from ..\FSComp.txt:660) Syntax error - unexpected '?' symbol - (Originally from ../FSComp.txt:578) + (Originally from ..\FSComp.txt:581) '%s' may only be used to construct object types - (Originally from ../FSComp.txt:606) + (Originally from ..\FSComp.txt:609) + + + + + This expression implicitly converts type '%s' to type '%s'. See https://aka.ms/fsharp-implicit-convs. + (Originally from ..\FSComp.txt:1595) The struct, record or union type '%s' has the 'StructuralEquality' attribute but the component type '%s' does not satisfy the 'equality' constraint - (Originally from ../FSComp.txt:1054) + (Originally from ..\FSComp.txt:1057) The struct, record or union type '%s' has the 'StructuralEquality' attribute but the type parameter '%s' does not satisfy the 'equality' constraint. Consider adding the 'equality' constraint to the type parameter - (Originally from ../FSComp.txt:1053) + (Originally from ..\FSComp.txt:1056) The struct, record or union type '%s' has the 'StructuralComparison' attribute but the component type '%s' does not satisfy the 'comparison' constraint - (Originally from ../FSComp.txt:1048) + (Originally from ..\FSComp.txt:1051) The struct, record or union type '%s' has the 'StructuralComparison' attribute but the type parameter '%s' does not satisfy the 'comparison' constraint. Consider adding the 'comparison' constraint to the type parameter - (Originally from ../FSComp.txt:1047) + (Originally from ..\FSComp.txt:1050) Each argument of the primary constructor for a struct must be given a type, for example 'type S(x1:int, x2: int) = ...'. These arguments determine the fields of the struct. - (Originally from ../FSComp.txt:1055) + (Originally from ..\FSComp.txt:1058) Structs cannot contain value definitions because the default constructor for structs will not execute these bindings. Consider adding additional arguments to the primary constructor for the type. - (Originally from ../FSComp.txt:743) + (Originally from ..\FSComp.txt:746) Structs cannot contain 'do' bindings because the default constructor for structs would not execute these bindings - (Originally from ../FSComp.txt:742) + (Originally from ..\FSComp.txt:745) Structs, interfaces, enums and delegates cannot inherit from other types - (Originally from ../FSComp.txt:773) + (Originally from ..\FSComp.txt:776) Structs cannot have an object constructor with no arguments. This is a restriction imposed on all CLI languages as structs automatically support a default constructor. - (Originally from ../FSComp.txt:714) + (Originally from ..\FSComp.txt:717) Structs may only bind a 'this' parameter at member declarations - (Originally from ../FSComp.txt:504) + (Originally from ..\FSComp.txt:507) If a union type has more than one case and is a struct, then all fields within the union type must be given unique names. - (Originally from ../FSComp.txt:1360) + (Originally from ..\FSComp.txt:1377) Struct types cannot contain abstract members - (Originally from ../FSComp.txt:793) + (Originally from ..\FSComp.txt:796) Static 'val' fields in types must be mutable, private and marked with the '[<DefaultValue>]' attribute. They are initialized to the 'null' or 'zero' value for their type. Consider also using a 'static let mutable' binding in a class type. - (Originally from ../FSComp.txt:725) + (Originally from ..\FSComp.txt:728) Static optimization conditionals are only for use within the F# library - (Originally from ../FSComp.txt:663) + (Originally from ..\FSComp.txt:666) This static member should not have a 'this' parameter. Consider using the notation 'member Member(args) = ...'. - (Originally from ../FSComp.txt:523) + (Originally from ..\FSComp.txt:526) Static value definitions may only be used in types with a primary constructor. Consider adding arguments to the type definition, e.g. 'type X(args) = ...'. - (Originally from ../FSComp.txt:744) + (Originally from ..\FSComp.txt:747) Interfaces cannot contain definitions of static initializers - (Originally from ../FSComp.txt:709) + (Originally from ..\FSComp.txt:712) A static initializer requires an argument - (Originally from ../FSComp.txt:521) + (Originally from ..\FSComp.txt:524) A static field was used where an instance field is expected - (Originally from ../FSComp.txt:472) + (Originally from ..\FSComp.txt:475) A simple method name is required here - (Originally from ../FSComp.txt:616) + (Originally from ..\FSComp.txt:619) In sequence expressions, results are generated using 'yield' - (Originally from ../FSComp.txt:478) + (Originally from ..\FSComp.txt:481) Array method '%s' is supplied by the runtime and cannot be directly used in code. For operations with array elements consider using family of GetArray/SetArray functions from LanguagePrimitives.IntrinsicFunctions module. - (Originally from ../FSComp.txt:1322) + (Originally from ..\FSComp.txt:1339) Return values cannot have names - (Originally from ../FSComp.txt:484) + (Originally from ..\FSComp.txt:487) Return types of union cases must be identical to the type being defined, up to abbreviations - (Originally from ../FSComp.txt:729) + (Originally from ..\FSComp.txt:732) 'return' and 'return!' may not be used in queries - (Originally from ../FSComp.txt:1291) + (Originally from ..\FSComp.txt:1308) + + + + + Using resumable code or resumable state machines requires /langversion:preview + (Originally from ..\FSComp.txt:1617) + + + + + Resumable code invocation. Suppress this warning if you are defining new low-level resumable code in terms of existing resumable code. + (Originally from ..\FSComp.txt:1621) + + + + + Invalid resumable code. Any method of function accepting or returning resumable code must be marked 'inline' + (Originally from ..\FSComp.txt:1613) + + + + + Invalid resumable code. A 'let rec' occured in the resumable code specification + (Originally from ..\FSComp.txt:1616) + + + + + Invalid resumable code. Resumable code parameter must have name beginning with '__expand' + (Originally from ..\FSComp.txt:1614) + + + + + Invalid resumable code. A resumable code parameter must be of delegate or function type + (Originally from ..\FSComp.txt:1615) The syntax 'type X with ...' is reserved for augmentations. Types whose representations are hidden but which have members are now declared in signatures using 'type X = ...'. You may also need to add the '[<Sealed>] attribute to the type definition in the signature - (Originally from ../FSComp.txt:801) + (Originally from ..\FSComp.txt:804) This is not a variable, constant, active recognizer or literal - (Originally from ../FSComp.txt:574) + (Originally from ..\FSComp.txt:577) The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '%s' method or appropriate 'MergeSource' and 'Bind' methods - (Originally from ../FSComp.txt:1498) + (Originally from ..\FSComp.txt:1517) This control construct may only be used if the computation expression builder defines a '%s' method - (Originally from ../FSComp.txt:553) + (Originally from ..\FSComp.txt:556) Only active patterns returning exactly one result may accept arguments - (Originally from ../FSComp.txt:566) + (Originally from ..\FSComp.txt:569) The representation of this type is hidden by the signature. It must be given an attribute such as [<Sealed>], [<Class>] or [<Interface>] to indicate the characteristics of the type. - (Originally from ../FSComp.txt:779) + (Originally from ..\FSComp.txt:782) Recursive bindings that include member specifications can only occur as a direct augmentation of a type - (Originally from ../FSComp.txt:716) + (Originally from ..\FSComp.txt:719) Records, union, abbreviations and struct types cannot have the 'AllowNullLiteral' attribute - (Originally from ../FSComp.txt:775) + (Originally from ..\FSComp.txt:778) This record contains fields from inconsistent types - (Originally from ../FSComp.txt:502) + (Originally from ..\FSComp.txt:505) The 'rec' on this module is implied by an outer 'rec' declaration and is being ignored - (Originally from ../FSComp.txt:1355) + (Originally from ..\FSComp.txt:1372) A property cannot have explicit type parameters. Consider using a method instead. - (Originally from ../FSComp.txt:517) + (Originally from ..\FSComp.txt:520) This property or field was not found on this custom attribute type - (Originally from ../FSComp.txt:690) + (Originally from ..\FSComp.txt:693) Property '%s' is static - (Originally from ../FSComp.txt:654) + (Originally from ..\FSComp.txt:657) Property '%s' is not static - (Originally from ../FSComp.txt:651) + (Originally from ..\FSComp.txt:654) Property '%s' is not readable - (Originally from ../FSComp.txt:652) + (Originally from ..\FSComp.txt:655) Property '%s' cannot be set - (Originally from ../FSComp.txt:655) + (Originally from ..\FSComp.txt:658) This property cannot be set - (Originally from ../FSComp.txt:689) + (Originally from ..\FSComp.txt:692) The types System.ValueType, System.Enum, System.Delegate, System.MulticastDelegate and System.Array cannot be used as super types in an object expression or class - (Originally from ../FSComp.txt:617) + (Originally from ..\FSComp.txt:620) + + + + + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + (Originally from ..\FSComp.txt:1564) + + + + + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + (Originally from ..\FSComp.txt:1567) A parameter with attributes must also be given a name, e.g. '[<Attribute>] Name : Type' - (Originally from ../FSComp.txt:483) + (Originally from ..\FSComp.txt:486) The parameter '%s' was inferred to have byref type. Parameters of byref type must be given an explicit type annotation, e.g. 'x1: byref<int>'. When used, a byref parameter is implicitly dereferenced. - (Originally from ../FSComp.txt:1072) + (Originally from ..\FSComp.txt:1075) You must explicitly declare either all or no type parameters when overriding a generic abstract method - (Originally from ../FSComp.txt:512) + (Originally from ..\FSComp.txt:515) Accessibility modifiers are not permitted on overrides or interface implementations - (Originally from ../FSComp.txt:782) + (Originally from ..\FSComp.txt:785) This override takes a different number of arguments to the corresponding abstract member. The following abstract members were found:%s - (Originally from ../FSComp.txt:701) + (Originally from ..\FSComp.txt:704) One or more of the overloads of this method has curried arguments. Consider redesigning these members to take arguments in tupled form. - (Originally from ../FSComp.txt:661) + (Originally from ..\FSComp.txt:664) + + + + + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + (Originally from ..\FSComp.txt:1566) + + + + + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + (Originally from ..\FSComp.txt:1569) Optional arguments cannot be used in custom attributes - (Originally from ../FSComp.txt:688) + (Originally from ..\FSComp.txt:691) Optional arguments are only permitted on type members - (Originally from ../FSComp.txt:562) + (Originally from ..\FSComp.txt:565) Optional arguments must come at the end of the argument list, after any non-optional arguments - (Originally from ../FSComp.txt:1090) + (Originally from ..\FSComp.txt:1101) '%s' must be followed by 'in'. Usage: %s. - (Originally from ../FSComp.txt:1316) + (Originally from ..\FSComp.txt:1333) Incorrect syntax for '%s'. Usage: %s. - (Originally from ../FSComp.txt:1244) + (Originally from ..\FSComp.txt:1261) The operator '%s' does not accept the use of 'into' - (Originally from ../FSComp.txt:1278) + (Originally from ..\FSComp.txt:1295) This declaration opens the namespace or module '%s' through a partially qualified path. Adjust this code to use the full path of the namespace. This change will make your code more robust as new constructs are added to the F# and CLI libraries. - (Originally from ../FSComp.txt:736) + (Originally from ..\FSComp.txt:739) In a recursive declaration group, 'open' declarations must come first in each module - (Originally from ../FSComp.txt:1356) + (Originally from ..\FSComp.txt:1373) Only types representing units-of-measure may be given the 'Measure' attribute - (Originally from ../FSComp.txt:781) + (Originally from ..\FSComp.txt:784) Only structs and classes without primary constructors may be given the 'StructLayout' attribute - (Originally from ../FSComp.txt:778) + (Originally from ..\FSComp.txt:781) Only simple variable patterns can be bound in 'let rec' constructs - (Originally from ../FSComp.txt:717) + (Originally from ..\FSComp.txt:720) Only simple bindings of the form 'id = expr' can be used in construction expressions - (Originally from ../FSComp.txt:623) + (Originally from ..\FSComp.txt:626) Mutable 'let' bindings can't be recursive or defined in recursive modules or namespaces - (Originally from ../FSComp.txt:718) + (Originally from ..\FSComp.txt:721) Only functions may be marked 'inline' - (Originally from ../FSComp.txt:677) + (Originally from ..\FSComp.txt:680) Only classes may be given the 'AbstractClass' attribute - (Originally from ../FSComp.txt:780) + (Originally from ..\FSComp.txt:783) Objects must be initialized by an object construction expression that calls an inherited object constructor and assigns a value to each field - (Originally from ../FSComp.txt:624) + (Originally from ..\FSComp.txt:627) The operator 'expr.[idx]' has been used on an object of indeterminate type based on information prior to this program point. Consider adding further type constraints - (Originally from ../FSComp.txt:597) + (Originally from ..\FSComp.txt:600) Only overrides of abstract and virtual members may be specified in object expressions - (Originally from ../FSComp.txt:611) + (Originally from ..\FSComp.txt:614) This form of object expression is not used in F#. Use 'member this.MemberName ... = ...' to define member implementations in object expressions. - (Originally from ../FSComp.txt:527) + (Originally from ..\FSComp.txt:530) Calls to object constructors on type parameters cannot be given arguments - (Originally from ../FSComp.txt:599) + (Originally from ..\FSComp.txt:602) Interfaces cannot contain definitions of object constructors - (Originally from ../FSComp.txt:710) + (Originally from ..\FSComp.txt:713) An object constructor requires an argument - (Originally from ../FSComp.txt:522) + (Originally from ..\FSComp.txt:525) Object construction expressions (i.e. record expressions with inheritance specifications) may only be used to implement constructors in object model types. Use 'new ObjectType(args)' to construct instances of object model types outside of constructors - (Originally from ../FSComp.txt:634) + (Originally from ..\FSComp.txt:637) Object construction expressions may only be used to implement constructors in class types - (Originally from ../FSComp.txt:622) + (Originally from ..\FSComp.txt:625) This numeric literal requires that a module '%s' defining functions FromZero, FromOne, FromInt32, FromInt64 and FromString be in scope - (Originally from ../FSComp.txt:630) + (Originally from ..\FSComp.txt:633) This is not a valid name for an enumeration case - (Originally from ../FSComp.txt:590) + (Originally from ..\FSComp.txt:593) This code is not sufficiently generic. The type variable %s could not be generalized because it would escape its scope. - (Originally from ../FSComp.txt:516) + (Originally from ..\FSComp.txt:519) + + + + + The value '%s' is not a function and does not support index notation. + (Originally from ..\FSComp.txt:1553) + + + + + This expression is not a function and does not support index notation. + (Originally from ..\FSComp.txt:1554) Not an exception - (Originally from ../FSComp.txt:764) + (Originally from ..\FSComp.txt:767) + + + + + This value supports indexing, e.g. '%s.[index]'. The syntax '%s[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + (Originally from ..\FSComp.txt:1551) + + + + + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + (Originally from ..\FSComp.txt:1552) Non-zero constants cannot have generic units. For generic zero, write 0.0<_>. - (Originally from ../FSComp.txt:477) + (Originally from ..\FSComp.txt:480) The generic member '%s' has been used at a non-uniform instantiation prior to this program point. Consider reordering the members so this member occurs first. Alternatively, specify the full type of the member explicitly, including argument types, return type and any additional generic parameters and constraints. - (Originally from ../FSComp.txt:1073) + (Originally from ..\FSComp.txt:1076) This 'let' definition may not be used in a query. Only simple value definitions may be used in queries. - (Originally from ../FSComp.txt:1294) + (Originally from ..\FSComp.txt:1311) This value is not a literal and cannot be used in a pattern - (Originally from ../FSComp.txt:535) + (Originally from ..\FSComp.txt:538) 'while' expressions may not be used in queries - (Originally from ../FSComp.txt:1287) + (Originally from ..\FSComp.txt:1304) 'try/finally' expressions may not be used in queries - (Originally from ../FSComp.txt:1288) + (Originally from ..\FSComp.txt:1305) No abstract property was found that corresponds to this override - (Originally from ../FSComp.txt:704) + (Originally from ..\FSComp.txt:707) No abstract or interface member was found that corresponds to this override - (Originally from ../FSComp.txt:700) + (Originally from ..\FSComp.txt:703) Interface implementations cannot be given on construction expressions - (Originally from ../FSComp.txt:621) + (Originally from ..\FSComp.txt:624) In queries, use the form 'for x in n .. m do ...' for ranging over integers - (Originally from ../FSComp.txt:1286) + (Originally from ..\FSComp.txt:1303) The struct, record or union type '%s' does not support structural equality because the type '%s' does not satisfy the 'equality' constraint. Consider adding the 'NoEquality' attribute to the type '%s' to clarify that the type does not support structural equality - (Originally from ../FSComp.txt:1052) + (Originally from ..\FSComp.txt:1055) The struct, record or union type '%s' does not support structural equality because the type parameter %s does not satisfy the 'equality' constraint. Consider adding the 'NoEquality' attribute to the type '%s' to clarify that the type does not support structural equality - (Originally from ../FSComp.txt:1051) + (Originally from ..\FSComp.txt:1054) + + + + + Using methods with 'NoEagerConstraintApplicationAttribute' requires /langversion:6.0 or later + (Originally from ..\FSComp.txt:1618) The struct, record or union type '%s' is not structurally comparable because the type '%s' does not satisfy the 'comparison' constraint. Consider adding the 'NoComparison' attribute to the type '%s' to clarify that the type is not comparable - (Originally from ../FSComp.txt:1050) + (Originally from ..\FSComp.txt:1053) The struct, record or union type '%s' is not structurally comparable because the type parameter %s does not satisfy the 'comparison' constraint. Consider adding the 'NoComparison' attribute to the type '%s' to clarify that the type is not comparable - (Originally from ../FSComp.txt:1049) + (Originally from ..\FSComp.txt:1052) No arguments may be given when constructing a record value - (Originally from ../FSComp.txt:620) + (Originally from ..\FSComp.txt:623) The member '%s' does not correspond to any abstract or virtual method available to override or implement. - (Originally from ../FSComp.txt:612) + (Originally from ..\FSComp.txt:615) 'new' may only be used with object constructors - (Originally from ../FSComp.txt:628) + (Originally from ..\FSComp.txt:631) 'new' must be used with a named type - (Originally from ../FSComp.txt:618) + (Originally from ..\FSComp.txt:621) This new member hides the abstract member '%s' once tuples, functions, units of measure and/or provided types are erased. Rename the member or use 'override' instead. - (Originally from ../FSComp.txt:708) + (Originally from ..\FSComp.txt:711) This new member hides the abstract member '%s'. Rename the member or use 'override' instead. - (Originally from ../FSComp.txt:707) + (Originally from ..\FSComp.txt:710) 'new' cannot be used on interface types. Consider using an object expression '{ new ... with ... }' instead. - (Originally from ../FSComp.txt:603) + (Originally from ..\FSComp.txt:606) Namespaces cannot contain values. Consider using a module to hold your value declarations. - (Originally from ../FSComp.txt:486) + (Originally from ..\FSComp.txt:489) Namespaces cannot contain extension members except in the same file and namespace declaration group where the type is defined. Consider using a module to hold declarations of extension members. - (Originally from ../FSComp.txt:487) + (Originally from ..\FSComp.txt:490) '%s' may only be used with named types - (Originally from ../FSComp.txt:601) + (Originally from ..\FSComp.txt:604) Named arguments cannot be given to member trait calls - (Originally from ../FSComp.txt:589) + (Originally from ..\FSComp.txt:592) The named argument '%s' did not match any argument or mutable property - (Originally from ../FSComp.txt:660) + (Originally from ..\FSComp.txt:663) %s is an active pattern and cannot be treated as a discriminated union case with named fields. - (Originally from ../FSComp.txt:1365) + (Originally from ..\FSComp.txt:1382) Name '%s' not bound in pattern context - (Originally from ../FSComp.txt:563) + (Originally from ..\FSComp.txt:566) Named arguments must appear after all other arguments - (Originally from ../FSComp.txt:537) + (Originally from ..\FSComp.txt:540) Mutable function values should be written 'let mutable f = (fun args -> ...)' - (Originally from ../FSComp.txt:676) + (Originally from ..\FSComp.txt:679) Mutable values cannot have generic parameters - (Originally from ../FSComp.txt:675) + (Originally from ..\FSComp.txt:678) Mutable values cannot be marked 'inline' - (Originally from ../FSComp.txt:674) + (Originally from ..\FSComp.txt:677) Multiple visibility attributes have been specified for this identifier. 'let' bindings in classes are always private, as are any 'let' bindings inside expressions. - (Originally from ../FSComp.txt:489) + (Originally from ..\FSComp.txt:492) Multiple visibility attributes have been specified for this identifier - (Originally from ../FSComp.txt:488) + (Originally from ..\FSComp.txt:491) This declaration opens the module '%s', which is marked as 'RequireQualifiedAccess'. Adjust your code to use qualified references to the elements of the module instead, e.g. 'List.map' instead of 'map'. This change will ensure that your code is robust as new constructs are added to libraries. - (Originally from ../FSComp.txt:735) + (Originally from ..\FSComp.txt:738) The path '%s' is a namespace. A module abbreviation may not abbreviate a namespace. - (Originally from ../FSComp.txt:810) + (Originally from ..\FSComp.txt:813) In a recursive declaration group, module abbreviations must come after all 'open' declarations and before other declarations - (Originally from ../FSComp.txt:1357) + (Originally from ..\FSComp.txt:1374) A custom query operation for '%s' is required but not specified - (Originally from ../FSComp.txt:1222) + (Originally from ..\FSComp.txt:1233) Method overrides and interface implementations are not permitted here - (Originally from ../FSComp.txt:699) + (Originally from ..\FSComp.txt:702) Method '%s' is not accessible from this code location - (Originally from ../FSComp.txt:473) + (Originally from ..\FSComp.txt:476) Members that extend interface, delegate or enum types must be placed in a module separate to the definition of the type. This module must either have the AutoOpen attribute or be opened explicitly by client code to bring the extension members into scope. - (Originally from ../FSComp.txt:802) + (Originally from ..\FSComp.txt:805) The member '%s' is used in an invalid way. A use of '%s' has been inferred prior to the definition of '%s', which is an invalid forward reference. - (Originally from ../FSComp.txt:812) + (Originally from ..\FSComp.txt:815) Interfaces cannot contain definitions of member overrides - (Originally from ../FSComp.txt:711) + (Originally from ..\FSComp.txt:714) Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - (Originally from ../FSComp.txt:1093) + (Originally from ..\FSComp.txt:1104) This member is not permitted in an interface implementation - (Originally from ../FSComp.txt:752) + (Originally from ..\FSComp.txt:755) SynMemberKind.PropertyGetSet only expected in parse trees - (Originally from ../FSComp.txt:485) + (Originally from ..\FSComp.txt:488) This member is not sufficiently generic - (Originally from ../FSComp.txt:719) + (Originally from ..\FSComp.txt:722) The type %s contains the member '%s' but it is not a virtual or abstract method that is available to override or implement. - (Originally from ../FSComp.txt:613) + (Originally from ..\FSComp.txt:616) A member and a local class binding both have the name '%s' - (Originally from ../FSComp.txt:746) + (Originally from ..\FSComp.txt:749) Measure definitions cannot have type parameters - (Originally from ../FSComp.txt:770) + (Originally from ..\FSComp.txt:773) Measure declarations may have only static members: constructors are not available - (Originally from ../FSComp.txt:745) + (Originally from ..\FSComp.txt:748) Measure declarations may have only static members - (Originally from ../FSComp.txt:741) + (Originally from ..\FSComp.txt:744) 'match' expressions may not be used in queries - (Originally from ../FSComp.txt:1313) + (Originally from ..\FSComp.txt:1330) This lookup cannot be used here - (Originally from ../FSComp.txt:653) + (Originally from ..\FSComp.txt:656) Local class bindings cannot be marked inline. Consider lifting the definition out of the class or else do not mark it as inline. - (Originally from ../FSComp.txt:737) + (Originally from ..\FSComp.txt:740) Cannot assign '%s' to a value marked literal - (Originally from ../FSComp.txt:1532) + (Originally from ..\FSComp.txt:1558) Cannot assign a value to another value marked literal - (Originally from ../FSComp.txt:1533) + (Originally from ..\FSComp.txt:1559) This literal pattern does not take arguments - (Originally from ../FSComp.txt:1345) + (Originally from ..\FSComp.txt:1362) Literal values cannot have generic parameters - (Originally from ../FSComp.txt:681) + (Originally from ..\FSComp.txt:684) A literal value cannot be marked 'mutable' - (Originally from ../FSComp.txt:679) + (Originally from ..\FSComp.txt:682) A literal value cannot be marked 'inline' - (Originally from ../FSComp.txt:680) + (Originally from ..\FSComp.txt:683) - A declaration may only be the [<Literal>] attribute if a constant value is also given, e.g. 'val x : int = 1' - (Originally from ../FSComp.txt:720) + A declaration may only be the [<Literal>] attribute if a constant value is also given, e.g. 'val x: int = 1' + (Originally from ..\FSComp.txt:723) A [<Literal>] declaration cannot use an active pattern for its identifier - (Originally from ../FSComp.txt:1562) + (Originally from ..\FSComp.txt:1607) + + + + + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + (Originally from ..\FSComp.txt:1565) + + + + + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + (Originally from ..\FSComp.txt:1568) This list expression exceeds the maximum size for list literals. Use an array for larger literals and call Array.ToList. - (Originally from ../FSComp.txt:587) + (Originally from ..\FSComp.txt:590) This definition may only be used in a type with a primary constructor. Consider adding arguments to your type definition, e.g. 'type X(args) = ...'. - (Originally from ../FSComp.txt:808) + (Originally from ..\FSComp.txt:811) This code is less generic than required by its annotations because the explicit type variable '%s' could not be generalized. It was constrained to be '%s'. - (Originally from ../FSComp.txt:506) + (Originally from ..\FSComp.txt:509) The kind of the type specified by its attributes does not match the kind implied by its definition - (Originally from ../FSComp.txt:769) + (Originally from ..\FSComp.txt:772) In queries, '%s' must use a simple pattern - (Originally from ../FSComp.txt:1221) + (Originally from ..\FSComp.txt:1232) A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - (Originally from ../FSComp.txt:1475) + (Originally from ..\FSComp.txt:1494) Invalid use of a type name - (Originally from ../FSComp.txt:645) + (Originally from ..\FSComp.txt:648) + + + + + Invalid use of reverse index in list expression. + (Originally from ..\FSComp.txt:1560) Invalid use of an interface type - (Originally from ../FSComp.txt:649) + (Originally from ..\FSComp.txt:652) Invalid use of a delegate constructor. Use the syntax 'new Type(args)' or just 'Type(args)'. - (Originally from ../FSComp.txt:650) + (Originally from ..\FSComp.txt:653) The 'UseNullAsTrueValue' attribute flag may only be used with union types that have one nullary case and at least one non-nullary case - (Originally from ../FSComp.txt:1071) + (Originally from ..\FSComp.txt:1074) 'use' bindings must be of the form 'use <var> = <expr>' - (Originally from ../FSComp.txt:697) + (Originally from ..\FSComp.txt:700) use! may not be combined with and! - (Originally from ../FSComp.txt:1500) + (Originally from ..\FSComp.txt:1519) 'use!' bindings must be of the form 'use! <var> = <expr>' - (Originally from ../FSComp.txt:1103) + (Originally from ..\FSComp.txt:1114) Units-of-measure cannot be used as prefix arguments to a type. Rewrite as postfix arguments in angle brackets. - (Originally from ../FSComp.txt:551) + (Originally from ..\FSComp.txt:554) Units-of-measure are only supported on float, float32, decimal, and integer types. - (Originally from ../FSComp.txt:480) + (Originally from ..\FSComp.txt:483) Literal enumerations must have type int, uint, int16, uint16, int64, uint64, byte, sbyte or char - (Originally from ../FSComp.txt:797) + (Originally from ..\FSComp.txt:800) Invalid type extension - (Originally from ../FSComp.txt:767) + (Originally from ..\FSComp.txt:770) Type arguments cannot be specified here - (Originally from ../FSComp.txt:565) + (Originally from ..\FSComp.txt:568) The number of type arguments did not match: '%d' given, '%d' expected. This may be related to a previously reported error. - (Originally from ../FSComp.txt:1215) + (Originally from ..\FSComp.txt:1226) The use of '[<Struct>]' on values, functions and methods is only allowed on partial active pattern definitions - (Originally from ../FSComp.txt:1553) + (Originally from ..\FSComp.txt:1593) Invalid signature for set member - (Originally from ../FSComp.txt:706) + (Originally from ..\FSComp.txt:709) Invalid record, sequence or computation expression. Sequence expressions should be of the form 'seq { ... }' - (Originally from ../FSComp.txt:584) + (Originally from ..\FSComp.txt:587) + + + + + The construct '%s' may only be used in valid resumable code. + (Originally from ..\FSComp.txt:1612) Invalid join relation in '%s'. Expected 'expr <op> expr', where <op> is =, =?, ?= or ?=?. - (Originally from ../FSComp.txt:1271) + (Originally from ..\FSComp.txt:1288) Invalid record construction - (Originally from ../FSComp.txt:631) + (Originally from ..\FSComp.txt:634) This property has an invalid type. Properties taking multiple indexer arguments should have types of the form 'ty1 * ty2 -> ty3'. Properties returning functions should have types of the form '(ty1 -> ty2)'. - (Originally from ../FSComp.txt:546) + (Originally from ..\FSComp.txt:549) This is not a valid pattern - (Originally from ../FSComp.txt:575) + (Originally from ..\FSComp.txt:578) Invalid optional assignment to a property or field - (Originally from ../FSComp.txt:665) + (Originally from ..\FSComp.txt:668) The '%s' operator should not normally be redefined. To define overloaded comparison semantics for a particular type, implement the 'System.IComparable' interface in the definition of that type. - (Originally from ../FSComp.txt:494) + (Originally from ..\FSComp.txt:497) The '%s' operator should not normally be redefined. To define equality semantics for a type, override the 'Object.Equals' member in the definition of that type. - (Originally from ../FSComp.txt:495) + (Originally from ..\FSComp.txt:498) The '%s' operator should not normally be redefined. Consider using a different operator name - (Originally from ../FSComp.txt:496) + (Originally from ..\FSComp.txt:499) Invalid object, sequence or record expression - (Originally from ../FSComp.txt:583) + (Originally from ..\FSComp.txt:586) Invalid object expression. Objects without overrides or interfaces should use the expression form 'new Type(args)' without braces. - (Originally from ../FSComp.txt:582) + (Originally from ..\FSComp.txt:585) This is not a valid object construction expression. Explicit object constructors must either call an alternate constructor or initialize all fields of the object and specify a call to a super class constructor. - (Originally from ../FSComp.txt:541) + (Originally from ..\FSComp.txt:544) Non-primitive numeric literal constants cannot be used in pattern matches because they can be mapped to multiple different types through the use of a NumericLiteral module. Consider using replacing with a variable, and use 'when <variable> = <constant>' at the end of the match clause. - (Originally from ../FSComp.txt:564) + (Originally from ..\FSComp.txt:567) 'new' constraints must take one argument of type 'unit' and return the constructed type - (Originally from ../FSComp.txt:545) + (Originally from ..\FSComp.txt:548) Invalid namespace, module, type or union case name - (Originally from ../FSComp.txt:727) + (Originally from ..\FSComp.txt:730) Invalid module name - (Originally from ../FSComp.txt:766) + (Originally from ..\FSComp.txt:769) This recursive binding uses an invalid mixture of recursive forms - (Originally from ../FSComp.txt:540) + (Originally from ..\FSComp.txt:543) The name '(%s)' should not be used as a member name. To define comparison semantics for a type, implement the 'System.IComparable' interface. If defining a static member for use from other CLI languages then use the name '%s' instead. - (Originally from ../FSComp.txt:490) + (Originally from ..\FSComp.txt:493) The name '(%s)' should not be used as a member name. To define equality semantics for a type, override the 'Object.Equals' member. If defining a static member for use from other CLI languages then use the name '%s' instead. - (Originally from ../FSComp.txt:491) + (Originally from ..\FSComp.txt:494) The name '(%s)' should not be used as a member name because it is given a standard definition in the F# library over fixed types - (Originally from ../FSComp.txt:493) + (Originally from ..\FSComp.txt:496) Invalid member name. Members may not have name '.ctor' or '.cctor' - (Originally from ../FSComp.txt:1213) + (Originally from ..\FSComp.txt:1224) The name '(%s)' should not be used as a member name. If defining a static member for use from other CLI languages then use the name '%s' instead. - (Originally from ../FSComp.txt:492) + (Originally from ..\FSComp.txt:495) Invalid inline specification - (Originally from ../FSComp.txt:696) + (Originally from ..\FSComp.txt:699) - Invalid indexer expression - (Originally from ../FSComp.txt:596) + Incomplete expression or invalid use of indexer syntax + (Originally from ..\FSComp.txt:599) The '%s' operator cannot be redefined. Consider using a different operator name - (Originally from ../FSComp.txt:497) + (Originally from ..\FSComp.txt:500) Internal error. Invalid index into active pattern array - (Originally from ../FSComp.txt:568) + (Originally from ..\FSComp.txt:571) This is not a valid value for an enumeration literal - (Originally from ../FSComp.txt:730) + (Originally from ..\FSComp.txt:733) An 'enum' constraint must be of the form 'enum<type>' - (Originally from ../FSComp.txt:544) + (Originally from ..\FSComp.txt:547) Delegate specifications must be of the form 'typ -> typ' - (Originally from ../FSComp.txt:795) + (Originally from ..\FSComp.txt:798) Invalid declaration - (Originally from ../FSComp.txt:528) + (Originally from ..\FSComp.txt:531) Invalid constraint: the type used for the constraint is sealed, which means the constraint could only be satisfied by at most one solution - (Originally from ../FSComp.txt:543) + (Originally from ..\FSComp.txt:546) Invalid constraint - (Originally from ../FSComp.txt:542) + (Originally from ..\FSComp.txt:545) This is not a valid constant expression - (Originally from ../FSComp.txt:682) + (Originally from ..\FSComp.txt:685) Invalid assignment - (Originally from ../FSComp.txt:644) + (Originally from ..\FSComp.txt:647) Invalid argument to parameterized pattern label - (Originally from ../FSComp.txt:567) + (Originally from ..\FSComp.txt:570) Invalid alignment in interpolated string - (Originally from ../FSComp.txt:1539) + (Originally from ..\FSComp.txt:1579) This is not a valid name for an active pattern - (Originally from ../FSComp.txt:672) + (Originally from ..\FSComp.txt:675) A use of 'into' must be followed by the remainder of the computation - (Originally from ../FSComp.txt:1277) + (Originally from ..\FSComp.txt:1294) Mismatch in interpolated string. Interpolated strings may not use '%%' format specifiers unless each is given an expression, e.g. '%%d{1+1}' - (Originally from ../FSComp.txt:1538) + (Originally from ..\FSComp.txt:1578) Interfaces inherited by other interfaces should be declared using 'inherit ...' instead of 'interface ...' - (Originally from ../FSComp.txt:1082) + (Originally from ..\FSComp.txt:1092) Interface types cannot be sealed - (Originally from ../FSComp.txt:794) + (Originally from ..\FSComp.txt:797) Interface types and delegate types cannot contain fields - (Originally from ../FSComp.txt:789) + (Originally from ..\FSComp.txt:792) This instance member needs a parameter to represent the object being invoked. Make the member static or use the notation 'member x.Member(args) = ...'. - (Originally from ../FSComp.txt:519) + (Originally from ..\FSComp.txt:522) + + + + + The 'InlineIfLambda' attribute may only be used on parameters of inlined functions of methods whose type is a function or F# delegate type. + (Originally from ..\FSComp.txt:1633) The inherited type is not an object model type - (Originally from ../FSComp.txt:633) + (Originally from ..\FSComp.txt:636) A inheritance declaration is not permitted here - (Originally from ../FSComp.txt:734) + (Originally from ..\FSComp.txt:737) This 'inherit' declaration specifies the inherited type but no arguments. Consider supplying arguments, e.g. 'inherit BaseType(args)'. - (Originally from ../FSComp.txt:806) + (Originally from ..\FSComp.txt:809) This 'inherit' declaration has arguments, but is not in a type with a primary constructor. Consider adding arguments to your type definition, e.g. 'type X(args) = ...'. - (Originally from ../FSComp.txt:807) + (Originally from ..\FSComp.txt:810) 'inherit' cannot be used on interface types. Consider implementing the interface by using 'interface ... with ... end' instead. - (Originally from ../FSComp.txt:602) + (Originally from ..\FSComp.txt:605) The function or member '%s' is used in a way that requires further type annotations at its definition to ensure consistency of inferred types. The inferred signature is '%s'. - (Originally from ../FSComp.txt:1214) + (Originally from ..\FSComp.txt:1225) + + + + + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + (Originally from ..\FSComp.txt:1562) Implicit product of measures following / - (Originally from ../FSComp.txt:475) + (Originally from ..\FSComp.txt:478) + + + + + This expression uses the implicit conversion '%s' to convert type '%s' to type '%s'. See https://aka.ms/fsharp-implicit-convs. This warning may be disabled using '#nowarn \"3391\". + (Originally from ..\FSComp.txt:1598) + + + + + This expression uses the implicit conversion '%s' to convert type '%s' to type '%s'. + (Originally from ..\FSComp.txt:1597) The struct, record or union type '%s' implements the interface 'System.IStructuralEquatable' explicitly. Apply the 'CustomEquality' attribute to the type. - (Originally from ../FSComp.txt:757) + (Originally from ..\FSComp.txt:760) The struct, record or union type '%s' implements the interface 'System.IStructuralComparable' explicitly. Apply the 'CustomComparison' attribute to the type. - (Originally from ../FSComp.txt:501) + (Originally from ..\FSComp.txt:504) The struct, record or union type '%s' implements the interface 'System.IEquatable<_>' explicitly. Apply the 'CustomEquality' attribute to the type and provide a consistent implementation of the non-generic override 'System.Object.Equals(obj)'. - (Originally from ../FSComp.txt:758) + (Originally from ..\FSComp.txt:761) The struct, record or union type '%s' implements the interface 'System.IComparable' explicitly. You must apply the 'CustomComparison' attribute to the type. - (Originally from ../FSComp.txt:499) + (Originally from ..\FSComp.txt:502) The struct, record or union type '%s' implements the interface 'System.IComparable<_>' explicitly. You must apply the 'CustomComparison' attribute to the type, and should also provide a consistent implementation of the non-generic interface System.IComparable. - (Originally from ../FSComp.txt:500) + (Originally from ..\FSComp.txt:503) Illegal syntax in type expression - (Originally from ../FSComp.txt:557) + (Originally from ..\FSComp.txt:560) This is not valid literal expression. The [<Literal>] attribute will be ignored. - (Originally from ../FSComp.txt:1331) + (Originally from ..\FSComp.txt:1348) Illegal pattern - (Originally from ../FSComp.txt:577) + (Originally from ..\FSComp.txt:580) Explicit type declarations for constructors must be of the form 'ty1 * ... * tyN -> resTy'. Parentheses may be required around 'resTy' - (Originally from ../FSComp.txt:728) + (Originally from ..\FSComp.txt:731) Byref types are not allowed in an open type declaration. - (Originally from ../FSComp.txt:1492) + (Originally from ..\FSComp.txt:1511) A literal value cannot be given the [<ThreadStatic>] or [<ContextStatic>] attributes - (Originally from ../FSComp.txt:678) + (Originally from ..\FSComp.txt:681) An if/then/else expression may not be used within queries. Consider using either an if/then expression, or use a sequence expression instead. - (Originally from ../FSComp.txt:1234) + (Originally from ..\FSComp.txt:1251) It is recommended that objects supporting the IDisposable interface are created using the syntax 'new Type(args)', rather than 'Type(args)' or 'Type' as a function value representing the constructor, to indicate that resources may be owned by the generated value - (Originally from ../FSComp.txt:605) + (Originally from ..\FSComp.txt:608) + + + + + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + (Originally from ..\FSComp.txt:1563) + + + + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + (Originally from ..\FSComp.txt:1561) The system type '%s' was required but no referenced system DLL contained this type - (Originally from ../FSComp.txt:1367) + (Originally from ..\FSComp.txt:1384) Generic types cannot be given the 'StructLayout' attribute - (Originally from ../FSComp.txt:777) + (Originally from ..\FSComp.txt:780) A generic type parameter has been used in a way that constrains it to always be '%s' - (Originally from ../FSComp.txt:508) + (Originally from ..\FSComp.txt:511) The provided types generated by this use of a type provider may not be used from other F# assemblies and should be marked internal or private. Consider using 'type internal TypeName = ...' or 'type private TypeName = ...'. - (Originally from ../FSComp.txt:1320) + (Originally from ..\FSComp.txt:1337) The generic function '%s' must be given explicit type argument(s) - (Originally from ../FSComp.txt:530) + (Originally from ..\FSComp.txt:533) This function value is being used to construct a delegate type whose signature includes a byref argument. You must use an explicit lambda expression taking %d arguments. - (Originally from ../FSComp.txt:538) + (Originally from ..\FSComp.txt:541) The corresponding formal argument is not optional - (Originally from ../FSComp.txt:664) + (Originally from ..\FSComp.txt:667) Invalid use of 'fixed'. 'fixed' may only be used in a declaration of the form 'use x = fixed expr' where the expression is an array, the address of a field, the address of an array element or a string' - (Originally from ../FSComp.txt:1362) + (Originally from ..\FSComp.txt:1379) The field labels and expected type of this record expression or pattern do not uniquely determine a corresponding record type - (Originally from ../FSComp.txt:513) + (Originally from ..\FSComp.txt:516) A field/val declaration is not permitted here - (Originally from ../FSComp.txt:733) + (Originally from ..\FSComp.txt:736) This field requires a name - (Originally from ../FSComp.txt:726) + (Originally from ..\FSComp.txt:729) No assignment given for field '%s' of type '%s' - (Originally from ../FSComp.txt:609) + (Originally from ..\FSComp.txt:612) This field is not a literal and cannot be used in a pattern - (Originally from ../FSComp.txt:573) + (Originally from ..\FSComp.txt:576) Named field '%s' is used more than once. - (Originally from ../FSComp.txt:1328) + (Originally from ..\FSComp.txt:1345) Named field '%s' conflicts with autogenerated name for anonymous field. - (Originally from ../FSComp.txt:1329) + (Originally from ..\FSComp.txt:1346) This field is readonly - (Originally from ../FSComp.txt:536) + (Originally from ..\FSComp.txt:539) Field '%s' is not static - (Originally from ../FSComp.txt:572) + (Originally from ..\FSComp.txt:575) This field is not mutable - (Originally from ../FSComp.txt:591) + (Originally from ..\FSComp.txt:594) The field '%s' appears twice in this record expression or pattern - (Originally from ../FSComp.txt:514) + (Originally from ..\FSComp.txt:517) All record, union and struct types in FSharp.Core.dll must be explicitly labelled with 'StructuralComparison' or 'NoComparison' - (Originally from ../FSComp.txt:1046) + (Originally from ..\FSComp.txt:1049) Extraneous fields have been given values - (Originally from ../FSComp.txt:610) + (Originally from ..\FSComp.txt:613) This list or array expression includes an element of the form 'if ... then ... else'. Parenthesize this expression to indicate it is an individual element of the list or array, to disambiguate this from a list generated using a sequence expression - (Originally from ../FSComp.txt:585) + (Originally from ..\FSComp.txt:588) This expression form may only be used in sequence and computation expressions - (Originally from ../FSComp.txt:581) + (Originally from ..\FSComp.txt:584) The expression form { expr with ... } may only be used with record types. To build object types use { new Type(...) with ... } - (Originally from ../FSComp.txt:632) + (Originally from ..\FSComp.txt:635) The expression form 'expr then expr' may only be used as part of an explicit object constructor - (Originally from ../FSComp.txt:588) + (Originally from ..\FSComp.txt:591) Expected %d expressions, got %d - (Originally from ../FSComp.txt:579) + (Originally from ..\FSComp.txt:582) TcExprUndelayed: delayed - (Originally from ../FSComp.txt:580) + (Originally from ..\FSComp.txt:583) Explicit type specifications cannot be used for exception constructors - (Originally from ../FSComp.txt:759) + (Originally from ..\FSComp.txt:762) Explicit type parameters may only be used on module or member bindings - (Originally from ../FSComp.txt:511) + (Originally from ..\FSComp.txt:514) An explicit static initializer should use the syntax 'static new(args) = expr' - (Originally from ../FSComp.txt:524) + (Originally from ..\FSComp.txt:527) An explicit object constructor should use the syntax 'new(args) = expr' - (Originally from ../FSComp.txt:525) + (Originally from ..\FSComp.txt:528) Expected unit-of-measure, not type - (Originally from ../FSComp.txt:550) + (Originally from ..\FSComp.txt:553) Expected unit-of-measure parameter, not type parameter. Explicit unit-of-measure parameters must be marked with the [<Measure>] attribute. - (Originally from ../FSComp.txt:547) + (Originally from ..\FSComp.txt:550) Expected type parameter, not unit-of-measure parameter - (Originally from ../FSComp.txt:548) + (Originally from ..\FSComp.txt:551) Expected type, not unit-of-measure - (Originally from ../FSComp.txt:549) + (Originally from ..\FSComp.txt:552) Expected an interface type - (Originally from ../FSComp.txt:625) + (Originally from ..\FSComp.txt:628) Expected module or namespace parent %s - (Originally from ../FSComp.txt:498) + (Originally from ..\FSComp.txt:501) The exception '%s' does not have a field named '%s'. - (Originally from ../FSComp.txt:1324) + (Originally from ..\FSComp.txt:1341) Exception abbreviations should not have argument lists - (Originally from ../FSComp.txt:760) + (Originally from ..\FSComp.txt:763) Exception abbreviations must refer to existing exceptions or F# types deriving from System.Exception - (Originally from ../FSComp.txt:762) + (Originally from ..\FSComp.txt:765) Event '%s' is static - (Originally from ../FSComp.txt:658) + (Originally from ..\FSComp.txt:661) Event '%s' is not static - (Originally from ../FSComp.txt:659) + (Originally from ..\FSComp.txt:662) Enumerations cannot have members - (Originally from ../FSComp.txt:740) + (Originally from ..\FSComp.txt:743) Enumerations cannot have interface declarations - (Originally from ../FSComp.txt:748) + (Originally from ..\FSComp.txt:751) The type '%s' is not a valid enumerator type , i.e. does not have a 'MoveNext()' method returning a bool, and a 'Current' property - (Originally from ../FSComp.txt:1105) + (Originally from ..\FSComp.txt:1116) The 'EntryPointAttribute' attribute may only be used on function definitions in modules - (Originally from ../FSComp.txt:673) + (Originally from ..\FSComp.txt:676) '{ }' is not a valid expression. Records must include at least one field. Empty sequences are specified by using Seq.empty or an empty list '[]'. - (Originally from ../FSComp.txt:635) + (Originally from ..\FSComp.txt:638) Copy-and-update record expressions must include at least one field. - (Originally from ../FSComp.txt:1318) + (Originally from ..\FSComp.txt:1335) Duplicate specification of an interface - (Originally from ../FSComp.txt:732) + (Originally from ..\FSComp.txt:735) The method or function '%s' should not be given explicit type argument(s) because it does not declare its type parameters explicitly - (Originally from ../FSComp.txt:531) + (Originally from ..\FSComp.txt:534) 'do!' cannot be used within sequence expressions - (Originally from ../FSComp.txt:640) + (Originally from ..\FSComp.txt:643) DLLImport stubs cannot be inlined - (Originally from ../FSComp.txt:503) + (Originally from ..\FSComp.txt:506) DLLImport bindings must be static members in a class or function definitions in a module - (Originally from ../FSComp.txt:1099) + (Originally from ..\FSComp.txt:1110) Delegate specifications must not be curried types. Use 'typ * ... * typ -> typ' for multi-argument delegates, and 'typ -> (typ -> typ)' for delegates returning function values. - (Originally from ../FSComp.txt:796) + (Originally from ..\FSComp.txt:799) A delegate constructor must be passed a single function value - (Originally from ../FSComp.txt:666) + (Originally from ..\FSComp.txt:669) The 'DefaultValue' attribute may only be used on 'val' declarations - (Originally from ../FSComp.txt:670) + (Originally from ..\FSComp.txt:673) The default, zero-initializing constructor of a struct type may only be used if all the fields of the struct type admit default initialization - (Originally from ../FSComp.txt:533) + (Originally from ..\FSComp.txt:536) A default implementation of this interface has already been added because the explicit implementation of the interface was not specified at the definition of the type - (Originally from ../FSComp.txt:751) + (Originally from ..\FSComp.txt:754) This method already has a default implementation - (Originally from ../FSComp.txt:702) + (Originally from ..\FSComp.txt:705) The method implemented by this default is ambiguous - (Originally from ../FSComp.txt:703) + (Originally from ..\FSComp.txt:706) One or more of the declared type parameters for this type extension have a missing or wrong type constraint not matching the original type constraints on '%s' - (Originally from ../FSComp.txt:803) + (Originally from ..\FSComp.txt:806) This declaration element is not permitted in an augmentation - (Originally from ../FSComp.txt:753) + (Originally from ..\FSComp.txt:756) '%s' is not used correctly. Usage: %s. This is a custom operation in this query or computation expression. - (Originally from ../FSComp.txt:1239) + (Originally from ..\FSComp.txt:1256) '%s' is not used correctly. This is a custom operation in this query or computation expression. - (Originally from ../FSComp.txt:1238) + (Originally from ..\FSComp.txt:1255) A custom operation may not be used in conjunction with a non-value or recursive 'let' binding in another part of this computation expression - (Originally from ../FSComp.txt:1228) + (Originally from ..\FSComp.txt:1239) A custom operation may not be used in conjunction with 'use', 'try/with', 'try/finally', 'if/then/else' or 'match' operators within this computation expression - (Originally from ../FSComp.txt:1229) + (Originally from ..\FSComp.txt:1240) The custom operation '%s' refers to a method which is overloaded. The implementations of custom operations may not be overloaded. - (Originally from ../FSComp.txt:1230) + (Originally from ..\FSComp.txt:1241) The definition of the custom operator '%s' does not use a valid combination of attribute flags - (Originally from ../FSComp.txt:1279) + (Originally from ..\FSComp.txt:1296) '%s' is used with an incorrect number of arguments. This is a custom operation in this query or computation expression. Expected %d argument(s), but given %d. - (Originally from ../FSComp.txt:1246) + (Originally from ..\FSComp.txt:1263) A custom attribute must invoke an object constructor - (Originally from ../FSComp.txt:693) + (Originally from ..\FSComp.txt:696) A custom attribute must be a reference type - (Originally from ../FSComp.txt:691) + (Originally from ..\FSComp.txt:694) The number of args for a custom attribute does not match the expected number of args for the attribute constructor - (Originally from ../FSComp.txt:692) + (Originally from ..\FSComp.txt:695) Could not find method System.Runtime.CompilerServices.OffsetToStringData in references when building 'fixed' expression. - (Originally from ../FSComp.txt:1363) + (Originally from ..\FSComp.txt:1380) Couldn't find Dispose on IDisposable, or it was overloaded - (Originally from ../FSComp.txt:534) + (Originally from ..\FSComp.txt:537) The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record - (Originally from ../FSComp.txt:1487) + (Originally from ..\FSComp.txt:1506) Constructors are not permitted as extension members - they must be defined as part of the original definition of the type - (Originally from ../FSComp.txt:1346) + (Originally from ..\FSComp.txt:1363) Constructors cannot be defined for this type - (Originally from ../FSComp.txt:715) + (Originally from ..\FSComp.txt:718) Constructors cannot be specified in exception augmentations - (Originally from ../FSComp.txt:713) + (Originally from ..\FSComp.txt:716) Constructors must be applied to arguments and cannot be used as first-class values. If necessary use an anonymous function '(fun arg1 ... argN -> new Type(arg1,...,argN))'. - (Originally from ../FSComp.txt:656) + (Originally from ..\FSComp.txt:659) Constructors for the type '%s' must directly or indirectly call its implicit object constructor. Use a call to the implicit object constructor instead of a record expression. - (Originally from ../FSComp.txt:607) + (Originally from ..\FSComp.txt:610) This object constructor requires arguments - (Originally from ../FSComp.txt:627) + (Originally from ..\FSComp.txt:630) Constructor expressions for interfaces do not take arguments - (Originally from ../FSComp.txt:626) + (Originally from ..\FSComp.txt:629) The constructor does not have a field named '%s'. - (Originally from ../FSComp.txt:1326) + (Originally from ..\FSComp.txt:1343) A constructor cannot have explicit type parameters. Consider using a static construction method instead. - (Originally from ../FSComp.txt:518) + (Originally from ..\FSComp.txt:521) This construct may only be used within sequence or computation expressions - (Originally from ../FSComp.txt:594) + (Originally from ..\FSComp.txt:597) This construct may only be used within list, array and sequence expressions, e.g. expressions of the form 'seq { ... }', '[ ... ]' or '[| ... |]'. These use the syntax 'for ... in ... do ... yield...' to generate elements - (Originally from ../FSComp.txt:592) + (Originally from ..\FSComp.txt:595) This construct may only be used within computation expressions. To return a value from an ordinary function simply write the expression without 'return'. - (Originally from ../FSComp.txt:593) + (Originally from ..\FSComp.txt:596) This construct may only be used within computation expressions - (Originally from ../FSComp.txt:595) + (Originally from ..\FSComp.txt:598) This construct is ambiguous as part of a sequence expression. Nested expressions may be written using 'let _ = (...)' and nested sequences using 'yield! seq {... }'. - (Originally from ../FSComp.txt:639) + (Originally from ..\FSComp.txt:642) This construct is ambiguous as part of a computation expression. Nested expressions may be written using 'let _ = (...)' and nested computations using 'let! res = builder { ... }'. - (Originally from ../FSComp.txt:638) + (Originally from ..\FSComp.txt:641) One or more of the explicit class or function type variables for this binding could not be generalized, because they were constrained to other types - (Originally from ../FSComp.txt:507) + (Originally from ..\FSComp.txt:510) Attribute 'System.Diagnostics.ConditionalAttribute' is only valid on methods or attribute classes - (Originally from ../FSComp.txt:1091) + (Originally from ..\FSComp.txt:1102) The 'ConditionalAttribute' attribute may only be used on members - (Originally from ../FSComp.txt:671) + (Originally from ..\FSComp.txt:674) Interfaces cannot contain definitions of concrete members. You may need to define a constructor on your type to indicate that the type is a class. - (Originally from ../FSComp.txt:712) + (Originally from ..\FSComp.txt:715) The 'CompiledName' attribute cannot be used with this language element - (Originally from ../FSComp.txt:600) + (Originally from ..\FSComp.txt:603) Cannot partially apply the extension method '%s' because the first parameter is a byref type. - (Originally from ../FSComp.txt:1483) + (Originally from ..\FSComp.txt:1502) Cannot override inherited member '%s' because it is sealed - (Originally from ../FSComp.txt:1216) + (Originally from ..\FSComp.txt:1227) Cannot inherit from a variable type - (Originally from ../FSComp.txt:598) + (Originally from ..\FSComp.txt:601) Cannot inherit a sealed type - (Originally from ../FSComp.txt:791) + (Originally from ..\FSComp.txt:794) Cannot inherit from interface type. Use interface ... with instead. - (Originally from ../FSComp.txt:792) + (Originally from ..\FSComp.txt:795) Cannot inherit from erased provided type - (Originally from ../FSComp.txt:1211) + (Originally from ..\FSComp.txt:1222) Cannot create an extension of a sealed type - (Originally from ../FSComp.txt:619) + (Originally from ..\FSComp.txt:622) Cannot call the byref extension method '%s. The first parameter requires the value to be mutable or a non-readonly byref type. - (Originally from ../FSComp.txt:1481) + (Originally from ..\FSComp.txt:1500) Cannot call an abstract base member: '%s' - (Originally from ../FSComp.txt:1075) + (Originally from ..\FSComp.txt:1078) '%s' must be applied to an argument of type '%s', but has been applied to an argument of type '%s' - (Originally from ../FSComp.txt:1114) + (Originally from ..\FSComp.txt:1125) '%s' can only be applied to optional arguments - (Originally from ../FSComp.txt:1115) + (Originally from ..\FSComp.txt:1126) Byref types are not allowed to have optional type extensions. - (Originally from ../FSComp.txt:1482) + (Originally from ..\FSComp.txt:1501) A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - (Originally from ../FSComp.txt:1470) + (Originally from ..\FSComp.txt:1489) A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - (Originally from ../FSComp.txt:1471) + (Originally from ..\FSComp.txt:1490) + + + + + This expression uses a built-in implicit conversion to convert type '%s' to type '%s'. See https://aka.ms/fsharp-implicit-convs. + (Originally from ..\FSComp.txt:1596) A binding cannot be marked both 'use' and 'rec' - (Originally from ../FSComp.txt:667) + (Originally from ..\FSComp.txt:670) 'let!', 'use!' and 'do!' expressions may not be used in queries - (Originally from ../FSComp.txt:1290) + (Originally from ..\FSComp.txt:1307) '%s' must be followed by a variable name. Usage: %s. - (Originally from ../FSComp.txt:1243) + (Originally from ..\FSComp.txt:1260) '%s' must come after a 'for' selection clause and be followed by the rest of the query. Syntax: ... %s ... - (Originally from ../FSComp.txt:1245) + (Originally from ..\FSComp.txt:1262) 'member val' definitions are only permitted in types with a primary constructor. Consider adding arguments to your type definition, e.g. 'type X(args) = ...'. - (Originally from ../FSComp.txt:1281) + (Originally from ..\FSComp.txt:1298) Attributes cannot be applied to type extensions. - (Originally from ../FSComp.txt:1488) + (Originally from ..\FSComp.txt:1507) The attributes of this type specify multiple kinds for the type - (Originally from ../FSComp.txt:768) + (Originally from ..\FSComp.txt:771) Attributes are not allowed within patterns - (Originally from ../FSComp.txt:529) + (Originally from ..\FSComp.txt:532) Attributes are not permitted on 'let' bindings in expressions - (Originally from ../FSComp.txt:669) + (Originally from ..\FSComp.txt:672) This attribute is not valid for use on this language element. Assembly attributes should be attached to a 'do ()' declaration, if necessary within an F# module. - (Originally from ../FSComp.txt:686) + (Originally from ..\FSComp.txt:689) This attribute is not valid for use on this language element - (Originally from ../FSComp.txt:687) + (Originally from ..\FSComp.txt:690) Attribute expressions must be calls to object constructors - (Originally from ../FSComp.txt:694) + (Originally from ..\FSComp.txt:697) The attribute 'AutoOpen(\"%s\")' in the assembly '%s' did not refer to a valid module or namespace in that assembly and has been ignored - (Originally from ../FSComp.txt:815) + (Originally from ..\FSComp.txt:818) The attribute '%s' appears in both the implementation and the signature, but the attribute arguments differ. Only the attribute from the signature will be included in the compiled code. - (Originally from ../FSComp.txt:1074) + (Originally from ..\FSComp.txt:1077) At least one override did not correctly implement its corresponding abstract member - (Originally from ../FSComp.txt:629) + (Originally from ..\FSComp.txt:632) The member '%s' does not accept the correct number of arguments. One overload accepts %d arguments, but %d were given. The required signature is '%s'.%s - (Originally from ../FSComp.txt:615) + (Originally from ..\FSComp.txt:618) The member '%s' does not accept the correct number of arguments. %d argument(s) are expected, but %d were given. The required signature is '%s'.%s - (Originally from ../FSComp.txt:614) + (Originally from ..\FSComp.txt:617) Anonymous unit-of-measure cannot be nested inside another unit-of-measure expression - (Originally from ../FSComp.txt:558) + (Originally from ..\FSComp.txt:561) Anonymous type variables are not permitted in this declaration - (Originally from ../FSComp.txt:559) + (Originally from ..\FSComp.txt:562) Invalid Anonymous Record type declaration. - (Originally from ../FSComp.txt:1373) + (Originally from ..\FSComp.txt:1390) This anonymous record has too many fields. Remove the extra fields %s. - (Originally from ../FSComp.txt:1377) + (Originally from ..\FSComp.txt:1394) This anonymous record does not have enough fields. Add the missing fields %s. - (Originally from ../FSComp.txt:1376) + (Originally from ..\FSComp.txt:1393) This anonymous record does not exactly match the expected shape. Add the missing fields %s and remove the extra fields %s. - (Originally from ../FSComp.txt:1375) + (Originally from ..\FSComp.txt:1392) This is the wrong anonymous record. It should have the fields %s. - (Originally from ../FSComp.txt:1378) + (Originally from ..\FSComp.txt:1395) Two anonymous record types are from different assemblies '%s' and '%s' - (Originally from ../FSComp.txt:1374) + (Originally from ..\FSComp.txt:1391) This feature is not supported in this version of F#. You may need to add /langversion:preview to use this feature. - (Originally from ../FSComp.txt:1499) + (Originally from ..\FSComp.txt:1518) + + + + + This expression has type '%s' and is only made compatible with type '%s' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:%s + (Originally from ..\FSComp.txt:1594) Types with the 'AllowNullLiteral' attribute may only inherit from or implement types which also allow the use of the null literal - (Originally from ../FSComp.txt:776) + (Originally from ..\FSComp.txt:779) All implemented interfaces should be declared on the initial declaration of the type - (Originally from ../FSComp.txt:750) + (Originally from ..\FSComp.txt:753) Active patterns do not have fields. This syntax is invalid. - (Originally from ../FSComp.txt:1325) + (Originally from ..\FSComp.txt:1342) Instances of this type cannot be created since it has been marked abstract or not all methods have been given implementations. Consider using an object expression '{ new ... with ... }' instead. - (Originally from ../FSComp.txt:604) + (Originally from ..\FSComp.txt:607) This property overrides or implements an abstract property but the abstract property doesn't have a corresponding %s - (Originally from ../FSComp.txt:705) + (Originally from ..\FSComp.txt:708) Abstract members are not permitted in an augmentation - they must be defined as part of the type itself - (Originally from ../FSComp.txt:698) + (Originally from ..\FSComp.txt:701) Abbreviations for Common IL exception types must have a matching object constructor - (Originally from ../FSComp.txt:763) + (Originally from ..\FSComp.txt:766) Abbreviations for Common IL exceptions cannot take arguments - (Originally from ../FSComp.txt:761) + (Originally from ..\FSComp.txt:764) Abbreviated types cannot be given the 'Sealed' attribute - (Originally from ../FSComp.txt:790) + (Originally from ..\FSComp.txt:793) F# supports array ranks between 1 and 32. The value %d is not allowed. - (Originally from ../FSComp.txt:1285) + (Originally from ..\FSComp.txt:1302) A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - (Originally from ../FSComp.txt:84) + (Originally from ..\FSComp.txt:87) A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - (Originally from ../FSComp.txt:1474) + (Originally from ..\FSComp.txt:1493) The value has been copied to ensure the original is not mutated by this operation or because the copy is implicit when returning a struct from a member and another member is then accessed - (Originally from ../FSComp.txt:86) + (Originally from ..\FSComp.txt:89) This value does not have a valid property setter type - (Originally from ../FSComp.txt:80) + (Originally from ..\FSComp.txt:83) Unexpected decode of InternalsVisibleToAttribute - (Originally from ../FSComp.txt:91) + (Originally from ..\FSComp.txt:94) Unexpected decode of InterfaceDataVersionAttribute - (Originally from ../FSComp.txt:92) + (Originally from ..\FSComp.txt:95) Unexpected decode of AutoOpenAttribute - (Originally from ../FSComp.txt:90) + (Originally from ..\FSComp.txt:93) Unexpected use of a byref-typed variable - (Originally from ../FSComp.txt:83) + (Originally from ..\FSComp.txt:86) The module/namespace '%s' from compilation unit '%s' did not contain the val '%s' - (Originally from ../FSComp.txt:1069) + (Originally from ..\FSComp.txt:1072) The module/namespace '%s' from compilation unit '%s' did not contain the namespace, module or type '%s' - (Originally from ../FSComp.txt:1070) + (Originally from ..\FSComp.txt:1073) The module/namespace '%s' from compilation unit '%s' did not contain the module/namespace '%s' - (Originally from ../FSComp.txt:1068) + (Originally from ..\FSComp.txt:1071) The type/module '%s' is not a concrete module or type - (Originally from ../FSComp.txt:72) + (Originally from ..\FSComp.txt:75) The type '%s' has an inline assembly code representation - (Originally from ../FSComp.txt:73) + (Originally from ..\FSComp.txt:76) Two modules named '%s' occur in two parts of this assembly - (Originally from ../FSComp.txt:76) + (Originally from ..\FSComp.txt:79) Recursively defined values cannot appear directly as part of the construction of a tuple value within a recursive binding - (Originally from ../FSComp.txt:87) + (Originally from ..\FSComp.txt:90) Recursive values cannot be directly assigned to the non-mutable field '%s' of the type '%s' within a recursive binding. Consider using a mutable field instead. - (Originally from ../FSComp.txt:89) + (Originally from ..\FSComp.txt:92) Recursive values cannot appear directly as a construction of the type '%s' within a recursive binding. This feature has been removed from the F# language. Consider using a record instead. - (Originally from ../FSComp.txt:88) + (Originally from ..\FSComp.txt:91) This is not a valid constant expression or custom attribute value - (Originally from ../FSComp.txt:94) + (Originally from ..\FSComp.txt:97) A namespace and a module named '%s' both occur in two parts of this assembly - (Originally from ../FSComp.txt:75) + (Originally from ..\FSComp.txt:78) Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'. - (Originally from ../FSComp.txt:85) + (Originally from ..\FSComp.txt:88) Invalid member signature encountered because of an earlier error - (Originally from ../FSComp.txt:79) + (Originally from ..\FSComp.txt:82) Invalid form for a property setter. At least one argument is required. - (Originally from ../FSComp.txt:82) + (Originally from ..\FSComp.txt:85) Invalid form for a property getter. At least one '()' argument is required when using the explicit syntax. - (Originally from ../FSComp.txt:81) + (Originally from ..\FSComp.txt:84) This operation accesses a mutable top-level value defined in another assembly in an unsupported way. The value cannot be accessed through its address. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...', and if necessary assigning the value back after the completion of the operation - (Originally from ../FSComp.txt:1062) + (Originally from ..\FSComp.txt:1065) Two type definitions named '%s' occur in namespace '%s' in two parts of this assembly - (Originally from ../FSComp.txt:77) + (Originally from ..\FSComp.txt:80) This literal expression or attribute argument results in an arithmetic overflow. - (Originally from ../FSComp.txt:1330) + (Originally from ..\FSComp.txt:1347) A module and a type definition named '%s' occur in namespace '%s' in two parts of this assembly - (Originally from ../FSComp.txt:78) + (Originally from ..\FSComp.txt:81) Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. - (Originally from ../FSComp.txt:1480) + (Originally from ..\FSComp.txt:1499) Active patterns cannot return more than 7 possibilities - (Originally from ../FSComp.txt:93) + (Originally from ..\FSComp.txt:96) The struct or class field '%s' is not accessible from this code location - (Originally from ../FSComp.txt:965) + (Originally from ..\FSComp.txt:968) Source file is too large to embed in a portable PDB - (Originally from ../FSComp.txt:866) + (Originally from ..\FSComp.txt:869) @@ -3478,2958 +3652,3114 @@ The .NET SDK for this script could not be determined. If the script is in a directory using a 'global.json' then ensure the relevant .NET SDK is installed. Unexpected error '%s'. - (Originally from ../FSComp.txt:1551) + (Originally from ..\FSComp.txt:1591) The .NET SDK for this script could not be determined. dotnet.exe could not be found ensure a .NET SDK is installed. - (Originally from ../FSComp.txt:1552) + (Originally from ..\FSComp.txt:1592) The .NET SDK for this script could not be determined. If the script is in a directory using a 'global.json' then ensure the relevant .NET SDK is installed. The output from '%s --version' in the directory '%s' was: '%s' and the exit code was '%d'. - (Originally from ../FSComp.txt:1550) + (Originally from ..\FSComp.txt:1590) Consider using 'return!' instead of 'return'. - (Originally from ../FSComp.txt:31) + (Originally from ..\FSComp.txt:31) + + + + + This state machine is not statically compilable and no alternative is available. %s. Use an 'if __useResumableCode then <state-machine> else <alternative>' to give an alternative. + (Originally from ..\FSComp.txt:1620) + + + + + This state machine is not statically compilable. %s. An alternative dynamic implementation will be used, which may be slower. Consider adjusting your code to ensure this state machine is statically compilable, or else suppress this warning. + (Originally from ..\FSComp.txt:1619) + + + + + The state machine has an unexpected form + (Originally from ..\FSComp.txt:1630) + + + + + The resumable code value(s) '%s' does not have a definition + (Originally from ..\FSComp.txt:1628) + + + + + A resumable code invocation at '%s' could not be reduced + (Originally from ..\FSComp.txt:1622) + + + + + A delegate or function producing resumable code in a state machine has type parameters + (Originally from ..\FSComp.txt:1629) + + + + + A try/finally may not contain resumption points + (Originally from ..\FSComp.txt:1625) + + + + + The 'with' block of a try/with may not contain resumption points + (Originally from ..\FSComp.txt:1626) + + + + + A 'let rec' occured in the resumable code specification + (Originally from ..\FSComp.txt:1623) + + + + + A fast integer for loop may not contain resumption points + (Originally from ..\FSComp.txt:1627) + + + + + A target label for __resumeAt was not statically determined. A __resumeAt with a non-static target label may only appear at the start of a resumable code method + (Originally from ..\FSComp.txt:1624) Replace with '%s' - (Originally from ../FSComp.txt:19) + (Originally from ..\FSComp.txt:19) Recursive class hierarchy in type '%s' - (Originally from ../FSComp.txt:957) + (Originally from ..\FSComp.txt:960) A ReadOnly attribute has been applied to a struct type with a mutable field. - (Originally from ../FSComp.txt:1469) + (Originally from ..\FSComp.txt:1488) Unexpected token '%s' in preprocessor expression - (Originally from ../FSComp.txt:1337) + (Originally from ..\FSComp.txt:1354) Missing token '%s' in preprocessor expression - (Originally from ../FSComp.txt:1339) + (Originally from ..\FSComp.txt:1356) Incomplete preprocessor expression - (Originally from ../FSComp.txt:1338) + (Originally from ..\FSComp.txt:1355) Unexpected character '%s' in preprocessor expression - (Originally from ../FSComp.txt:1336) + (Originally from ..\FSComp.txt:1353) Expected single line comment or end of line - (Originally from ../FSComp.txt:1042) + (Originally from ..\FSComp.txt:1045) #i is not supported by the registered PackageManagers - (Originally from ../FSComp.txt:1497) + (Originally from ..\FSComp.txt:1516) An error occurred while reading the F# metadata of assembly '%s'. A reserved construct was utilized. You may need to upgrade your F# compiler or use an earlier version of the assembly that doesn't make use of a specific construct. - (Originally from ../FSComp.txt:1463) + (Originally from ..\FSComp.txt:1482) An error occurred while reading the F# metadata node at position %d in table '%s' of assembly '%s'. The node had no matching declaration. Please report this warning. You may need to recompile the F# assembly you are using. - (Originally from ../FSComp.txt:1340) + (Originally from ..\FSComp.txt:1357) Error reading/writing metadata for the F# compiled DLL '%s'. Was the DLL compiled with an earlier version of the F# compiler? (error: '%s'). - (Originally from ../FSComp.txt:71) + (Originally from ..\FSComp.txt:74) A pattern match guard must be of type 'bool', but this 'when' expression is of type '%s'. - (Originally from ../FSComp.txt:27) + (Originally from ..\FSComp.txt:27) Problem with filename '%s': Illegal characters in path. - (Originally from ../FSComp.txt:1153) + (Originally from ..\FSComp.txt:1164) Partial active patterns may only generate one result - (Originally from ../FSComp.txt:975) + (Originally from ..\FSComp.txt:978) Missing variable '%s' - (Originally from ../FSComp.txt:974) + (Originally from ..\FSComp.txt:977) Missing 'do' in 'while' expression. Expected 'while <expr> do <expr>'. - (Originally from ../FSComp.txt:1269) + (Originally from ..\FSComp.txt:1286) Accessibility modifiers are not permitted on an 'inherits' declaration - (Originally from ../FSComp.txt:422) + (Originally from ..\FSComp.txt:425) Accessibility modifiers should come immediately prior to the identifier naming a construct - (Originally from ../FSComp.txt:393) + (Originally from ..\FSComp.txt:396) 'use' bindings are not permitted in modules and are treated as 'let' bindings - (Originally from ../FSComp.txt:386) + (Originally from ..\FSComp.txt:389) 'use' bindings are not permitted in primary constructors - (Originally from ../FSComp.txt:385) + (Originally from ..\FSComp.txt:388) Unmatched 'with' or badly formatted 'with' block - (Originally from ../FSComp.txt:409) + (Originally from ..\FSComp.txt:412) Incomplete value definition. If this is in an expression, the body of the expression must be indented to the same column as the 'use!' keyword. - (Originally from ../FSComp.txt:1267) + (Originally from ..\FSComp.txt:1284) Incomplete value definition. If this is in an expression, the body of the expression must be indented to the same column as the 'use' keyword. - (Originally from ../FSComp.txt:1268) + (Originally from ..\FSComp.txt:1285) Unmatched '(' - (Originally from ../FSComp.txt:436) + (Originally from ..\FSComp.txt:439) Incomplete value definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let!' keyword. - (Originally from ../FSComp.txt:1266) + (Originally from ..\FSComp.txt:1283) Incomplete value or function definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let' keyword. - (Originally from ../FSComp.txt:1265) + (Originally from ..\FSComp.txt:1282) Unmatched '[<'. Expected closing '>]' - (Originally from ../FSComp.txt:1249) + (Originally from ..\FSComp.txt:1266) Unmatched 'class', 'interface' or 'struct' - (Originally from ../FSComp.txt:407) + (Originally from ..\FSComp.txt:410) Unmatched '[|' - (Originally from ../FSComp.txt:452) + (Originally from ..\FSComp.txt:455) Unmatched '[' - (Originally from ../FSComp.txt:447) + (Originally from ..\FSComp.txt:450) Unmatched '{|' - (Originally from ../FSComp.txt:454) + (Originally from ..\FSComp.txt:457) Unmatched '{' - (Originally from ../FSComp.txt:453) + (Originally from ..\FSComp.txt:456) Unmatched 'begin' or 'struct' - (Originally from ../FSComp.txt:400) + (Originally from ..\FSComp.txt:403) Unmatched 'begin' - (Originally from ../FSComp.txt:412) + (Originally from ..\FSComp.txt:415) Unmatched '%s' - (Originally from ../FSComp.txt:451) + (Originally from ..\FSComp.txt:454) Accessibility modifiers are not permitted on union cases. Use 'type U = internal ...' or 'type U = private ...' to give an accessibility to the whole representation. - (Originally from ../FSComp.txt:431) + (Originally from ..\FSComp.txt:434) Unexpected token '%s' or incomplete expression - (Originally from ../FSComp.txt:1305) + (Originally from ..\FSComp.txt:1322) Accessibility modifiers are not permitted here, but '%s' was given. - (Originally from ../FSComp.txt:391) + (Originally from ..\FSComp.txt:394) Syntax error: unexpected type parameter specification - (Originally from ../FSComp.txt:464) + (Originally from ..\FSComp.txt:467) Unexpected symbol '=' in expression. Did you intend to use 'for x in y .. z do' instead? - (Originally from ../FSComp.txt:1370) + (Originally from ..\FSComp.txt:1387) Unexpected symbol '.' in member definition. Expected 'with', '=' or other token. - (Originally from ../FSComp.txt:430) + (Originally from ..\FSComp.txt:433) A semicolon is not expected at this point - (Originally from ../FSComp.txt:389) + (Originally from ..\FSComp.txt:392) Unexpected quotation operator '<@' in type definition. If you intend to pass a verbatim string as a static argument to a type provider, put a space between the '<' and '@' characters. - (Originally from ../FSComp.txt:1111) + (Originally from ..\FSComp.txt:1122) Unexpected infix operator in unit-of-measure expression. Legal operators are '*', '/' and '^'. - (Originally from ../FSComp.txt:462) + (Originally from ..\FSComp.txt:465) Unexpected integer literal in unit-of-measure expression - (Originally from ../FSComp.txt:463) + (Originally from ..\FSComp.txt:466) Unexpected infix operator in type expression - (Originally from ../FSComp.txt:459) + (Originally from ..\FSComp.txt:462) Unexpected identifier: '%s' - (Originally from ../FSComp.txt:429) + (Originally from ..\FSComp.txt:432) Unexpected end of input in 'match' or 'try' expression - (Originally from ../FSComp.txt:1254) + (Originally from ..\FSComp.txt:1271) Unexpected end of input in 'while' expression. Expected 'while <expr> do <expr>'. - (Originally from ../FSComp.txt:1252) + (Originally from ..\FSComp.txt:1269) Unexpected end of input in type signature - (Originally from ../FSComp.txt:1259) + (Originally from ..\FSComp.txt:1276) Unexpected end of input in type definition - (Originally from ../FSComp.txt:1260) + (Originally from ..\FSComp.txt:1277) Unexpected end of input in type arguments - (Originally from ../FSComp.txt:1258) + (Originally from ..\FSComp.txt:1275) Unexpected end of input in 'try' expression. Expected 'try <expr> with <rules>' or 'try <expr> finally <expr>'. - (Originally from ../FSComp.txt:1251) + (Originally from ..\FSComp.txt:1268) Unexpected end of input in 'then' branch of conditional expression. Expected 'if <expr> then <expr>' or 'if <expr> then <expr> else <expr>'. - (Originally from ../FSComp.txt:1255) + (Originally from ..\FSComp.txt:1272) Unexpected end of input in object members - (Originally from ../FSComp.txt:1261) + (Originally from ..\FSComp.txt:1278) Unexpected end of input in 'match' expression. Expected 'match <expr> with | <pat> -> <expr> | <pat> -> <expr> ...'. - (Originally from ../FSComp.txt:1250) + (Originally from ..\FSComp.txt:1267) Unexpected end of input in body of lambda expression. Expected 'fun <pat> ... <pat> -> <expr>'. - (Originally from ../FSComp.txt:1257) + (Originally from ..\FSComp.txt:1274) Unexpected end of input in 'for' expression. Expected 'for <pat> in <expr> do <expr>'. - (Originally from ../FSComp.txt:1253) + (Originally from ..\FSComp.txt:1270) Unexpected end of input in expression - (Originally from ../FSComp.txt:1263) + (Originally from ..\FSComp.txt:1280) Unexpected end of input in 'else' branch of conditional expression. Expected 'if <expr> then <expr>' or 'if <expr> then <expr> else <expr>'. - (Originally from ../FSComp.txt:1256) + (Originally from ..\FSComp.txt:1273) Unexpected end of input in value, function or member definition - (Originally from ../FSComp.txt:1262) + (Originally from ..\FSComp.txt:1279) Unexpected end of input - (Originally from ../FSComp.txt:390) + (Originally from ..\FSComp.txt:393) Unexpected empty type moduleDefn list - (Originally from ../FSComp.txt:402) + (Originally from ..\FSComp.txt:405) '_' cannot be used as field name - (Originally from ../FSComp.txt:1319) + (Originally from ..\FSComp.txt:1336) Unclosed block - (Originally from ../FSComp.txt:399) + (Originally from ..\FSComp.txt:402) Type name cannot be empty. - (Originally from ../FSComp.txt:1307) + (Originally from ..\FSComp.txt:1324) Type annotations on property getters and setters must be given after the 'get()' or 'set(v)', e.g. 'with get() : string = ...' - (Originally from ../FSComp.txt:415) + (Originally from ..\FSComp.txt:418) Accessibility modifiers are not permitted in this position for type abbreviations - (Originally from ../FSComp.txt:425) + (Originally from ..\FSComp.txt:428) The syntax 'module ... = struct .. end' is not used in F# code. Consider using 'module ... = begin .. end' - (Originally from ../FSComp.txt:470) + (Originally from ..\FSComp.txt:473) The syntax 'module ... : sig .. end' is not used in F# code. Consider using 'module ... = begin .. end' - (Originally from ../FSComp.txt:471) + (Originally from ..\FSComp.txt:474) Syntax error in labelled type argument - (Originally from ../FSComp.txt:458) + (Originally from ..\FSComp.txt:461) Syntax error - (Originally from ../FSComp.txt:405) + (Originally from ..\FSComp.txt:408) Successive patterns should be separated by spaces or tupled - (Originally from ../FSComp.txt:437) + (Originally from ..\FSComp.txt:440) Successive arguments should be separated by spaces or tupled, and arguments involving function or method applications should be parenthesized - (Originally from ../FSComp.txt:446) + (Originally from ..\FSComp.txt:449) A setter property may have at most two argument groups - (Originally from ../FSComp.txt:1059) + (Originally from ..\FSComp.txt:1062) Property setters must be defined using 'set value = ', 'set idx value = ' or 'set (idx1,...,idxN) value = ... ' - (Originally from ../FSComp.txt:418) + (Originally from ..\FSComp.txt:421) Accessibility modifiers are not permitted on record fields. Use 'type R = internal ...' or 'type R = private ...' to give an accessibility to the whole representation. - (Originally from ../FSComp.txt:434) + (Originally from ..\FSComp.txt:437) In F# code you may use 'expr.[expr]'. A type annotation may be required to indicate the first expression is an array - (Originally from ../FSComp.txt:449) + (Originally from ..\FSComp.txt:452) At most one 'with' augmentation is permitted - (Originally from ../FSComp.txt:388) + (Originally from ..\FSComp.txt:391) Only '#' compiler directives may occur prior to the first 'namespace' declaration - (Originally from ../FSComp.txt:392) + (Originally from ..\FSComp.txt:395) Only class types may take value arguments - (Originally from ../FSComp.txt:411) + (Originally from ..\FSComp.txt:414) The use of the type syntax 'int C' and 'C <int>' is not permitted here. Consider adjusting this type to be written in the form 'C<int>' - (Originally from ../FSComp.txt:1065) + (Originally from ..\FSComp.txt:1068) Remove spaces between the type name and type parameter, e.g. \"type C<'T>\", not type \"C <'T>\". Type parameters must be placed directly adjacent to the type name. - (Originally from ../FSComp.txt:1063) + (Originally from ..\FSComp.txt:1066) Remove spaces between the type name and type parameter, e.g. \"C<'T>\", not \"C <'T>\". Type parameters must be placed directly adjacent to the type name. - (Originally from ../FSComp.txt:1064) + (Originally from ..\FSComp.txt:1067) No matching 'in' found for this 'let' - (Originally from ../FSComp.txt:438) + (Originally from ..\FSComp.txt:441) No #endif found for #if or #else - (Originally from ../FSComp.txt:383) + (Originally from ..\FSComp.txt:386) No '=' symbol should follow a 'namespace' declaration - (Originally from ../FSComp.txt:469) + (Originally from ..\FSComp.txt:472) + + + + + This member access is ambiguous. Please use parentheses around the object creation, e.g. '(new SomeType(args)).MemberName' + (Originally from ..\FSComp.txt:1610) Files should begin with either a namespace or module declaration, e.g. 'namespace SomeNamespace.SubNamespace' or 'module SomeNamespace.SomeModule', but not both. To define a module within a namespace use 'module SomeModule = ...' - (Originally from ../FSComp.txt:394) + (Originally from ..\FSComp.txt:397) To indicate that this property can be set, use 'member val PropertyName = expr with get,set'. - (Originally from ../FSComp.txt:1283) + (Originally from ..\FSComp.txt:1300) Property definitions may not be declared mutable. To indicate that this property can be set, use 'member val PropertyName = expr with get,set'. - (Originally from ../FSComp.txt:1282) + (Originally from ..\FSComp.txt:1299) Multiple accessibilities given for property getter or setter - (Originally from ../FSComp.txt:417) + (Originally from ..\FSComp.txt:420) The syntax '(typ,...,typ) ident' is not used in F# code. Consider using 'ident<typ,...,typ>' instead - (Originally from ../FSComp.txt:460) + (Originally from ..\FSComp.txt:463) A module name must be a simple name, not a path - (Originally from ../FSComp.txt:401) + (Originally from ..\FSComp.txt:404) A module abbreviation must be a simple name, not a path - (Originally from ../FSComp.txt:395) + (Originally from ..\FSComp.txt:398) Expected type argument or static argument - (Originally from ../FSComp.txt:1109) + (Originally from ..\FSComp.txt:1120) Missing qualification after '.' - (Originally from ../FSComp.txt:448) + (Originally from ..\FSComp.txt:451) Unmatched '<'. Expected closing '>' - (Originally from ../FSComp.txt:1110) + (Originally from ..\FSComp.txt:1121) Missing function body - (Originally from ../FSComp.txt:457) + (Originally from ..\FSComp.txt:460) Mismatched quotation, beginning with '%s' - (Originally from ../FSComp.txt:450) + (Originally from ..\FSComp.txt:453) Mismatched quotation operator name, beginning with '%s' - (Originally from ../FSComp.txt:465) + (Originally from ..\FSComp.txt:468) This member is not permitted in an object implementation - (Originally from ../FSComp.txt:456) + (Originally from ..\FSComp.txt:459) The declaration form 'let ... and ...' for non-recursive bindings is not used in F# code. Consider using a sequence of 'let' bindings - (Originally from ../FSComp.txt:435) + (Originally from ..\FSComp.txt:438) Invalid use of 'rec' keyword - (Originally from ../FSComp.txt:1359) + (Originally from ..\FSComp.txt:1376) Invalid property getter or setter - (Originally from ../FSComp.txt:1060) + (Originally from ..\FSComp.txt:1063) Invalid operator definition. Prefix operator definitions must use a valid prefix operator name. - (Originally from ../FSComp.txt:1084) + (Originally from ..\FSComp.txt:1094) Invalid prefix operator - (Originally from ../FSComp.txt:1083) + (Originally from ..\FSComp.txt:1093) Invalid literal in type - (Originally from ../FSComp.txt:461) + (Originally from ..\FSComp.txt:464) Invalid declaration syntax - (Originally from ../FSComp.txt:413) + (Originally from ..\FSComp.txt:416) Invalid anonymous record type - (Originally from ../FSComp.txt:1486) + (Originally from ..\FSComp.txt:1505) Invalid anonymous record expression - (Originally from ../FSComp.txt:1485) + (Originally from ..\FSComp.txt:1504) Interfaces always have the same visibility as the enclosing type - (Originally from ../FSComp.txt:419) + (Originally from ..\FSComp.txt:422) An integer for loop must use a simple identifier - (Originally from ../FSComp.txt:387) + (Originally from ..\FSComp.txt:390) Accessibility modifiers are not permitted on inline assembly code types - (Originally from ../FSComp.txt:428) + (Originally from ..\FSComp.txt:431) 'inherit' declarations cannot have 'as' bindings. To access members of the base class when overriding a method, the syntax 'base.SomeMember' may be used; 'base' is a keyword. Remove this 'as' binding. - (Originally from ../FSComp.txt:423) + (Originally from ..\FSComp.txt:426) An indexer property must be given at least one argument - (Originally from ../FSComp.txt:1061) + (Originally from ..\FSComp.txt:1064) Incomplete conditional. Expected 'if <expr> then <expr>' or 'if <expr> then <expr> else <expr>'. - (Originally from ../FSComp.txt:441) + (Originally from ..\FSComp.txt:444) 'in' or '=' expected - (Originally from ../FSComp.txt:444) + (Originally from ..\FSComp.txt:447) Neither 'member val' nor 'override val' definitions are permitted in object expressions. - (Originally from ../FSComp.txt:1317) + (Originally from ..\FSComp.txt:1334) Denominator must not be 0 in unit-of-measure exponent - (Originally from ../FSComp.txt:468) + (Originally from ..\FSComp.txt:471) The '%s' visibility attribute is not allowed on module abbreviation. Module abbreviations are always private. - (Originally from ../FSComp.txt:398) + (Originally from ..\FSComp.txt:401) The '%s' accessibility attribute is not allowed on module abbreviation. Module abbreviations are always private. - (Originally from ../FSComp.txt:397) + (Originally from ..\FSComp.txt:400) Ignoring attributes on module abbreviation - (Originally from ../FSComp.txt:396) + (Originally from ..\FSComp.txt:399) Identifier expected - (Originally from ../FSComp.txt:443) + (Originally from ..\FSComp.txt:446) A getter property is expected to be a function, e.g. 'get() = ...' or 'get(index) = ...' - (Originally from ../FSComp.txt:416) + (Originally from ..\FSComp.txt:419) A getter property may have at most one argument group - (Originally from ../FSComp.txt:1058) + (Originally from ..\FSComp.txt:1061) 'get', 'set' or 'get,set' required - (Originally from ../FSComp.txt:410) + (Originally from ..\FSComp.txt:413) 'get' and/or 'set' required - (Originally from ../FSComp.txt:414) + (Originally from ..\FSComp.txt:417) Missing 'do' in 'for' expression. Expected 'for <pat> in <expr> do <expr>'. - (Originally from ../FSComp.txt:1270) + (Originally from ..\FSComp.txt:1287) Field bindings must have the form 'id = expr;' - (Originally from ../FSComp.txt:455) + (Originally from ..\FSComp.txt:458) Expected a type after this point - (Originally from ../FSComp.txt:1248) + (Originally from ..\FSComp.txt:1265) Unexpected end of type. Expected a name after this point. - (Originally from ../FSComp.txt:1264) + (Originally from ..\FSComp.txt:1281) Expected an expression after this point - (Originally from ../FSComp.txt:1247) + (Originally from ..\FSComp.txt:1264) The block following this '%s' is unfinished. Every code block is an expression and must have a result. '%s' cannot be the final code element in a block. Consider giving this block an explicit result. - (Originally from ../FSComp.txt:440) + (Originally from ..\FSComp.txt:443) Attempted to parse this as an operator name, but failed - (Originally from ../FSComp.txt:1112) + (Originally from ..\FSComp.txt:1123) Error in the return expression for this 'let'. Possible incorrect indentation. - (Originally from ../FSComp.txt:439) + (Originally from ..\FSComp.txt:442) Unexpected token in type definition. Expected '=' after the type '%s'. - (Originally from ../FSComp.txt:1505) + (Originally from ..\FSComp.txt:1524) End of file in verbatim string embedded in comment begun at or before here - (Originally from ../FSComp.txt:380) + (Originally from ..\FSComp.txt:383) End of file in verbatim string begun at or before here - (Originally from ../FSComp.txt:377) + (Originally from ..\FSComp.txt:380) End of file in triple-quote string embedded in comment begun at or before here - (Originally from ../FSComp.txt:1107) + (Originally from ..\FSComp.txt:1118) End of file in triple-quote string begun at or before here - (Originally from ../FSComp.txt:1106) + (Originally from ..\FSComp.txt:1117) End of file in string embedded in comment begun at or before here - (Originally from ../FSComp.txt:379) + (Originally from ..\FSComp.txt:382) End of file in string begun at or before here - (Originally from ../FSComp.txt:376) + (Originally from ..\FSComp.txt:379) Incomplete interpolated verbatim string begun at or before here - (Originally from ../FSComp.txt:1546) + (Originally from ..\FSComp.txt:1586) Incomplete interpolated triple-quote string begun at or before here - (Originally from ../FSComp.txt:1547) + (Originally from ..\FSComp.txt:1587) Incomplete interpolated string expression fill begun at or before here - (Originally from ../FSComp.txt:1544) + (Originally from ..\FSComp.txt:1584) Incomplete interpolated string begun at or before here - (Originally from ../FSComp.txt:1545) + (Originally from ..\FSComp.txt:1585) End of file in IF-OCAML section begun at or before here - (Originally from ../FSComp.txt:381) + (Originally from ..\FSComp.txt:384) End of file in #if section begun at or after here - (Originally from ../FSComp.txt:375) + (Originally from ..\FSComp.txt:378) End of file in directive begun at or before here - (Originally from ../FSComp.txt:382) + (Originally from ..\FSComp.txt:385) End of file in comment begun at or before here - (Originally from ../FSComp.txt:378) + (Originally from ..\FSComp.txt:381) Accessibility modifiers are not permitted in this position for enum types - (Originally from ../FSComp.txt:426) + (Originally from ..\FSComp.txt:429) Accessibility modifiers are not permitted on enumeration fields - (Originally from ../FSComp.txt:432) + (Originally from ..\FSComp.txt:435) A type definition requires one or more members or other declarations. If you intend to define an empty class, struct or interface, then use 'type ... = class end', 'interface end' or 'struct end'. - (Originally from ../FSComp.txt:408) + (Originally from ..\FSComp.txt:411) Invalid interpolated string. This interpolated string expression fill is empty, an expression was expected. - (Originally from ../FSComp.txt:1548) + (Originally from ..\FSComp.txt:1588) Accessibility modifiers are not permitted on 'do' bindings, but '%s' was given. - (Originally from ../FSComp.txt:374) + (Originally from ..\FSComp.txt:377) Consider using a separate record type instead - (Originally from ../FSComp.txt:433) + (Originally from ..\FSComp.txt:436) Augmentations are not permitted on delegate type moduleDefns - (Originally from ../FSComp.txt:406) + (Originally from ..\FSComp.txt:409) Attributes should be placed before 'val' - (Originally from ../FSComp.txt:403) + (Originally from ..\FSComp.txt:406) Attributes are not permitted on 'inherit' declarations - (Originally from ../FSComp.txt:421) + (Originally from ..\FSComp.txt:424) Attributes are not allowed here - (Originally from ../FSComp.txt:424) + (Originally from ..\FSComp.txt:427) Attributes have been ignored in this construct - (Originally from ../FSComp.txt:384) + (Originally from ..\FSComp.txt:387) Attributes are not permitted on interface implementations - (Originally from ../FSComp.txt:404) + (Originally from ..\FSComp.txt:407) Cannot find code target for this attribute, possibly because the code after the attribute is incomplete. - (Originally from ../FSComp.txt:1306) + (Originally from ..\FSComp.txt:1323) 'assert' may not be used as a first class value. Use 'assert <expr>' instead. - (Originally from ../FSComp.txt:442) + (Originally from ..\FSComp.txt:445) The use of '->' in sequence and computation expressions is limited to the form 'for pat in expr -> expr'. Use the syntax 'for ... in ... do ... yield...' to generate elements in more complex sequence expressions. - (Originally from ../FSComp.txt:445) + (Originally from ..\FSComp.txt:448) All enum fields must be given values - (Originally from ../FSComp.txt:427) + (Originally from ..\FSComp.txt:430) Active pattern case identifiers must begin with an uppercase letter - (Originally from ../FSComp.txt:466) + (Originally from ..\FSComp.txt:469) The '|' character is not permitted in active pattern case identifiers - (Originally from ../FSComp.txt:467) + (Originally from ..\FSComp.txt:470) Accessibility modifiers are not allowed on this member. Abstract slots always have the same visibility as the enclosing type. - (Originally from ../FSComp.txt:420) + (Originally from ..\FSComp.txt:423) Package manager key '%s' was not registered in %s. Currently registered: %s - (Originally from ../FSComp.txt:1371) + (Originally from ..\FSComp.txt:1388) %s - (Originally from ../FSComp.txt:1372) + (Originally from ..\FSComp.txt:1389) The package management feature requires language version 5.0 use /langversion:preview - (Originally from ../FSComp.txt:1495) + (Originally from ..\FSComp.txt:1514) Write the xmldoc of the assembly to the given file - (Originally from ../FSComp.txt:847) + (Originally from ..\FSComp.txt:850) Specify a Win32 resource file (.res) - (Originally from ../FSComp.txt:858) + (Originally from ..\FSComp.txt:861) Specify a Win32 manifest file - (Originally from ../FSComp.txt:859) + (Originally from ..\FSComp.txt:862) Specify a Win32 icon file (.ico) - (Originally from ../FSComp.txt:857) + (Originally from ..\FSComp.txt:860) Report all warnings as errors - (Originally from ../FSComp.txt:876) + (Originally from ..\FSComp.txt:879) Report specific warnings as errors - (Originally from ../FSComp.txt:877) + (Originally from ..\FSComp.txt:880) Enable specific warnings that may be off by default - (Originally from ../FSComp.txt:880) + (Originally from ..\FSComp.txt:883) Set a warning level (0-5) - (Originally from ../FSComp.txt:878) + (Originally from ..\FSComp.txt:881) Display compiler version banner and exit - (Originally from ../FSComp.txt:886) + (Originally from ..\FSComp.txt:889) Output messages in UTF-8 encoding - (Originally from ../FSComp.txt:889) + (Originally from ..\FSComp.txt:892) Enable high-entropy ASLR - (Originally from ../FSComp.txt:922) + (Originally from ..\FSComp.txt:925) Unrecognized target '%s', expected 'exe', 'winexe', 'library' or 'module' - (Originally from ../FSComp.txt:900) + (Originally from ..\FSComp.txt:903) Unrecognized value '%s' for --langversion use --langversion:? for complete list - (Originally from ../FSComp.txt:74) + (Originally from ..\FSComp.txt:77) Unrecognized debug type '%s', expected 'pdbonly' or 'full' - (Originally from ../FSComp.txt:901) + (Originally from ..\FSComp.txt:904) Unrecognized platform '%s', valid values are 'x86', 'x64', 'Itanium', 'anycpu32bitpreferred', and 'anycpu' - (Originally from ../FSComp.txt:915) + (Originally from ..\FSComp.txt:918) Algorithm '%s' is not supported - (Originally from ../FSComp.txt:916) + (Originally from ..\FSComp.txt:919) Unknown --test argument: '%s' - (Originally from ../FSComp.txt:914) + (Originally from ..\FSComp.txt:917) Specify target framework profile of this assembly. Valid values are mscorlib, netcore or netstandard. Default - mscorlib - (Originally from ../FSComp.txt:924) + (Originally from ..\FSComp.txt:927) Enable or disable tailcalls - (Originally from ../FSComp.txt:872) + (Originally from ..\FSComp.txt:875) Supported language versions: - (Originally from ../FSComp.txt:1508) + (Originally from ..\FSComp.txt:1527) Specify subsystem version of this assembly - (Originally from ../FSComp.txt:923) + (Originally from ..\FSComp.txt:926) Specify a strong name key file - (Originally from ../FSComp.txt:848) + (Originally from ..\FSComp.txt:851) Specify a strong name key container - (Originally from ../FSComp.txt:849) + (Originally from ..\FSComp.txt:852) Statically link the given assembly and all referenced DLLs that depend on this assembly. Use an assembly name e.g. mylib, not a DLL name. - (Originally from ../FSComp.txt:896) + (Originally from ..\FSComp.txt:899) Statically link the F# library and all referenced DLLs that depend on it into the assembly being generated - (Originally from ../FSComp.txt:895) + (Originally from ..\FSComp.txt:898) --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - (Originally from ../FSComp.txt:865) + (Originally from ..\FSComp.txt:868) Source link information file to embed in the portable PDB file - (Originally from ../FSComp.txt:863) + (Originally from ..\FSComp.txt:866) Resolve assembly references using directory-based rules rather than MSBuild resolution - (Originally from ../FSComp.txt:899) + (Originally from ..\FSComp.txt:902) Print the inferred interface of the assembly to a file - (Originally from ../FSComp.txt:853) + (Originally from ..\FSComp.txt:856) Short form of '%s' - (Originally from ../FSComp.txt:903) + (Originally from ..\FSComp.txt:906) Response file '%s' not found in '%s' - (Originally from ../FSComp.txt:1348) + (Originally from ..\FSComp.txt:1365) Response file name '%s' is empty, contains invalid characters, has a drive specification without an absolute path, or is too long - (Originally from ../FSComp.txt:1349) + (Originally from ..\FSComp.txt:1366) Read response file for more options - (Originally from ../FSComp.txt:887) + (Originally from ..\FSComp.txt:890) Embed the specified managed resource - (Originally from ../FSComp.txt:867) + (Originally from ..\FSComp.txt:870) Use a resident background compilation service to improve compiler startup times. - (Originally from ../FSComp.txt:897) + (Originally from ..\FSComp.txt:900) Reference an assembly (Short form: -r) - (Originally from ../FSComp.txt:855) + (Originally from ..\FSComp.txt:858) Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed - (Originally from ../FSComp.txt:846) + (Originally from ..\FSComp.txt:849) Problem with codepage '%d': %s - (Originally from ../FSComp.txt:837) + (Originally from ..\FSComp.txt:840) Specify the preferred output language culture name (e.g. es-ES, ja-JP) - (Originally from ../FSComp.txt:926) + (Originally from ..\FSComp.txt:929) Limit which platforms this code can run on: x86, Itanium, x64, anycpu32bitpreferred, or anycpu. The default is anycpu. - (Originally from ../FSComp.txt:850) + (Originally from ..\FSComp.txt:853) Name the output debug file - (Originally from ../FSComp.txt:898) + (Originally from ..\FSComp.txt:901) Maps physical paths to source path names output by the compiler - (Originally from ../FSComp.txt:874) + (Originally from ..\FSComp.txt:877) Enable optimizations (Short form: -O) - (Originally from ../FSComp.txt:871) + (Originally from ..\FSComp.txt:874) Do not include the default Win32 manifest - (Originally from ../FSComp.txt:860) + (Originally from ..\FSComp.txt:863) Disable specific warning messages - (Originally from ../FSComp.txt:879) + (Originally from ..\FSComp.txt:882) Suppress compiler copyright message - (Originally from ../FSComp.txt:884) + (Originally from ..\FSComp.txt:887) Do not reference the default CLI assemblies by default - (Originally from ../FSComp.txt:894) + (Originally from ..\FSComp.txt:897) Only include optimization information essential for implementing inlined constructs. Inhibits cross-module inlining but improves binary compatibility. - (Originally from ../FSComp.txt:851) + (Originally from ..\FSComp.txt:854) Don't add a resource to the generated assembly containing F#-specific metadata - (Originally from ../FSComp.txt:852) + (Originally from ..\FSComp.txt:855) Don't copy FSharp.Core.dll along the produced binaries - (Originally from ../FSComp.txt:927) + (Originally from ..\FSComp.txt:930) Name of the output file (Short form: -o) - (Originally from ../FSComp.txt:840) + (Originally from ..\FSComp.txt:843) Ignore ML compatibility warnings - (Originally from ../FSComp.txt:883) + (Originally from ..\FSComp.txt:886) Link the specified resource to this assembly where the resinfo format is <file>[,<string name>[,public|private]] - (Originally from ../FSComp.txt:868) + (Originally from ..\FSComp.txt:871) Specify a directory for the include path which is used to resolve source files and assemblies (Short form: -I) - (Originally from ../FSComp.txt:891) + (Originally from ..\FSComp.txt:894) Display the allowed values for language version, specify language version such as 'latest' or 'preview' - (Originally from ../FSComp.txt:1507) + (Originally from ..\FSComp.txt:1526) Invalid warning level '%d' - (Originally from ../FSComp.txt:902) + (Originally from ..\FSComp.txt:905) Invalid value '%s' for '--targetprofile', valid values are 'mscorlib', 'netcore' or 'netstandard'. - (Originally from ../FSComp.txt:929) + (Originally from ..\FSComp.txt:932) Invalid version '%s' for '--subsystemversion'. The version must be 4.00 or greater. - (Originally from ../FSComp.txt:928) + (Originally from ..\FSComp.txt:931) Invalid response file '%s' ( '%s' ) - (Originally from ../FSComp.txt:1347) + (Originally from ..\FSComp.txt:1364) Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - (Originally from ../FSComp.txt:1159) + (Originally from ..\FSComp.txt:1170) The command-line option '%s' is for test purposes only - (Originally from ../FSComp.txt:917) + (Originally from ..\FSComp.txt:920) - RESOURCES - - (Originally from ../FSComp.txt:908) + (Originally from ..\FSComp.txt:911) - OUTPUT FILES - - (Originally from ../FSComp.txt:906) + (Originally from ..\FSComp.txt:909) - MISCELLANEOUS - - (Originally from ../FSComp.txt:911) + (Originally from ..\FSComp.txt:914) - LANGUAGE - - (Originally from ../FSComp.txt:912) + (Originally from ..\FSComp.txt:915) - INPUT FILES - - (Originally from ../FSComp.txt:907) + (Originally from ..\FSComp.txt:910) - ERRORS AND WARNINGS - - (Originally from ../FSComp.txt:913) + (Originally from ..\FSComp.txt:916) - CODE GENERATION - - (Originally from ../FSComp.txt:909) + (Originally from ..\FSComp.txt:912) - ADVANCED - - (Originally from ../FSComp.txt:910) + (Originally from ..\FSComp.txt:913) Display this usage message (Short form: -?) - (Originally from ../FSComp.txt:885) + (Originally from ..\FSComp.txt:888) Output messages with fully qualified paths - (Originally from ../FSComp.txt:890) + (Originally from ..\FSComp.txt:893) Emit debug information in quotations - (Originally from ../FSComp.txt:925) + (Originally from ..\FSComp.txt:928) --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - (Originally from ../FSComp.txt:864) + (Originally from ..\FSComp.txt:867) Embed specific source files in the portable PDB file - (Originally from ../FSComp.txt:862) + (Originally from ..\FSComp.txt:865) Embed all source files in the portable PDB file - (Originally from ../FSComp.txt:861) + (Originally from ..\FSComp.txt:864) Produce a deterministic assembly (including module version GUID and timestamp) - (Originally from ../FSComp.txt:873) + (Originally from ..\FSComp.txt:876) Delay-sign the assembly using only the public portion of the strong name key - (Originally from ../FSComp.txt:845) + (Originally from ..\FSComp.txt:848) Define conditional compilation symbols (Short form: -d) - (Originally from ../FSComp.txt:882) + (Originally from ..\FSComp.txt:885) Emit debug information (Short form: -g) - (Originally from ../FSComp.txt:869) + (Originally from ..\FSComp.txt:872) Specify debugging type: full, portable, embedded, pdbonly. ('%s' is the default if no debuggging type specified and enables attaching a debugger to a running program, 'portable' is a cross-platform format, 'embedded' is a cross-platform format embedded into the output file). - (Originally from ../FSComp.txt:870) + (Originally from ..\FSComp.txt:873) The command-line option '%s' has been deprecated - (Originally from ../FSComp.txt:918) + (Originally from ..\FSComp.txt:921) The command-line option '%s' has been deprecated. HTML document generation is now part of the F# Power Pack, via the tool FsHtmlDoc.exe. - (Originally from ../FSComp.txt:920) + (Originally from ..\FSComp.txt:923) The command-line option '%s' has been deprecated. Use '%s' instead. - (Originally from ../FSComp.txt:919) + (Originally from ..\FSComp.txt:922) Enable or disable cross-module optimizations - (Originally from ../FSComp.txt:875) + (Originally from ..\FSComp.txt:878) Freely distributed under the MIT Open Source License. https://github.com/Microsoft/visualfsharp/blob/master/License.txt - (Originally from ../FSComp.txt:839) + (Originally from ..\FSComp.txt:842) Copyright (c) Microsoft Corporation. All Rights Reserved. - (Originally from ../FSComp.txt:838) + (Originally from ..\FSComp.txt:841) Output warning and error messages in color - (Originally from ../FSComp.txt:921) + (Originally from ..\FSComp.txt:924) Reference an assembly or directory containing a design time tool (Short form: -t) - (Originally from ../FSComp.txt:856) + (Originally from ..\FSComp.txt:859) Specify the codepage used to read source files - (Originally from ../FSComp.txt:888) + (Originally from ..\FSComp.txt:891) Use to override where the compiler looks for mscorlib.dll and framework components - (Originally from ../FSComp.txt:905) + (Originally from ..\FSComp.txt:908) The command-line option '--cliroot' has been deprecated. Use an explicit reference to a specific copy of mscorlib.dll instead. - (Originally from ../FSComp.txt:904) + (Originally from ..\FSComp.txt:907) Specify algorithm for calculating source file checksum stored in PDB. Supported values are: SHA1 or SHA256 (default) - (Originally from ../FSComp.txt:893) + (Originally from ..\FSComp.txt:896) Generate overflow checks - (Originally from ../FSComp.txt:881) + (Originally from ..\FSComp.txt:884) Build a Windows executable - (Originally from ../FSComp.txt:842) + (Originally from ..\FSComp.txt:845) Build a module that can be added to another assembly - (Originally from ../FSComp.txt:844) + (Originally from ..\FSComp.txt:847) Build a library (Short form: -a) - (Originally from ../FSComp.txt:843) + (Originally from ..\FSComp.txt:846) Build a console executable - (Originally from ../FSComp.txt:841) + (Originally from ..\FSComp.txt:844) Base address for the library to be built - (Originally from ../FSComp.txt:892) + (Originally from ..\FSComp.txt:895) Print the inferred interfaces of all compilation files to associated signature files - (Originally from ../FSComp.txt:854) + (Originally from ..\FSComp.txt:857) A value marked as 'inline' has an unexpected value - (Originally from ../FSComp.txt:984) + (Originally from ..\FSComp.txt:987) A value marked as 'inline' could not be inlined - (Originally from ../FSComp.txt:985) + (Originally from ..\FSComp.txt:988) The value '%s' was marked inline but was not bound in the optimization environment - (Originally from ../FSComp.txt:982) + (Originally from ..\FSComp.txt:985) The value '%s' was marked inline but its implementation makes use of an internal or private function which is not sufficiently accessible - (Originally from ../FSComp.txt:981) + (Originally from ..\FSComp.txt:984) Recursive ValValue %s - (Originally from ../FSComp.txt:987) + (Originally from ..\FSComp.txt:990) Local value %s not found during optimization - (Originally from ../FSComp.txt:983) + (Originally from ..\FSComp.txt:986) Failed to inline the value '%s' marked 'inline', perhaps because a recursive value was marked 'inline' - (Originally from ../FSComp.txt:986) + (Originally from ..\FSComp.txt:989) + + + + + The value '%s' was marked 'InlineIfLambda' but was not determined to have a lambda value. This warning is for informational purposes only. + (Originally from ..\FSComp.txt:1631) The union type for union case '%s' was defined with the RequireQualifiedAccessAttribute. Include the name of the union type ('%s') in the name you are using. - (Originally from ../FSComp.txt:1001) + (Originally from ..\FSComp.txt:1004) Unexpected empty long identifier - (Originally from ../FSComp.txt:996) + (Originally from ..\FSComp.txt:999) Multiple types exist called '%s', taking different numbers of generic parameters. Provide a type instantiation to disambiguate the type resolution, e.g. '%s'. - (Originally from ../FSComp.txt:992) + (Originally from ..\FSComp.txt:995) The instantiation of the generic type '%s' is missing and can't be inferred from the arguments or return type of this member. Consider providing a type instantiation when accessing this type, e.g. '%s'. - (Originally from ../FSComp.txt:993) + (Originally from ..\FSComp.txt:996) The record type for the record field '%s' was defined with the RequireQualifiedAccessAttribute. Include the name of the record type ('%s') in the name you are using. - (Originally from ../FSComp.txt:1002) + (Originally from ..\FSComp.txt:1005) The record type '%s' does not contain a label '%s'. - (Originally from ../FSComp.txt:997) + (Originally from ..\FSComp.txt:1000) No constructors are available for the type '%s' - (Originally from ../FSComp.txt:1000) + (Originally from ..\FSComp.txt:1003) This is not a constructor or literal, or a constructor is being used incorrectly - (Originally from ../FSComp.txt:995) + (Originally from ..\FSComp.txt:998) Invalid module/expression/type - (Originally from ../FSComp.txt:991) + (Originally from ..\FSComp.txt:994) Invalid field label - (Originally from ../FSComp.txt:998) + (Originally from ..\FSComp.txt:1001) Invalid expression '%s' - (Originally from ../FSComp.txt:999) + (Originally from ..\FSComp.txt:1002) 'global' may only be used as the first name in a qualified path - (Originally from ../FSComp.txt:994) + (Originally from ..\FSComp.txt:997) + + + + + This value is not a function and cannot be applied. Did you intend to access the indexer via '%s[index]'? + (Originally from ..\FSComp.txt:1477) - This value is not a function and cannot be applied. Did you intend to access the indexer via %s.[index] instead? - (Originally from ../FSComp.txt:1458) + This value is not a function and cannot be applied. Did you intend to access the indexer via '%s.[index]'? + (Originally from ..\FSComp.txt:1475) - (Originally from ../FSComp.txt:1460) + (Originally from ..\FSComp.txt:1479) + + + + + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + (Originally from ..\FSComp.txt:1478) - This expression is not a function and cannot be applied. Did you intend to access the indexer via expr.[index] instead? - (Originally from ../FSComp.txt:1459) + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr.[index]'? + (Originally from ..\FSComp.txt:1476) This value is not a function and cannot be applied. Did you forget to terminate a declaration? - (Originally from ../FSComp.txt:1461) + (Originally from ..\FSComp.txt:1480) This value is not a function and cannot be applied. - (Originally from ../FSComp.txt:1457) + (Originally from ..\FSComp.txt:1474) No Invoke methods found for delegate type - (Originally from ../FSComp.txt:967) + (Originally from ..\FSComp.txt:970) Files in libraries or multiple-file applications must begin with a namespace or module declaration. When using a module declaration at the start of a file the '=' sign is not allowed. If this is a top-level module, consider removing the = to resolve this error. - (Originally from ../FSComp.txt:49) + (Originally from ..\FSComp.txt:50) + %d overloads - (Originally from ../FSComp.txt:1303) + (Originally from ..\FSComp.txt:1320) + 1 overload - (Originally from ../FSComp.txt:1302) + (Originally from ..\FSComp.txt:1319) Resource header beginning at offset %s is malformed. - (Originally from ../FSComp.txt:1510) + (Originally from ..\FSComp.txt:1529) Stream does not begin with a null resource and is not in '.RES' format. - (Originally from ../FSComp.txt:1509) + (Originally from ..\FSComp.txt:1528) More than one Invoke method found for delegate type - (Originally from ../FSComp.txt:968) + (Originally from ..\FSComp.txt:971) + + + + + The use of 'module M = struct ... end ' was deprecated in F# 2.0 and is no longer supported. Remove the 'struct' and 'end' and use indentation instead + (Originally from ..\FSComp.txt:1089) + + + + + The use of 'module M = sig ... end ' was deprecated in F# 2.0 and is no longer supported. Remove the 'sig' and 'end' and use indentation instead + (Originally from ..\FSComp.txt:1087) + + + + + The use of 'module M: sig ... end ' was deprecated in F# 2.0 and is no longer supported. Change the ':' to an '=' and remove the 'sig' and 'end' and use indentation instead + (Originally from ..\FSComp.txt:1086) + + + + + The use of multiple parenthesized type parameters before a generic type name such as '(int, int) Map' was deprecated in F# 2.0 and is no longer supported + (Originally from ..\FSComp.txt:1088) This construct is for ML compatibility. %s. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'. - (Originally from ../FSComp.txt:1079) + (Originally from ..\FSComp.txt:1082) + + + + + The use of '#light \"off\"' or '#indent \"off\"' was deprecated in F# 2.0 and is no longer supported + (Originally from ..\FSComp.txt:1085) + + + + + In previous versions of F# '%s' was a reserved keyword but the use of this keyword is now deprecated + (Originally from ..\FSComp.txt:1084) + + + + + This construct is deprecated. %s. You can enable this feature by using '--langversion:5.0' and '--mlcompatibility'. + (Originally from ..\FSComp.txt:1083) This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type '%s'. - (Originally from ../FSComp.txt:23) + (Originally from ..\FSComp.txt:23) Method or object constructor '%s' is not static - (Originally from ../FSComp.txt:1369) + (Originally from ..\FSComp.txt:1386) Infix operator member '%s' has %d initial argument(s). Expected a tuple of 3 arguments - (Originally from ../FSComp.txt:1314) + (Originally from ..\FSComp.txt:1331) Infix operator member '%s' has %d initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... - (Originally from ../FSComp.txt:1044) + (Originally from ..\FSComp.txt:1047) Infix operator member '%s' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... - (Originally from ../FSComp.txt:1043) + (Originally from ..\FSComp.txt:1046) Infix operator member '%s' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... - (Originally from ../FSComp.txt:1045) + (Originally from ..\FSComp.txt:1048) (loading description...) - (Originally from ../FSComp.txt:1310) + (Originally from ..\FSComp.txt:1327) - All elements of a list must be of the same type as the first element, which here is '%s'. This element has type '%s'. - (Originally from ../FSComp.txt:21) + All elements of a list must be implicitly convertible to the type of the first element, which here is '%s'. This element has type '%s'. + (Originally from ..\FSComp.txt:21) Identifiers containing '@' are reserved for use in F# code generation - (Originally from ../FSComp.txt:972) + (Originally from ..\FSComp.txt:975) The identifier '%s' is reserved for future use by F# - (Originally from ../FSComp.txt:973) + (Originally from ..\FSComp.txt:976) Possible incorrect indentation: this token is offside of context started at position %s. Try indenting this token further or using standard formatting conventions. - (Originally from ../FSComp.txt:989) + (Originally from ..\FSComp.txt:992) The '|' tokens separating rules of this pattern match are misaligned by one column. Consider realigning your code or using further indentation. - (Originally from ../FSComp.txt:990) + (Originally from ..\FSComp.txt:993) The indentation of this 'in' token is incorrect with respect to the corresponding 'let' - (Originally from ../FSComp.txt:988) + (Originally from ..\FSComp.txt:991) Syntax error. Wrong nested #endif, unexpected tokens before it. - (Originally from ../FSComp.txt:1040) + (Originally from ..\FSComp.txt:1043) Unexpected character '%s' - (Originally from ../FSComp.txt:1009) + (Originally from ..\FSComp.txt:1012) Invalid interpolated string. Triple quote string literals may not be used in interpolated expressions. Consider using an explicit 'let' binding for the interpolation expression. - (Originally from ../FSComp.txt:1541) + (Originally from ..\FSComp.txt:1581) This token is reserved for future use - (Originally from ../FSComp.txt:1030) + (Originally from ..\FSComp.txt:1033) This Unicode encoding is only valid in string literals - (Originally from ../FSComp.txt:1029) + (Originally from ..\FSComp.txt:1032) TABs are not allowed in F# code unless the #indent \"off\" option is used - (Originally from ../FSComp.txt:1031) + (Originally from ..\FSComp.txt:1034) Invalid interpolated string. Single quote or verbatim string literals may not be used in interpolated expressions in single quote or verbatim strings. Consider using an explicit 'let' binding for the interpolation expression or use a triple quote string as the outer string literal. - (Originally from ../FSComp.txt:1540) + (Originally from ..\FSComp.txt:1580) A '}' character must be escaped (by doubling) in an interpolated string. - (Originally from ../FSComp.txt:1549) + (Originally from ..\FSComp.txt:1589) This number is outside the allowable range for 32-bit unsigned integers - (Originally from ../FSComp.txt:1018) + (Originally from ..\FSComp.txt:1021) This number is outside the allowable range for 32-bit signed integers - (Originally from ../FSComp.txt:1017) + (Originally from ..\FSComp.txt:1020) This number is outside the allowable range for 64-bit unsigned integers - (Originally from ../FSComp.txt:1020) + (Originally from ..\FSComp.txt:1023) This number is outside the allowable range for 64-bit signed integers - (Originally from ../FSComp.txt:1019) + (Originally from ..\FSComp.txt:1022) This number is outside the allowable range for 16-bit unsigned integers - (Originally from ../FSComp.txt:1016) + (Originally from ..\FSComp.txt:1019) This number is outside the allowable range for 16-bit signed integers - (Originally from ../FSComp.txt:1015) + (Originally from ..\FSComp.txt:1018) This number is outside the allowable range for unsigned native integers - (Originally from ../FSComp.txt:1022) + (Originally from ..\FSComp.txt:1025) This number is outside the allowable range for signed native integers - (Originally from ../FSComp.txt:1021) + (Originally from ..\FSComp.txt:1024) This number is outside the allowable range for this integer type - (Originally from ../FSComp.txt:1004) + (Originally from ..\FSComp.txt:1007) This number is outside the allowable range for 8-bit unsigned integers - (Originally from ../FSComp.txt:1014) + (Originally from ..\FSComp.txt:1017) This number is outside the allowable range for hexadecimal 8-bit signed integers - (Originally from ../FSComp.txt:1013) + (Originally from ..\FSComp.txt:1016) This number is outside the allowable range for 8-bit signed integers - (Originally from ../FSComp.txt:1012) + (Originally from ..\FSComp.txt:1015) This number is outside the allowable range for 32-bit floats - (Originally from ../FSComp.txt:1025) + (Originally from ..\FSComp.txt:1028) This number is outside the allowable range for decimal literals - (Originally from ../FSComp.txt:1024) + (Originally from ..\FSComp.txt:1027) \U%s is not a valid Unicode character escape sequence - (Originally from ../FSComp.txt:1113) + (Originally from ..\FSComp.txt:1124) This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int), 1u (uint32), 1L (int64), 1UL (uint64), 1s (int16), 1y (sbyte), 1uy (byte), 1.0 (float), 1.0f (float32), 1.0m (decimal), 1I (BigInteger). - (Originally from ../FSComp.txt:1026) + (Originally from ..\FSComp.txt:1029) Invalid line number: '%s' - (Originally from ../FSComp.txt:1032) + (Originally from ..\FSComp.txt:1035) Invalid floating point number - (Originally from ../FSComp.txt:1023) + (Originally from ..\FSComp.txt:1026) This is not a valid character literal - (Originally from ../FSComp.txt:1028) + (Originally from ..\FSComp.txt:1031) This is not a valid byte literal - (Originally from ../FSComp.txt:1027) + (Originally from ..\FSComp.txt:1030) Consider using a file with extension '.ml' or '.mli' instead - (Originally from ../FSComp.txt:1086) + (Originally from ..\FSComp.txt:1096) + + + + + IF-FSHARP/IF-CAML regions are no longer supported + (Originally from ..\FSComp.txt:1097) Identifiers followed by '%s' are reserved for future use - (Originally from ../FSComp.txt:1011) + (Originally from ..\FSComp.txt:1014) #if directive should be immediately followed by an identifier - (Originally from ../FSComp.txt:1039) + (Originally from ..\FSComp.txt:1042) #if directive must appear as the first non-whitespace character on a line - (Originally from ../FSComp.txt:1033) + (Originally from ..\FSComp.txt:1036) #endif has no matching #if - (Originally from ../FSComp.txt:1037) + (Originally from ..\FSComp.txt:1040) #endif required for #else - (Originally from ../FSComp.txt:1035) + (Originally from ..\FSComp.txt:1038) #endif directive must appear as the first non-whitespace character on a line - (Originally from ../FSComp.txt:1038) + (Originally from ..\FSComp.txt:1041) #else has no matching #if - (Originally from ../FSComp.txt:1034) + (Originally from ..\FSComp.txt:1037) #else directive must appear as the first non-whitespace character on a line - (Originally from ../FSComp.txt:1036) + (Originally from ..\FSComp.txt:1039) #! may only appear as the first line at the start of a file. - (Originally from ../FSComp.txt:1041) + (Originally from ..\FSComp.txt:1044) '%s' is not permitted as a character in operator names and is reserved for future use - (Originally from ../FSComp.txt:1008) + (Originally from ..\FSComp.txt:1011) a byte string may not be interpolated - (Originally from ../FSComp.txt:1543) + (Originally from ..\FSComp.txt:1583) This byte array literal contains characters that do not encode as a single byte - (Originally from ../FSComp.txt:1010) + (Originally from ..\FSComp.txt:1013) Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - (Originally from ../FSComp.txt:1380) + (Originally from ..\FSComp.txt:1397) Used in a computation expression to append the result of a given computation expression to a collection of results for the containing computation expression. - (Originally from ../FSComp.txt:1447) + (Originally from ..\FSComp.txt:1464) Used in a sequence expression to produce a value for a sequence. - (Originally from ../FSComp.txt:1446) + (Originally from ..\FSComp.txt:1463) Used together with the match keyword in pattern matching expressions. Also used in object expressions, record copying expressions, and type extensions to introduce member definitions, and to introduce exception handlers. - (Originally from ../FSComp.txt:1445) + (Originally from ..\FSComp.txt:1462) Introduces a looping construct. - (Originally from ../FSComp.txt:1444) + (Originally from ..\FSComp.txt:1461) Used for Boolean conditions (when guards) on pattern matches and to introduce a constraint clause for a generic type parameter. - (Originally from ../FSComp.txt:1443) + (Originally from ..\FSComp.txt:1460) Indicates the .NET void type. Used when interoperating with other .NET languages. - (Originally from ../FSComp.txt:1442) + (Originally from ..\FSComp.txt:1459) Used in a signature to indicate a value, or in a type to declare a member, in limited situations. - (Originally from ../FSComp.txt:1441) + (Originally from ..\FSComp.txt:1458) Used instead of let! in computation expressions for computation expression results that implement IDisposable. - (Originally from ../FSComp.txt:1440) + (Originally from ..\FSComp.txt:1457) Used instead of let for values that implement IDisposable - (Originally from ../FSComp.txt:1439) + (Originally from ..\FSComp.txt:1456) Used to convert to a type that is higher in the inheritance chain. - (Originally from ../FSComp.txt:1438) + (Originally from ..\FSComp.txt:1455) Delimits a untyped code quotation. - (Originally from ../FSComp.txt:1453) + (Originally from ..\FSComp.txt:1470) Delimits a typed code quotation. - (Originally from ../FSComp.txt:1452) + (Originally from ..\FSComp.txt:1469) Used to declare a class, record, structure, discriminated union, enumeration type, unit of measure, or type abbreviation. - (Originally from ../FSComp.txt:1437) + (Originally from ..\FSComp.txt:1454) Used to introduce a block of code that might generate an exception. Used together with with or finally. - (Originally from ../FSComp.txt:1436) + (Originally from ..\FSComp.txt:1453) Used as a Boolean literal. - (Originally from ../FSComp.txt:1398) + (Originally from ..\FSComp.txt:1415) Used in for loops to indicate a range. - (Originally from ../FSComp.txt:1435) + (Originally from ..\FSComp.txt:1452) Used in conditional expressions. Also used to perform side effects after object construction. - (Originally from ../FSComp.txt:1434) + (Originally from ..\FSComp.txt:1451) Used to declare a structure type. Also used in generic parameter constraints. Used for OCaml compatibility in module definitions. - (Originally from ../FSComp.txt:1433) + (Originally from ..\FSComp.txt:1450) Used to indicate a method or property that can be called without an instance of a type, or a value member that is shared among all instances of a type. - (Originally from ../FSComp.txt:1432) + (Originally from ..\FSComp.txt:1449) Used in query expressions to specify what fields or columns to extract. Note that this is a contextual keyword, which means that it is not actually a reserved word and it only acts like a keyword in appropriate context. - (Originally from ../FSComp.txt:1431) + (Originally from ..\FSComp.txt:1448) In function types, delimits arguments and return values. Yields an expression (in sequence expressions); equivalent to the yield keyword. Used in match expressions - (Originally from ../FSComp.txt:1448) + (Originally from ..\FSComp.txt:1465) Used to provide a value for the result of the containing computation expression, where that value itself comes from the result another computation expression. - (Originally from ../FSComp.txt:1430) + (Originally from ..\FSComp.txt:1447) Used to provide a value for the result of the containing computation expression. - (Originally from ../FSComp.txt:1429) + (Originally from ..\FSComp.txt:1446) Used to indicate that a function is recursive. - (Originally from ../FSComp.txt:1428) + (Originally from ..\FSComp.txt:1445) Allows access to a member from outside the type. - (Originally from ../FSComp.txt:1427) + (Originally from ..\FSComp.txt:1444) Restricts access to a member to code in the same type or module. - (Originally from ../FSComp.txt:1426) + (Originally from ..\FSComp.txt:1443) Used to implement a version of an abstract or virtual method that differs from the base version. - (Originally from ../FSComp.txt:1425) + (Originally from ..\FSComp.txt:1442) Used with Boolean conditions as a Boolean or operator. Equivalent to ||. Also used in member constraints. - (Originally from ../FSComp.txt:1424) + (Originally from ..\FSComp.txt:1441) Used to make the contents of a namespace or module available without qualification. - (Originally from ../FSComp.txt:1423) + (Originally from ..\FSComp.txt:1440) Used in discriminated unions to indicate the type of categories of values, and in delegate and exception declarations. - (Originally from ../FSComp.txt:1422) + (Originally from ..\FSComp.txt:1439) Indicates the absence of an object. Also used in generic parameter constraints. - (Originally from ../FSComp.txt:1421) + (Originally from ..\FSComp.txt:1438) Not actually a keyword. However, not struct in combination is used as a generic parameter constraint. - (Originally from ../FSComp.txt:1420) + (Originally from ..\FSComp.txt:1437) Used to declare, define, or invoke a constructor that creates or that can create an object. Also used in generic parameter constraints to indicate that a type must have a certain constructor. - (Originally from ../FSComp.txt:1419) + (Originally from ..\FSComp.txt:1436) Used to associate a name with a group of related types and modules, to logically separate it from other code. - (Originally from ../FSComp.txt:1418) + (Originally from ..\FSComp.txt:1435) Used to declare a variable, that is, a value that can be changed. - (Originally from ../FSComp.txt:1417) + (Originally from ..\FSComp.txt:1434) Used to associate a name with a group of related types, values, and functions, to logically separate it from other code. - (Originally from ../FSComp.txt:1416) + (Originally from ..\FSComp.txt:1433) Used to declare a property or method in an object type. - (Originally from ../FSComp.txt:1415) + (Originally from ..\FSComp.txt:1432) Used in computation expressions to pattern match directly over the result of another computation expression. - (Originally from ../FSComp.txt:1414) + (Originally from ..\FSComp.txt:1431) Used to branch by comparing a value to a pattern. - (Originally from ../FSComp.txt:1413) + (Originally from ..\FSComp.txt:1430) Used in computation expressions to bind a name to the result of another computation expression. - (Originally from ../FSComp.txt:1412) + (Originally from ..\FSComp.txt:1429) Used to associate, or bind, a name to a value or function. - (Originally from ../FSComp.txt:1411) + (Originally from ..\FSComp.txt:1428) Assigns a value to a variable. - (Originally from ../FSComp.txt:1449) + (Originally from ..\FSComp.txt:1466) Used to specify a computation that is to be performed only when a result is needed. - (Originally from ../FSComp.txt:1410) + (Originally from ..\FSComp.txt:1427) Used to specify that a member is visible inside an assembly but not outside it. - (Originally from ../FSComp.txt:1409) + (Originally from ..\FSComp.txt:1426) Used to declare and implement interfaces. - (Originally from ../FSComp.txt:1408) + (Originally from ..\FSComp.txt:1425) Used to indicate a function that should be integrated directly into the caller's code. - (Originally from ../FSComp.txt:1407) + (Originally from ..\FSComp.txt:1424) Used to specify a base class or base interface. - (Originally from ../FSComp.txt:1406) + (Originally from ..\FSComp.txt:1423) Used for sequence expressions and, in verbose syntax, to separate expressions from bindings. - (Originally from ../FSComp.txt:1405) + (Originally from ..\FSComp.txt:1422) Used in conditional branching constructs. - (Originally from ../FSComp.txt:1404) + (Originally from ..\FSComp.txt:1421) Used to reference the top-level .NET namespace. - (Originally from ../FSComp.txt:1403) + (Originally from ..\FSComp.txt:1420) Used as a shorter alternative to the fun keyword and a match expression in a lambda expression that has pattern matching on a single argument. - (Originally from ../FSComp.txt:1402) + (Originally from ..\FSComp.txt:1419) Used in lambda expressions, also known as anonymous functions. - (Originally from ../FSComp.txt:1401) + (Originally from ..\FSComp.txt:1418) Used in looping constructs. - (Originally from ../FSComp.txt:1400) + (Originally from ..\FSComp.txt:1417) Used together with try to introduce a block of code that executes regardless of whether an exception occurs. - (Originally from ../FSComp.txt:1399) + (Originally from ..\FSComp.txt:1416) Indicates that a declared program element is defined in another binary or assembly. - (Originally from ../FSComp.txt:1397) + (Originally from ..\FSComp.txt:1414) Used to declare an exception type. - (Originally from ../FSComp.txt:1396) + (Originally from ..\FSComp.txt:1413) In type definitions and type extensions, indicates the end of a section of member definitions. In verbose syntax, used to specify the end of a code block that starts with the begin keyword. - (Originally from ../FSComp.txt:1395) + (Originally from ..\FSComp.txt:1412) Used in conditional branching. - (Originally from ../FSComp.txt:1394) + (Originally from ..\FSComp.txt:1411) Used in conditional branching. A short form of else if. - (Originally from ../FSComp.txt:1393) + (Originally from ..\FSComp.txt:1410) Converts a type to a type that is lower in the hierarchy. - (Originally from ../FSComp.txt:1451) + (Originally from ..\FSComp.txt:1468) In a for expression, used when counting in reverse. - (Originally from ../FSComp.txt:1392) + (Originally from ..\FSComp.txt:1409) Used to convert to a type that is lower in the inheritance chain. - (Originally from ../FSComp.txt:1391) + (Originally from ..\FSComp.txt:1408) In verbose syntax, indicates the end of a block of code in a looping expression. - (Originally from ../FSComp.txt:1390) + (Originally from ..\FSComp.txt:1407) Used in looping constructs or to execute imperative code. - (Originally from ../FSComp.txt:1389) + (Originally from ..\FSComp.txt:1406) Used to declare a delegate. - (Originally from ../FSComp.txt:1388) + (Originally from ..\FSComp.txt:1405) Indicates an implementation of an abstract method; used together with an abstract method declaration to create a virtual method. - (Originally from ../FSComp.txt:1387) + (Originally from ..\FSComp.txt:1404) Keyword to specify a constant literal as a type parameter argument in Type Providers. - (Originally from ../FSComp.txt:1386) + (Originally from ..\FSComp.txt:1403) In verbose syntax, indicates the start of a class definition. - (Originally from ../FSComp.txt:1385) + (Originally from ..\FSComp.txt:1402) Converts a type to type that is higher in the hierarchy. - (Originally from ../FSComp.txt:1450) + (Originally from ..\FSComp.txt:1467) In verbose syntax, indicates the start of a code block. - (Originally from ../FSComp.txt:1384) + (Originally from ..\FSComp.txt:1401) Used as the name of the base class object. - (Originally from ../FSComp.txt:1383) + (Originally from ..\FSComp.txt:1400) Used to verify code during debugging. - (Originally from ../FSComp.txt:1382) + (Originally from ..\FSComp.txt:1399) Used to give the current class object an object name. Also used to give a name to a whole pattern within a pattern match. - (Originally from ../FSComp.txt:1381) + (Originally from ..\FSComp.txt:1398) Indicates a method that either has no implementation in the type in which it is declared or that is virtual and has a default implementation. - (Originally from ../FSComp.txt:1379) + (Originally from ..\FSComp.txt:1396) %s '%s' not found in type '%s' from assembly '%s'. A possible cause may be a version incompatibility. You may need to explicitly reference the correct version of this assembly to allow all referenced components to use the correct version. - (Originally from ../FSComp.txt:1455) + (Originally from ..\FSComp.txt:1472) %s '%s' not found in assembly '%s'. A possible cause may be a version incompatibility. You may need to explicitly reference the correct version of this assembly to allow all referenced components to use the correct version. - (Originally from ../FSComp.txt:1454) + (Originally from ..\FSComp.txt:1471) + + + + + XML comment is not placed on a valid language element. + (Originally from ..\FSComp.txt:1634) The 'anycpu32bitpreferred' platform can only be used with EXE targets. You must use 'anycpu' instead. - (Originally from ../FSComp.txt:1297) + (Originally from ..\FSComp.txt:1314) invalid namespace for provided type - (Originally from ../FSComp.txt:1200) + (Originally from ..\FSComp.txt:1211) invalid full name for provided type - (Originally from ../FSComp.txt:1201) + (Originally from ..\FSComp.txt:1212) Invalid provided literal value '%s' - (Originally from ../FSComp.txt:1296) + (Originally from ..\FSComp.txt:1313) This expression returns a value of type '%s' but is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to use the expression as a value in the sequence then use an explicit 'yield!'. - (Originally from ../FSComp.txt:1466) + (Originally from ..\FSComp.txt:1485) This expression returns a value of type '%s' but is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to use the expression as a value in the sequence then use an explicit 'yield'. - (Originally from ../FSComp.txt:1465) + (Originally from ..\FSComp.txt:1484) + + + + + The 'InlineIfLambda' attribute is present in the signature but not the implementation. + (Originally from ..\FSComp.txt:1632) The type '%s' is required here and is unavailable. You must add a reference to assembly '%s'. - (Originally from ../FSComp.txt:976) + (Originally from ..\FSComp.txt:979) A reference to the type '%s' in assembly '%s' was found, but the type could not be found in that assembly - (Originally from ../FSComp.txt:977) + (Originally from ..\FSComp.txt:980) A reference to the DLL %s is required by assembly %s. The imported type %s is located in the first assembly and could not be resolved. - (Originally from ../FSComp.txt:979) + (Originally from ..\FSComp.txt:982) Internal error or badly formed metadata: not enough type parameters were in scope while importing - (Originally from ../FSComp.txt:978) + (Originally from ..\FSComp.txt:981) Invalid number of generic arguments to type '%s' in provided type. Expected '%d' arguments, given '%d'. - (Originally from ../FSComp.txt:1273) + (Originally from ..\FSComp.txt:1290) Invalid value unit-of-measure parameter '%s' - (Originally from ../FSComp.txt:1275) + (Originally from ..\FSComp.txt:1292) Invalid value '%s' for unit-of-measure parameter '%s' - (Originally from ../FSComp.txt:1274) + (Originally from ..\FSComp.txt:1291) An imported assembly uses the type '%s' but that type is not public - (Originally from ../FSComp.txt:980) + (Originally from ..\FSComp.txt:983) Invalid argument to 'methodhandleof' during codegen - (Originally from ../FSComp.txt:1235) + (Originally from ..\FSComp.txt:1252) + + + + + The resumable code construct '%s' may only be used in inlined code protected by 'if __useResumableCode then ...' and the overall composition must form valid resumable code. + (Originally from ..\FSComp.txt:1611) MDB generation failed. Could not find compatible member %s - (Originally from ../FSComp.txt:1095) + (Originally from ..\FSComp.txt:1106) The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - (Originally from ../FSComp.txt:1094) + (Originally from ..\FSComp.txt:1105) Unexpected error creating debug information file '%s' - (Originally from ../FSComp.txt:1003) + (Originally from ..\FSComp.txt:1006) Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - (Originally from ../FSComp.txt:1096) + (Originally from ..\FSComp.txt:1107) The file '%s' changed on disk unexpectedly, please reload. - (Originally from ../FSComp.txt:1467) + (Originally from ..\FSComp.txt:1486) Compiler error: unexpected unrealized value - (Originally from ../FSComp.txt:829) + (Originally from ..\FSComp.txt:832) Unexpected GetSet annotation on a property - (Originally from ../FSComp.txt:832) + (Originally from ..\FSComp.txt:835) Undefined value '%s' - (Originally from ../FSComp.txt:816) + (Originally from ..\FSComp.txt:819) This type cannot be used for a literal field - (Originally from ../FSComp.txt:831) + (Originally from ..\FSComp.txt:834) The StructLayout attribute could not be decoded - (Originally from ../FSComp.txt:834) + (Originally from ..\FSComp.txt:837) GenSetStorage: %s was represented as a static method but was not an appropriate lambda expression - (Originally from ../FSComp.txt:827) + (Originally from ..\FSComp.txt:830) The signature for this external function contains type parameters. Constrain the argument and return types to indicate the types of the corresponding C function. - (Originally from ../FSComp.txt:824) + (Originally from ..\FSComp.txt:827) RSA key expected - (Originally from ../FSComp.txt:1124) + (Originally from ..\FSComp.txt:1135) Private key expected - (Originally from ../FSComp.txt:1123) + (Originally from ..\FSComp.txt:1134) No signature directory - (Originally from ../FSComp.txt:1129) + (Originally from ..\FSComp.txt:1140) Invalid signature size - (Originally from ../FSComp.txt:1128) + (Originally from ..\FSComp.txt:1139) Invalid RSAParameters structure - '{0}' expected - (Originally from ../FSComp.txt:1126) + (Originally from ..\FSComp.txt:1137) Invalid Public Key blob - (Originally from ../FSComp.txt:1130) + (Originally from ..\FSComp.txt:1141) Invalid Magic value in CLR Header - (Originally from ../FSComp.txt:1121) + (Originally from ..\FSComp.txt:1132) Invalid bit Length - (Originally from ../FSComp.txt:1125) + (Originally from ..\FSComp.txt:1136) Invalid algId - 'Exponent' expected - (Originally from ../FSComp.txt:1127) + (Originally from ..\FSComp.txt:1138) Bad image format - (Originally from ../FSComp.txt:1122) + (Originally from ..\FSComp.txt:1133) Reflected definitions cannot contain uses of the prefix splice operator '%%' - (Originally from ../FSComp.txt:836) + (Originally from ..\FSComp.txt:839) Mutable variables cannot escape their method - (Originally from ../FSComp.txt:828) + (Originally from ..\FSComp.txt:831) The MarshalAs attribute could not be decoded - (Originally from ../FSComp.txt:823) + (Originally from ..\FSComp.txt:826) Main module of program is empty: nothing will happen when it is run - (Originally from ../FSComp.txt:830) + (Originally from ..\FSComp.txt:833) Literal fields cannot be set - (Originally from ../FSComp.txt:826) + (Originally from ..\FSComp.txt:829) Label %s not found - (Originally from ../FSComp.txt:817) + (Originally from ..\FSComp.txt:820) Incorrect number of type arguments to local call - (Originally from ../FSComp.txt:818) + (Originally from ..\FSComp.txt:821) The FieldOffset attribute could not be decoded - (Originally from ../FSComp.txt:833) + (Originally from ..\FSComp.txt:836) The FieldOffset attribute can only be placed on members of types marked with the StructLayout(LayoutKind.Explicit) - (Originally from ../FSComp.txt:1089) + (Originally from ..\FSComp.txt:1100) The type '%s' has been marked as having an Explicit layout, but the field '%s' has not been marked with the 'FieldOffset' attribute - (Originally from ../FSComp.txt:1081) + (Originally from ..\FSComp.txt:1091) Dynamic invocation of %s is not supported - (Originally from ../FSComp.txt:819) + (Originally from ..\FSComp.txt:822) The DllImport attribute could not be decoded - (Originally from ../FSComp.txt:825) + (Originally from ..\FSComp.txt:828) The DefaultAugmentation attribute could not be decoded - (Originally from ../FSComp.txt:835) + (Originally from ..\FSComp.txt:838) Custom marshallers cannot be specified in F# code. Consider using a C# helper function. - (Originally from ../FSComp.txt:822) + (Originally from ..\FSComp.txt:825) This operation involves taking the address of a value '%s' represented using a local variable or other special representation. This is invalid. - (Originally from ../FSComp.txt:821) + (Originally from ..\FSComp.txt:824) Taking the address of a literal field is invalid - (Originally from ../FSComp.txt:820) + (Originally from ..\FSComp.txt:823) The 'if' expression needs to have type '%s' to satisfy context type requirements. It currently has type '%s'. - (Originally from ../FSComp.txt:24) + (Originally from ..\FSComp.txt:24) @@ -6440,2455 +6770,2545 @@ Invalid directive '#%s %s' - (Originally from ../FSComp.txt:1528) + (Originally from ..\FSComp.txt:1550) Cannot find FSharp.Core.dll in compiler's directory - (Originally from ../FSComp.txt:1350) + (Originally from ..\FSComp.txt:1367) Conflicting options specified: 'win32manifest' and 'win32res'. Only one of these can be used. - (Originally from ../FSComp.txt:1136) + (Originally from ..\FSComp.txt:1147) Exiting - too many errors - (Originally from ../FSComp.txt:1132) + (Originally from ..\FSComp.txt:1143) System.Runtime.InteropServices assembly is required to use UnknownWrapper\DispatchWrapper classes. - (Originally from ../FSComp.txt:1332) + (Originally from ..\FSComp.txt:1349) Static linking may not be used on an assembly referencing mscorlib (e.g. a .NET Framework assembly) when generating an assembly that references System.Runtime (e.g. a .NET Core or Portable assembly). - (Originally from ../FSComp.txt:1155) + (Originally from ..\FSComp.txt:1166) Static linking may not include a mixed managed/unmanaged DLL - (Originally from ../FSComp.txt:1140) + (Originally from ..\FSComp.txt:1151) Static linking may not include a .EXE - (Originally from ../FSComp.txt:1139) + (Originally from ..\FSComp.txt:1150) Passing a .resx file (%s) as a source file to the compiler is deprecated. Use resgen.exe to transform the .resx file into a .resources file to pass as a --resource option. If you are using MSBuild, this can be done via an <EmbeddedResource> item in the .fsproj project file. - (Originally from ../FSComp.txt:1154) + (Originally from ..\FSComp.txt:1165) The resident compilation service was not used because a problem occured in communicating with the server. - (Originally from ../FSComp.txt:1152) + (Originally from ..\FSComp.txt:1163) The assembly '%s' is listed on the command line. Assemblies should be referenced using a command line flag such as '-r'. - (Originally from ../FSComp.txt:1151) + (Originally from ..\FSComp.txt:1162) Code in this assembly makes uses of quotation literals. Static linking may not include components that make use of quotation literals unless all assemblies are compiled with at least F# 4.0. - (Originally from ../FSComp.txt:1138) + (Originally from ..\FSComp.txt:1149) The code in assembly '%s' makes uses of quotation literals. Static linking may not include components that make use of quotation literals unless all assemblies are compiled with at least F# 4.0. - (Originally from ../FSComp.txt:1137) + (Originally from ..\FSComp.txt:1148) A problem occurred writing the binary '%s': %s - (Originally from ../FSComp.txt:1145) + (Originally from ..\FSComp.txt:1156) --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - (Originally from ../FSComp.txt:1158) + (Originally from ..\FSComp.txt:1169) No implementation files specified - (Originally from ../FSComp.txt:1134) + (Originally from ..\FSComp.txt:1145) Option '--keycontainer' overrides attribute 'System.Reflection.AssemblyNameAttribute' given in a source file or added module - (Originally from ../FSComp.txt:1150) + (Originally from ..\FSComp.txt:1161) Option '--keyfile' overrides attribute 'System.Reflection.AssemblyKeyFileAttribute' given in a source file or added module - (Originally from ../FSComp.txt:1149) + (Originally from ..\FSComp.txt:1160) The key file '%s' could not be opened - (Originally from ../FSComp.txt:1144) + (Originally from ..\FSComp.txt:1155) Ignoring mixed managed/unmanaged assembly '%s' during static linking - (Originally from ../FSComp.txt:1141) + (Originally from ..\FSComp.txt:1152) Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - (Originally from ../FSComp.txt:1157) + (Originally from ..\FSComp.txt:1168) Option '--delaysign' overrides attribute 'System.Reflection.AssemblyDelaySignAttribute' given in a source file or added module - (Originally from ../FSComp.txt:1148) + (Originally from ..\FSComp.txt:1159) The attribute %s specified version '%s', but this value is invalid and has been ignored - (Originally from ../FSComp.txt:1135) + (Originally from ..\FSComp.txt:1146) Assembly '%s' was referenced transitively and the assembly could not be resolved automatically. Static linking will assume this DLL has no dependencies on the F# library or other statically linked DLLs. Consider adding an explicit reference to this DLL. - (Originally from ../FSComp.txt:1142) + (Originally from ..\FSComp.txt:1153) An %s specified version '%s', but this value is a wildcard, and you have requested a deterministic build, these are in conflict. - (Originally from ../FSComp.txt:1156) + (Originally from ..\FSComp.txt:1167) The 'AssemblyVersionAttribute' has been ignored because a version was given using a command line option - (Originally from ../FSComp.txt:1146) + (Originally from ..\FSComp.txt:1157) Assembly '%s' not found in dependency set of target binary. Statically linked roots should be specified using an assembly name, without a DLL or EXE extension. If this assembly was referenced explicitly then it is possible the assembly was not actually required by the generated binary, in which case it should not be statically linked. - (Originally from ../FSComp.txt:1143) + (Originally from ..\FSComp.txt:1154) Error emitting 'System.Reflection.AssemblyCultureAttribute' attribute -- 'Executables cannot be satellite assemblies, Culture should always be empty' - (Originally from ../FSComp.txt:1147) + (Originally from ..\FSComp.txt:1158) From the end slicing with requires language version 5.0, use /langversion:preview. - (Originally from ../FSComp.txt:1496) + (Originally from ..\FSComp.txt:1515) - %s - (Originally from ../FSComp.txt:1511) + (Originally from ..\FSComp.txt:1530) Prefix flag (' ' or '+') set twice - (Originally from ../FSComp.txt:223) + (Originally from ..\FSComp.txt:226) Precision missing after the '.' - (Originally from ../FSComp.txt:228) + (Originally from ..\FSComp.txt:231) Positional specifiers are not permitted in format strings - (Originally from ../FSComp.txt:220) + (Originally from ..\FSComp.txt:223) Missing format specifier - (Originally from ../FSComp.txt:221) + (Originally from ..\FSComp.txt:224) The 'l' or 'L' in this format specifier is unnecessary. In F# code you can use %%d, %%x, %%o or %%u instead, which are overloaded to work with all basic integer types. - (Originally from ../FSComp.txt:231) + (Originally from ..\FSComp.txt:234) The # formatting modifier is invalid in F# - (Originally from ../FSComp.txt:224) + (Originally from ..\FSComp.txt:227) The 'h' or 'H' in this format specifier is unnecessary. You can use %%d, %%x, %%o or %%u instead, which are overloaded to work with all basic integer types. - (Originally from ../FSComp.txt:232) + (Originally from ..\FSComp.txt:235) Interpolated strings used as type IFormattable or type FormattableString may not use '%%' specifiers, only .NET-style interpolands such as '{expr}', '{expr,3}' or '{expr:N5}' may be used. - (Originally from ../FSComp.txt:1537) + (Originally from ..\FSComp.txt:1577) The '%%P' specifier may not be used explicitly. - (Originally from ../FSComp.txt:1536) + (Originally from ..\FSComp.txt:1576) .NET-style format specifiers such as '{x,3}' or '{x:N5}' may not be mixed with '%%' format specifiers. - (Originally from ../FSComp.txt:1535) + (Originally from ..\FSComp.txt:1575) Interpolated strings may not use '%%' format specifiers unless each is given an expression, e.g. '%%d{1+1}'. - (Originally from ../FSComp.txt:1534) + (Originally from ..\FSComp.txt:1574) '%s' format does not support precision - (Originally from ../FSComp.txt:229) + (Originally from ..\FSComp.txt:232) '%s' flag set twice - (Originally from ../FSComp.txt:222) + (Originally from ..\FSComp.txt:225) '%s' format does not support '0' flag - (Originally from ../FSComp.txt:227) + (Originally from ..\FSComp.txt:230) '%s' does not support prefix '%s' flag - (Originally from ../FSComp.txt:233) + (Originally from ..\FSComp.txt:236) Bad width in format specifier - (Originally from ../FSComp.txt:226) + (Originally from ..\FSComp.txt:229) Bad precision in format specifier - (Originally from ../FSComp.txt:225) + (Originally from ..\FSComp.txt:228) Bad format specifier: '%s' - (Originally from ../FSComp.txt:234) + (Originally from ..\FSComp.txt:237) Bad format specifier (after l or L): Expected ld,li,lo,lu,lx or lX. In F# code you can use %%d, %%x, %%o or %%u instead, which are overloaded to work with all basic integer types. - (Originally from ../FSComp.txt:230) + (Originally from ..\FSComp.txt:233) - All branches of a pattern match expression must return values of the same type as the first branch, which here is '%s'. This branch returns a value of type '%s'. - (Originally from ../FSComp.txt:26) + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is '%s'. This branch returns a value of type '%s'. + (Originally from ..\FSComp.txt:26) The record, struct or class field '%s' is not accessible from this code location - (Originally from ../FSComp.txt:964) + (Originally from ..\FSComp.txt:967) witness passing for trait constraints in F# quotations - (Originally from ../FSComp.txt:1526) + (Originally from ..\FSComp.txt:1546) wild card in for loop - (Originally from ../FSComp.txt:1513) + (Originally from ..\FSComp.txt:1532) struct representation for active patterns - (Originally from ../FSComp.txt:1527) + (Originally from ..\FSComp.txt:1548) string interpolation - (Originally from ../FSComp.txt:1525) + (Originally from ..\FSComp.txt:1545) single underscore pattern - (Originally from ../FSComp.txt:1512) + (Originally from ..\FSComp.txt:1531) + + + + + resumable state machines + (Originally from ..\FSComp.txt:1542) + + + + + whitespace relaxation v2 + (Originally from ..\FSComp.txt:1549) whitespace relexation - (Originally from ../FSComp.txt:1514) + (Originally from ..\FSComp.txt:1533) + + + + + informational messages related to reference cells + (Originally from ..\FSComp.txt:1246) binary formatting for integers - (Originally from ../FSComp.txt:1233) + (Originally from ..\FSComp.txt:1244) package management - (Originally from ../FSComp.txt:1519) + (Originally from ..\FSComp.txt:1538) overloads for custom operations - (Originally from ../FSComp.txt:1231) + (Originally from ..\FSComp.txt:1242) open type declaration - (Originally from ../FSComp.txt:1517) + (Originally from ..\FSComp.txt:1536) nullable optional interop - (Originally from ../FSComp.txt:1523) + (Originally from ..\FSComp.txt:1543) + + + + + non-variable patterns to the right of 'as' patterns + (Originally from ..\FSComp.txt:1248) nameof - (Originally from ../FSComp.txt:1515) + (Originally from ..\FSComp.txt:1534) + + + + + ML compatibility revisions + (Originally from ..\FSComp.txt:1250) interfaces with multiple generic instantiation - (Originally from ../FSComp.txt:1531) + (Originally from ..\FSComp.txt:1557) + + + + + expr[idx] notation for indexing and slicing + (Originally from ..\FSComp.txt:1245) implicit yield - (Originally from ../FSComp.txt:1516) + (Originally from ..\FSComp.txt:1535) from-end slicing - (Originally from ../FSComp.txt:1520) + (Originally from ..\FSComp.txt:1539) fixed-index slice 3d/4d - (Originally from ../FSComp.txt:1521) + (Originally from ..\FSComp.txt:1540) more types support units of measure - (Originally from ../FSComp.txt:1232) + (Originally from ..\FSComp.txt:1243) dotless float32 literal - (Originally from ../FSComp.txt:1518) + (Originally from ..\FSComp.txt:1537) + + + + + discard pattern in use binding + (Originally from ..\FSComp.txt:1247) default interface member consumption - (Originally from ../FSComp.txt:1524) + (Originally from ..\FSComp.txt:1544) + + + + + attributes to the right of the 'module' keyword + (Originally from ..\FSComp.txt:1249) applicative computation expressions - (Originally from ../FSComp.txt:1522) + (Originally from ..\FSComp.txt:1541) + + + + + additional type-directed conversions + (Originally from ..\FSComp.txt:1547) Expression does not have a name. - (Originally from ../FSComp.txt:1490) + (Originally from ..\FSComp.txt:1509) This construct is experimental - (Originally from ../FSComp.txt:966) + (Originally from ..\FSComp.txt:969) The event '%s' has a non-standard type. If this event is declared in another CLI language, you may need to access this event using the explicit %s and %s methods for the event. If this event is declared in F#, make the type of the event an instantiation of either 'IDelegateEvent<_>' or 'IEvent<_,_>'. - (Originally from ../FSComp.txt:959) + (Originally from ..\FSComp.txt:962) Unsupported expression '%s' from type provider. If you are the author of this type provider, consider adjusting it to provide a different provided expression. - (Originally from ../FSComp.txt:1179) + (Originally from ..\FSComp.txt:1190) Invalid member '%s' on provided type '%s'. Only properties, methods and constructors are allowed - (Originally from ../FSComp.txt:1171) + (Originally from ..\FSComp.txt:1182) Unsupported constant type '%s'. Quotations provided by type providers can only contain simple constants. The implementation of the type provider may need to be adjusted by moving a value declared outside a provided quotation literal to be a 'let' binding inside the quotation literal. - (Originally from ../FSComp.txt:1178) + (Originally from ..\FSComp.txt:1189) Unknown static argument kind '%s' when resolving a reference to a provided type or method '%s' - (Originally from ../FSComp.txt:1197) + (Originally from ..\FSComp.txt:1208) Unexpected 'null' return value from provided type '%s' member '%s' - (Originally from ../FSComp.txt:1192) + (Originally from ..\FSComp.txt:1203) Unexpected exception from provided type '%s' member '%s': %s - (Originally from ../FSComp.txt:1177) + (Originally from ..\FSComp.txt:1188) Unexpected exception from member '%s' of provided type '%s' member '%s': %s - (Originally from ../FSComp.txt:1193) + (Originally from ..\FSComp.txt:1204) The type provider constructor has thrown an exception: %s - (Originally from ../FSComp.txt:1204) + (Originally from ..\FSComp.txt:1215) Too many static parameters. Expected at most %d parameters, but got %d unnamed and %d named parameters. - (Originally from ../FSComp.txt:1295) + (Originally from ..\FSComp.txt:1312) The static parameter '%s' of the provided type or method '%s' requires a value. Static parameters to type providers may be optionally specified using named arguments, e.g. '%s<%s=...>'. - (Originally from ../FSComp.txt:1224) + (Originally from ..\FSComp.txt:1235) The static parameter '%s' has already been given a value - (Originally from ../FSComp.txt:1226) + (Originally from ..\FSComp.txt:1237) The type provider returned 'null', which is not a valid return value from '%s' - (Originally from ../FSComp.txt:1203) + (Originally from ..\FSComp.txt:1214) Assembly attribute '%s' refers to a designer assembly '%s' which cannot be loaded or doesn't exist. The exception reported was: %s - %s - (Originally from ../FSComp.txt:1183) + (Originally from ..\FSComp.txt:1194) Assembly attribute '%s' refers to a designer assembly '%s' which cannot be loaded from path '%s'. The exception reported was: %s - %s - (Originally from ../FSComp.txt:1184) + (Originally from ..\FSComp.txt:1195) The type provider designer assembly '%s' could not be loaded from folder '%s'. The exception reported was: %s - %s - (Originally from ../FSComp.txt:1199) + (Originally from ..\FSComp.txt:1210) The type provider designer assembly '%s' could not be loaded from folder '%s' because a dependency was missing or could not loaded. All dependencies of the type provider designer assembly must be located in the same folder as that assembly. The exception reported was: %s - %s - (Originally from ../FSComp.txt:1198) + (Originally from ..\FSComp.txt:1209) The type provider '%s' reported an error in the context of provided type '%s', member '%s'. The error: %s - (Originally from ../FSComp.txt:1217) + (Originally from ..\FSComp.txt:1228) The type provider '%s' reported an error: %s - (Originally from ../FSComp.txt:1186) + (Originally from ..\FSComp.txt:1197) The type provider does not have a valid constructor. A constructor taking either no arguments or one argument of type 'TypeProviderConfig' was expected. - (Originally from ../FSComp.txt:1185) + (Originally from ..\FSComp.txt:1196) The '%s' of a provided type was null or empty. - (Originally from ../FSComp.txt:1219) + (Originally from ..\FSComp.txt:1230) An exception occurred when accessing the '%s' of a provided type: %s - (Originally from ../FSComp.txt:1218) + (Originally from ..\FSComp.txt:1229) A reference to a provided type was missing a value for the static parameter '%s'. You may need to recompile one or more referenced assemblies. - (Originally from ../FSComp.txt:1236) + (Originally from ..\FSComp.txt:1253) A reference to a provided type had an invalid value '%s' for a static parameter. You may need to recompile one or more referenced assemblies. - (Originally from ../FSComp.txt:1237) + (Originally from ..\FSComp.txt:1254) Expected provided type with path '%s' but provided type has path '%s' - (Originally from ../FSComp.txt:1191) + (Originally from ..\FSComp.txt:1202) Expected provided type named '%s' but provided type has 'Name' with value '%s' - (Originally from ../FSComp.txt:1180) + (Originally from ..\FSComp.txt:1191) The type provider '%s' returned an invalid type from 'ApplyStaticArguments'. A type with name '%s' was expected, but a type with name '%s' was returned. - (Originally from ../FSComp.txt:1206) + (Originally from ..\FSComp.txt:1217) The type provider '%s' returned an invalid method from 'ApplyStaticArgumentsForMethod'. A method with name '%s' was expected, but a method with name '%s' was returned. - (Originally from ../FSComp.txt:1207) + (Originally from ..\FSComp.txt:1218) Property '%s' on provided type '%s' is neither readable nor writable as it has CanRead=false and CanWrite=false - (Originally from ../FSComp.txt:1276) + (Originally from ..\FSComp.txt:1293) Property '%s' on provided type '%s' has CanWrite=false but GetSetMethod() returned a method - (Originally from ../FSComp.txt:1175) + (Originally from ..\FSComp.txt:1186) Property '%s' on provided type '%s' has CanRead=false but GetGetMethod() returned a method - (Originally from ../FSComp.txt:1173) + (Originally from ..\FSComp.txt:1184) Property '%s' on provided type '%s' has CanWrite=true but there was no value from GetSetMethod() - (Originally from ../FSComp.txt:1174) + (Originally from ..\FSComp.txt:1185) Property '%s' on provided type '%s' has CanRead=true but there was no value from GetGetMethod() - (Originally from ../FSComp.txt:1172) + (Originally from ..\FSComp.txt:1183) One or more errors seen during provided type setup - (Originally from ../FSComp.txt:1176) + (Originally from ..\FSComp.txt:1187) Type provider '%s' returned null from GetInvokerExpression. - (Originally from ../FSComp.txt:1205) + (Originally from ..\FSComp.txt:1216) The provided type '%s' returned a member with a null or empty member name - (Originally from ../FSComp.txt:1161) + (Originally from ..\FSComp.txt:1172) The provided type '%s' has member '%s' which has declaring type '%s'. Expected declaring type to be the same as provided type. - (Originally from ../FSComp.txt:1164) + (Originally from ..\FSComp.txt:1175) The provided type '%s' member info '%s' has null declaring type - (Originally from ../FSComp.txt:1163) + (Originally from ..\FSComp.txt:1174) The provided type '%s' returned a null member - (Originally from ../FSComp.txt:1162) + (Originally from ..\FSComp.txt:1173) No static parameter exists with name '%s' - (Originally from ../FSComp.txt:1225) + (Originally from ..\FSComp.txt:1236) Nested provided types do not take static arguments or generic parameters - (Originally from ../FSComp.txt:1194) + (Originally from ..\FSComp.txt:1205) Provided type '%s' has 'IsGenericType' as true, but generic types are not supported. - (Originally from ../FSComp.txt:1168) + (Originally from ..\FSComp.txt:1179) Provided type '%s' has 'IsArray' as true, but array types are not supported. - (Originally from ../FSComp.txt:1169) + (Originally from ..\FSComp.txt:1180) Multiple static parameters exist with name '%s' - (Originally from ../FSComp.txt:1227) + (Originally from ..\FSComp.txt:1238) This provided method requires static parameters - (Originally from ../FSComp.txt:1352) + (Originally from ..\FSComp.txt:1369) Invalid member '%s' on provided type '%s'. Provided type members must be public, and not be generic, virtual, or abstract. - (Originally from ../FSComp.txt:1170) + (Originally from ..\FSComp.txt:1181) Assembly '%s' hase TypeProviderAssembly attribute with invalid value '%s'. The value should be a valid assembly name - (Originally from ../FSComp.txt:1212) + (Originally from ..\FSComp.txt:1223) Invalid static argument to provided type. Expected an argument of kind '%s'. - (Originally from ../FSComp.txt:1195) + (Originally from ..\FSComp.txt:1206) The type provider '%s' provided a method with a name '%s' and metadata token '%d', which is not reported among its methods of its declaring type '%s' - (Originally from ../FSComp.txt:1188) + (Originally from ..\FSComp.txt:1199) The type provider '%s' provided a constructor which is not reported among the constructors of its declaring type '%s' - (Originally from ../FSComp.txt:1189) + (Originally from ..\FSComp.txt:1200) The type provider '%s' used an invalid parameter in the ParameterExpression: %s - (Originally from ../FSComp.txt:1187) + (Originally from ..\FSComp.txt:1198) Character '%s' is not allowed in provided type name '%s' - (Originally from ../FSComp.txt:1220) + (Originally from ..\FSComp.txt:1231) Character '%s' is not allowed in provided namespace name '%s' - (Originally from ../FSComp.txt:1160) + (Originally from ..\FSComp.txt:1171) Referenced assembly '%s' has assembly level attribute '%s' but no public type provider classes were found - (Originally from ../FSComp.txt:1165) + (Originally from ..\FSComp.txt:1176) Event '%s' on provided type '%s' has no value from GetRemoveMethod() - (Originally from ../FSComp.txt:1182) + (Originally from ..\FSComp.txt:1193) Event '%s' on provided type '%s' has no value from GetAddMethod() - (Originally from ../FSComp.txt:1181) + (Originally from ..\FSComp.txt:1192) An error occured applying the static arguments to a provided type - (Originally from ../FSComp.txt:1196) + (Originally from ..\FSComp.txt:1207) An error occured applying the static arguments to a provided method - (Originally from ../FSComp.txt:1335) + (Originally from ..\FSComp.txt:1352) The provider '%s' returned a non-generated type '%s' in the context of a set of generated types. Consider adjusting the type provider to only return generated types. - (Originally from ../FSComp.txt:1299) + (Originally from ..\FSComp.txt:1316) Type '%s' from type provider '%s' has an empty namespace. Use 'null' for the global namespace. - (Originally from ../FSComp.txt:1166) + (Originally from ..\FSComp.txt:1177) Empty namespace found from the type provider '%s'. Use 'null' for the global namespace. - (Originally from ../FSComp.txt:1167) + (Originally from ..\FSComp.txt:1178) A direct reference to the generated type '%s' is not permitted. Instead, use a type definition, e.g. 'type TypeAlias = <path>'. This indicates that a type provider adds generated types to your assembly. - (Originally from ../FSComp.txt:1190) + (Originally from ..\FSComp.txt:1201) Named static arguments must come after all unnamed static arguments - (Originally from ../FSComp.txt:1223) + (Originally from ..\FSComp.txt:1234) A type provider implemented GetStaticParametersForMethod, but ApplyStaticArgumentsForMethod was not implemented or invalid - (Originally from ../FSComp.txt:1334) + (Originally from ..\FSComp.txt:1351) Erased to - (Originally from ../FSComp.txt:1304) + (Originally from ..\FSComp.txt:1321) - All branches of an 'if' expression must return values of the same type as the first branch, which here is '%s'. This branch returns a value of type '%s'. - (Originally from ../FSComp.txt:25) + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is '%s'. This branch returns a value of type '%s'. + (Originally from ..\FSComp.txt:25) System.Environment.Exit did not exit - (Originally from ../FSComp.txt:235) + (Originally from ..\FSComp.txt:238) The treatment of this operator is now handled directly by the F# compiler and its meaning cannot be redefined - (Originally from ../FSComp.txt:236) + (Originally from ..\FSComp.txt:239) The documentation file has no .xml suffix - (Originally from ../FSComp.txt:1133) + (Originally from ..\FSComp.txt:1144) is - (Originally from ../FSComp.txt:1456) + (Originally from ..\FSComp.txt:1473) (description unavailable...) - (Originally from ../FSComp.txt:1311) + (Originally from ..\FSComp.txt:1328) The '!' operator is used to dereference a ref cell. Consider using 'not expr' here. - (Originally from ../FSComp.txt:29) + (Originally from ..\FSComp.txt:29) Delegates are not allowed to have curried signatures - (Originally from ../FSComp.txt:969) + (Originally from ..\FSComp.txt:972) %s var in collection - (Originally from ../FSComp.txt:1242) + (Originally from ..\FSComp.txt:1259) %s var in collection %s (outerKey = innerKey). Note that parentheses are required after '%s' - (Originally from ../FSComp.txt:1240) + (Originally from ..\FSComp.txt:1257) %s var in collection %s (outerKey = innerKey) into group. Note that parentheses are required after '%s' - (Originally from ../FSComp.txt:1241) + (Originally from ..\FSComp.txt:1258) None of the types '%s' support the operator '%s'. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'. - (Originally from ../FSComp.txt:308) + (Originally from ..\FSComp.txt:311) None of the types '%s' support the operator '%s' - (Originally from ../FSComp.txt:306) + (Originally from ..\FSComp.txt:309) This type parameter cannot be instantiated to 'Nullable'. This is a restriction imposed in order to ensure the meaning of 'null' in some CLI languages is not confusing when used in conjunction with 'Nullable' values. - (Originally from ../FSComp.txt:325) + (Originally from ..\FSComp.txt:328) The type '%s' is not compatible with any of the types %s, arising from the use of a printf-style format string - (Originally from ../FSComp.txt:328) + (Originally from ..\FSComp.txt:331) The type '%s' is not a CLI enum type - (Originally from ../FSComp.txt:322) + (Originally from ..\FSComp.txt:325) The type '%s' is not a CLI delegate type - (Originally from ../FSComp.txt:324) + (Originally from ..\FSComp.txt:327) Type instantiation length mismatch - (Originally from ../FSComp.txt:333) + (Originally from ..\FSComp.txt:336) Type inference problem too complicated (maximum iteration depth reached). Consider adding further type annotations. - (Originally from ../FSComp.txt:301) + (Originally from ..\FSComp.txt:304) The type '%s' has a non-standard delegate type - (Originally from ../FSComp.txt:323) + (Originally from ..\FSComp.txt:326) The type '%s' does not support the operator '%s'. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'. - (Originally from ../FSComp.txt:309) + (Originally from ..\FSComp.txt:312) The type '%s' does not support the operator '%s' - (Originally from ../FSComp.txt:307) + (Originally from ..\FSComp.txt:310) The type '%s' does not support the 'equality' constraint because it is a record, union or struct with one or more structural element types which do not support the 'equality' constraint. Either avoid the use of equality with this type, or add the 'StructuralEquality' attribute to the type to determine which field type does not support equality - (Originally from ../FSComp.txt:321) + (Originally from ..\FSComp.txt:324) The type '%s' does not support the 'equality' constraint because it is a function type - (Originally from ../FSComp.txt:320) + (Originally from ..\FSComp.txt:323) The type '%s' does not support the 'equality' constraint because it has the 'NoEquality' attribute - (Originally from ../FSComp.txt:319) + (Originally from ..\FSComp.txt:322) The type '%s' does not support a conversion to the type '%s' - (Originally from ../FSComp.txt:310) + (Originally from ..\FSComp.txt:313) The type '%s' does not support the 'comparison' constraint because it is a record, union or struct with one or more structural element types which do not support the 'comparison' constraint. Either avoid the use of comparison with this type, or add the 'StructuralComparison' attribute to the type to determine which field type does not support comparison - (Originally from ../FSComp.txt:318) + (Originally from ..\FSComp.txt:321) The type '%s' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface - (Originally from ../FSComp.txt:317) + (Originally from ..\FSComp.txt:320) The type '%s' does not support the 'comparison' constraint because it has the 'NoComparison' attribute - (Originally from ../FSComp.txt:316) + (Originally from ..\FSComp.txt:319) The type '%s' does not have 'null' as a proper value - (Originally from ../FSComp.txt:314) + (Originally from ..\FSComp.txt:317) The declared type parameter '%s' cannot be used here since the type parameter cannot be resolved at compile time - (Originally from ../FSComp.txt:299) + (Originally from ..\FSComp.txt:302) The constraints 'struct' and 'not struct' are inconsistent - (Originally from ../FSComp.txt:313) + (Originally from ..\FSComp.txt:316) The required signature is %s - (Originally from ../FSComp.txt:346) + (Originally from ..\FSComp.txt:349) Argument '%s' doesn't match - (Originally from ../FSComp.txt:372) + (Originally from ..\FSComp.txt:375) Argument at index %d doesn't match - (Originally from ../FSComp.txt:373) + (Originally from ..\FSComp.txt:376) Optional arguments not permitted here - (Originally from ../FSComp.txt:334) + (Originally from ..\FSComp.txt:337) The type '%s' does not have 'null' as a proper value. To create a null value for a Nullable type use 'System.Nullable()'. - (Originally from ../FSComp.txt:315) + (Originally from ..\FSComp.txt:318) Known type parameter: %s - (Originally from ../FSComp.txt:366) + (Originally from ..\FSComp.txt:369) Known type parameters: %s - (Originally from ../FSComp.txt:367) + (Originally from ..\FSComp.txt:370) Known return type: %s - (Originally from ../FSComp.txt:368) + (Originally from ..\FSComp.txt:371) Known type of argument: %s - (Originally from ../FSComp.txt:364) + (Originally from ..\FSComp.txt:367) Known types of arguments: %s - (Originally from ../FSComp.txt:365) + (Originally from ..\FSComp.txt:368) No overloads match for method '%s'. - (Originally from ../FSComp.txt:363) + (Originally from ..\FSComp.txt:366) No %s member or object constructor named '%s' takes %d arguments. The named argument '%s' doesn't correspond to any argument or settable return property for any overload. - (Originally from ../FSComp.txt:361) + (Originally from ..\FSComp.txt:364) No %s member or object constructor named '%s' takes %d arguments. Note the call to this member also provides %d named arguments. - (Originally from ../FSComp.txt:360) + (Originally from ..\FSComp.txt:363) No %s member or object constructor named '%s' takes %d arguments - (Originally from ../FSComp.txt:359) + (Originally from ..\FSComp.txt:362) Method or object constructor '%s' not found - (Originally from ../FSComp.txt:362) + (Originally from ..\FSComp.txt:365) A unique overload for method '%s' could not be determined based on type information prior to this program point. A type annotation may be needed. - (Originally from ../FSComp.txt:369) + (Originally from ..\FSComp.txt:372) %s is not an instance method - (Originally from ../FSComp.txt:343) + (Originally from ..\FSComp.txt:346) %s is not a static method - (Originally from ../FSComp.txt:342) + (Originally from ..\FSComp.txt:345) The type '%s' has a method '%s' (full name '%s'), but the method is static - (Originally from ../FSComp.txt:311) + (Originally from ..\FSComp.txt:314) The type '%s' has a method '%s' (full name '%s'), but the method is not static - (Originally from ../FSComp.txt:312) + (Originally from ..\FSComp.txt:315) This method expects a CLI 'params' parameter in this position. 'params' is a way of passing a variable number of arguments to a method in languages such as C#. Consider passing an array for this argument - (Originally from ../FSComp.txt:339) + (Originally from ..\FSComp.txt:342) The member or object constructor '%s' takes %d type argument(s) but is here given %d. The required signature is '%s'. - (Originally from ../FSComp.txt:355) + (Originally from ..\FSComp.txt:358) The member or object constructor '%s' requires %d argument(s) but is here given %d unnamed and %d named argument(s). The required signature is '%s'. - (Originally from ../FSComp.txt:351) + (Originally from ..\FSComp.txt:354) The member or object constructor '%s' takes %d argument(s) but is here given %d. The required signature is '%s'. - (Originally from ../FSComp.txt:352) + (Originally from ..\FSComp.txt:355) The member or object constructor '%s' requires %d additional argument(s). The required signature is '%s'. Some names for missing arguments are %s. - (Originally from ../FSComp.txt:350) + (Originally from ..\FSComp.txt:353) The member or object constructor '%s' requires %d argument(s). The required signature is '%s'. Some names for missing arguments are %s. - (Originally from ../FSComp.txt:349) + (Originally from ..\FSComp.txt:352) The member or object constructor '%s' requires %d additional argument(s). The required signature is '%s'. - (Originally from ../FSComp.txt:348) + (Originally from ..\FSComp.txt:351) The member or object constructor '%s' requires %d argument(s). The required signature is '%s'. - (Originally from ../FSComp.txt:347) + (Originally from ..\FSComp.txt:350) The member or object constructor '%s' does not take %d argument(s). An overload was found taking %d arguments. - (Originally from ../FSComp.txt:358) + (Originally from ..\FSComp.txt:361) A member or object constructor '%s' taking %d arguments is not accessible from this code location. All accessible versions of method '%s' take %d arguments. - (Originally from ../FSComp.txt:356) + (Originally from ..\FSComp.txt:359) %s is not a static member - (Originally from ../FSComp.txt:335) + (Originally from ..\FSComp.txt:338) %s is not an instance member - (Originally from ../FSComp.txt:336) + (Originally from ..\FSComp.txt:339) The member or object constructor '%s' is not %s. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. - (Originally from ../FSComp.txt:341) + (Originally from ..\FSComp.txt:344) The member or object constructor '%s' is not %s - (Originally from ../FSComp.txt:340) + (Originally from ..\FSComp.txt:343) The member or object constructor '%s' has no argument or settable return property '%s'. %s. - (Originally from ../FSComp.txt:344) + (Originally from ..\FSComp.txt:347) This indexer expects %d arguments but is here given %d - (Originally from ../FSComp.txt:303) + (Originally from ..\FSComp.txt:306) Incorrect generic instantiation. No %s member named '%s' takes %d generic arguments. - (Originally from ../FSComp.txt:357) + (Originally from ..\FSComp.txt:360) A generic construct requires that the type '%s' is an unmanaged type - (Originally from ../FSComp.txt:327) + (Originally from ..\FSComp.txt:330) A generic construct requires that the type '%s' is a CLI or F# struct type - (Originally from ../FSComp.txt:326) + (Originally from ..\FSComp.txt:329) A generic construct requires that a generic type parameter be known as a struct or reference type. Consider adding a type annotation. - (Originally from ../FSComp.txt:332) + (Originally from ..\FSComp.txt:335) A generic construct requires that the type '%s' have reference semantics, but it does not, i.e. it is a struct - (Originally from ../FSComp.txt:329) + (Originally from ..\FSComp.txt:332) A generic construct requires that the type '%s' have a public default constructor - (Originally from ../FSComp.txt:331) + (Originally from ..\FSComp.txt:334) A generic construct requires that the type '%s' be non-abstract - (Originally from ../FSComp.txt:330) + (Originally from ..\FSComp.txt:333) Expected arguments to an instance member - (Originally from ../FSComp.txt:302) + (Originally from ..\FSComp.txt:305) Expecting a type supporting the operator '%s' but given a tuple type - (Originally from ../FSComp.txt:305) + (Originally from ..\FSComp.txt:308) Expecting a type supporting the operator '%s' but given a function type. You may be missing an argument to a function. - (Originally from ../FSComp.txt:304) + (Originally from ..\FSComp.txt:307) The object constructor '%s' takes %d argument(s) but is here given %d. The required signature is '%s'. If some of the arguments are meant to assign values to properties, consider separating those arguments with a comma (','). - (Originally from ../FSComp.txt:354) + (Originally from ..\FSComp.txt:357) The object constructor '%s' takes %d argument(s) but is here given %d. The required signature is '%s'. - (Originally from ../FSComp.txt:353) + (Originally from ..\FSComp.txt:356) The object constructor '%s' has no argument or settable return property '%s'. %s. - (Originally from ../FSComp.txt:345) + (Originally from ..\FSComp.txt:348) This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'. - (Originally from ../FSComp.txt:300) + (Originally from ..\FSComp.txt:303) Candidates:\n%s - (Originally from ../FSComp.txt:370) + (Originally from ..\FSComp.txt:373) Available overloads:\n%s - (Originally from ../FSComp.txt:371) + (Originally from ..\FSComp.txt:374) The argument types don't match - (Originally from ../FSComp.txt:338) + (Originally from ..\FSComp.txt:341) Argument length mismatch - (Originally from ../FSComp.txt:337) + (Originally from ..\FSComp.txt:340) Quotations cannot contain expressions that set union case fields - (Originally from ../FSComp.txt:291) + (Originally from ..\FSComp.txt:294) Quotations cannot contain expressions that set fields in exception values - (Originally from ../FSComp.txt:292) + (Originally from ..\FSComp.txt:295) Quotations cannot contain expressions that require byref pointers - (Originally from ../FSComp.txt:293) + (Originally from ..\FSComp.txt:296) Quotations cannot contain expressions that fetch union case indexes - (Originally from ../FSComp.txt:290) + (Originally from ..\FSComp.txt:293) Quotations cannot contain this kind of type - (Originally from ../FSComp.txt:298) + (Originally from ..\FSComp.txt:301) Quotations cannot contain this kind of pattern match - (Originally from ../FSComp.txt:296) + (Originally from ..\FSComp.txt:299) Quotations cannot contain this kind of constant - (Originally from ../FSComp.txt:295) + (Originally from ..\FSComp.txt:298) Quotations cannot contain expressions that fetch static fields - (Originally from ../FSComp.txt:287) + (Originally from ..\FSComp.txt:290) Quotations cannot contain object expressions - (Originally from ../FSComp.txt:285) + (Originally from ..\FSComp.txt:288) Quotations cannot contain inline assembly code or pattern matching on arrays - (Originally from ../FSComp.txt:288) + (Originally from ..\FSComp.txt:291) Quotations cannot contain function definitions that are inferred or declared to be generic. Consider adding some type constraints to make this a valid quoted expression. - (Originally from ../FSComp.txt:284) + (Originally from ..\FSComp.txt:287) Quotations cannot contain uses of generic expressions - (Originally from ../FSComp.txt:283) + (Originally from ..\FSComp.txt:286) Quotations cannot contain descending for loops - (Originally from ../FSComp.txt:289) + (Originally from ..\FSComp.txt:292) Quotations cannot contain array pattern matching - (Originally from ../FSComp.txt:297) + (Originally from ..\FSComp.txt:300) Quotations cannot contain expressions that take the address of a field - (Originally from ../FSComp.txt:286) + (Originally from ..\FSComp.txt:289) Quotations cannot contain expressions that make member constraint calls, or uses of operators that implicitly resolve to a member constraint call - (Originally from ../FSComp.txt:294) + (Originally from ..\FSComp.txt:297) A quotation may not involve an assignment to or taking the address of a captured local variable - (Originally from ../FSComp.txt:1301) + (Originally from ..\FSComp.txt:1318) Inner generic functions are not permitted in quoted expressions. Consider adding some type constraints until this function is no longer generic. - (Originally from ../FSComp.txt:1104) + (Originally from ..\FSComp.txt:1115) The variable '%s' is bound in a quotation but is used as part of a spliced expression. This is not permitted since it may escape its scope. - (Originally from ../FSComp.txt:282) + (Originally from ..\FSComp.txt:285) The dependency manager extension %s could not be loaded. Message: %s - (Originally from ../FSComp.txt:1489) + (Originally from ..\FSComp.txt:1508) Key container signing is not supported on this platform. - (Originally from ../FSComp.txt:1564) + (Originally from ..\FSComp.txt:1609) The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. - (Originally from ../FSComp.txt:1563) + (Originally from ..\FSComp.txt:1608) The conversion from %s to %s is a compile-time safe upcast, not a downcast. Consider using the :> (upcast) operator instead of the :?> (downcast) operator. - (Originally from ../FSComp.txt:1354) + (Originally from ..\FSComp.txt:1371) The conversion from %s to %s is a compile-time safe upcast, not a downcast. Consider using 'upcast' instead of 'downcast'. - (Originally from ../FSComp.txt:1353) + (Originally from ..\FSComp.txt:1370) A ';' is used to separate field values in records. Consider replacing ',' with ';'. - (Originally from ../FSComp.txt:28) + (Originally from ..\FSComp.txt:28) The variable '%s' is used in an invalid way - (Originally from ../FSComp.txt:240) + (Originally from ..\FSComp.txt:243) The type of a field using the 'DefaultValue' attribute must admit default initialization, i.e. have 'null' as a proper value or be a struct type whose fields all admit default initialization. You can use 'DefaultValue(false)' to disable this check - (Originally from ../FSComp.txt:280) + (Originally from ..\FSComp.txt:283) The value '%s' is unused - (Originally from ../FSComp.txt:1056) + (Originally from ..\FSComp.txt:1059) The recursive object reference '%s' is unused. The presence of a recursive object reference adds runtime initialization checks to members in this and derived types. Consider removing this recursive object reference. - (Originally from ../FSComp.txt:1057) + (Originally from ..\FSComp.txt:1060) default augmentation of the union case - (Originally from ../FSComp.txt:265) + (Originally from ..\FSComp.txt:268) compiled form of the union case - (Originally from ../FSComp.txt:264) + (Originally from ..\FSComp.txt:267) The type '%s' is less accessible than the value, member or type '%s' it is used in. - (Originally from ../FSComp.txt:241) + (Originally from ..\FSComp.txt:244) A type variable has been constrained by multiple different class types. A type variable may only have one class constraint. - (Originally from ../FSComp.txt:1312) + (Originally from ..\FSComp.txt:1329) 'System.Void' can only be used as 'typeof<System.Void>' in F# - (Originally from ../FSComp.txt:242) + (Originally from ..\FSComp.txt:245) Struct members cannot return the address of fields of the struct by reference - (Originally from ../FSComp.txt:1476) + (Originally from ..\FSComp.txt:1495) Expression-splicing operators may only be used within quotations - (Originally from ../FSComp.txt:245) + (Originally from ..\FSComp.txt:248) A method return type would contain byrefs which is not permitted - (Originally from ../FSComp.txt:257) + (Originally from ..\FSComp.txt:260) [<ReflectedDefinition>] terms cannot contain uses of the prefix splice operator '%%' - (Originally from ../FSComp.txt:262) + (Originally from ..\FSComp.txt:265) A protected member is called or 'base' is being used. This is only allowed in the direct implementation of members since they could escape their object scope. - (Originally from ../FSComp.txt:237) + (Originally from ..\FSComp.txt:240) The property '%s' has the same name as a method in type '%s'. - (Originally from ../FSComp.txt:266) + (Originally from ..\FSComp.txt:269) The property '%s' has the same name as another property in type '%s', but one takes indexer arguments and the other does not. You may be missing an indexer argument to one of your properties. - (Originally from ../FSComp.txt:268) + (Originally from ..\FSComp.txt:271) Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL. - (Originally from ../FSComp.txt:251) + (Originally from ..\FSComp.txt:254) This value can't be assigned because the target '%s' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - (Originally from ../FSComp.txt:1473) + (Originally from ..\FSComp.txt:1492) The Span or IsByRefLike variable '%s' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - (Originally from ../FSComp.txt:1478) + (Originally from ..\FSComp.txt:1497) A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - (Originally from ../FSComp.txt:1479) + (Originally from ..\FSComp.txt:1498) ReflectedDefinitionAttribute may not be applied to an instance member on a struct type, because the instance member takes an implicit 'this' byref parameter - (Originally from ../FSComp.txt:1098) + (Originally from ..\FSComp.txt:1109) First-class uses of the expression-splicing operator are not permitted - (Originally from ../FSComp.txt:246) + (Originally from ..\FSComp.txt:249) First-class uses of the 'reraise' function is not permitted - (Originally from ../FSComp.txt:248) + (Originally from ..\FSComp.txt:251) Using the 'nameof' operator as a first-class function value is not permitted. - (Originally from ../FSComp.txt:1491) + (Originally from ..\FSComp.txt:1510) First-class uses of the address-of operators are not permitted - (Originally from ../FSComp.txt:247) + (Originally from ..\FSComp.txt:250) Type '%s' is illegal because in byref<T>, T cannot contain byref types. - (Originally from ../FSComp.txt:1284) + (Originally from ..\FSComp.txt:1301) The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - (Originally from ../FSComp.txt:1477) + (Originally from ..\FSComp.txt:1496) The type abbreviation contains byrefs. This is not permitted by F#. - (Originally from ../FSComp.txt:281) + (Originally from ..\FSComp.txt:284) The byref typed value '%s' cannot be used at this point - (Originally from ../FSComp.txt:249) + (Originally from ..\FSComp.txt:252) A byref typed value would be stored here. Top-level let-bound byref values are not permitted. - (Originally from ../FSComp.txt:261) + (Originally from ..\FSComp.txt:264) The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - (Originally from ../FSComp.txt:1472) + (Originally from ..\FSComp.txt:1491) The address of the variable '%s' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - (Originally from ../FSComp.txt:1364) + (Originally from ..\FSComp.txt:1381) The address of the static field '%s' cannot be used at this point - (Originally from ../FSComp.txt:253) + (Originally from ..\FSComp.txt:256) The address of the variable '%s' cannot be used at this point - (Originally from ../FSComp.txt:252) + (Originally from ..\FSComp.txt:255) The address of an array element cannot be used at this point - (Originally from ../FSComp.txt:255) + (Originally from ..\FSComp.txt:258) The address of the field '%s' cannot be used at this point - (Originally from ../FSComp.txt:254) + (Originally from ..\FSComp.txt:257) This type implements the same interface at different generic instantiations '%s' and '%s'. This is not permitted in this version of F#. - (Originally from ../FSComp.txt:279) + (Originally from ..\FSComp.txt:282) The member '%s' is used in an invalid way. A use of '%s' has been inferred prior to its definition at or near '%s'. This is an invalid forward reference. - (Originally from ../FSComp.txt:260) + (Originally from ..\FSComp.txt:263) 'base' values may only be used to make direct calls to the base implementations of overridden members - (Originally from ../FSComp.txt:250) + (Originally from ..\FSComp.txt:253) The function or method has an invalid return type '%s'. This is not permitted by the rules of Common IL. - (Originally from ../FSComp.txt:1494) + (Originally from ..\FSComp.txt:1513) The parameter '%s' has an invalid type '%s'. This is not permitted by the rules of Common IL. - (Originally from ../FSComp.txt:1493) + (Originally from ..\FSComp.txt:1512) Invalid custom attribute value (not a constant or literal) - (Originally from ../FSComp.txt:258) + (Originally from ..\FSComp.txt:261) + + + + + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + (Originally from ..\FSComp.txt:1572) + + + + + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + (Originally from ..\FSComp.txt:1570) + + + + + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + (Originally from ..\FSComp.txt:1573) + + + + + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + (Originally from ..\FSComp.txt:1571) The property '%s' of type '%s' has a getter and a setter that do not match. If one is abstract then the other must be as well. - (Originally from ../FSComp.txt:267) + (Originally from ..\FSComp.txt:270) A property's getter and setter must have the same type. Property '%s' has getter of type '%s' but setter of type '%s'. - (Originally from ../FSComp.txt:1321) + (Originally from ..\FSComp.txt:1338) The type of a first-class function cannot contain byrefs - (Originally from ../FSComp.txt:256) + (Originally from ..\FSComp.txt:259) Feature '%s' requires the F# library for language version %s or greater. - (Originally from ../FSComp.txt:1504) + (Originally from ..\FSComp.txt:1523) Feature '%s' is not supported by target runtime. - (Originally from ../FSComp.txt:1502) + (Originally from ..\FSComp.txt:1521) Feature '%s' is not available in F# %s. Please use language version %s or greater. - (Originally from ../FSComp.txt:1501) + (Originally from ..\FSComp.txt:1520) A type instantiation involves a byref type. This is not permitted by the rules of Common IL. - (Originally from ../FSComp.txt:243) + (Originally from ..\FSComp.txt:246) Calls to 'reraise' may only occur directly in a handler of a try-with - (Originally from ../FSComp.txt:244) + (Originally from ..\FSComp.txt:247) A function labeled with the 'EntryPointAttribute' attribute must be the last declaration in the last file in the compilation sequence. - (Originally from ../FSComp.txt:263) + (Originally from ..\FSComp.txt:266) Duplicate property. The property '%s' has the same name and signature as another property in type '%s' once tuples, functions, units of measure and/or provided types are erased. - (Originally from ../FSComp.txt:276) + (Originally from ..\FSComp.txt:279) Duplicate property. The property '%s' has the same name and signature as another property in type '%s'. - (Originally from ../FSComp.txt:275) + (Originally from ..\FSComp.txt:278) Duplicate method. The method '%s' has the same name and signature as another method in type '%s' once tuples, functions, units of measure and/or provided types are erased. - (Originally from ../FSComp.txt:272) + (Originally from ..\FSComp.txt:275) Duplicate method. The abstract method '%s' has the same name and signature as an abstract method in an inherited type once tuples, functions, units of measure and/or provided types are erased. - (Originally from ../FSComp.txt:278) + (Originally from ..\FSComp.txt:281) Duplicate method. The abstract method '%s' has the same name and signature as an abstract method in an inherited type. - (Originally from ../FSComp.txt:277) + (Originally from ..\FSComp.txt:280) The method '%s' has curried arguments but has the same name as another method in type '%s'. Methods with curried arguments cannot be overloaded. Consider using a method taking tupled arguments. - (Originally from ../FSComp.txt:273) + (Originally from ..\FSComp.txt:276) Duplicate method. The method '%s' has the same name and signature as another method in type '%s'. - (Originally from ../FSComp.txt:271) + (Originally from ..\FSComp.txt:274) Methods with curried arguments cannot declare 'out', 'ParamArray', 'optional', 'ReflectedDefinition', 'byref', 'CallerLineNumber', 'CallerMemberName', or 'CallerFilePath' arguments - (Originally from ../FSComp.txt:274) + (Originally from ..\FSComp.txt:277) A type would store a byref typed value. This is not permitted by Common IL. - (Originally from ../FSComp.txt:269) + (Originally from ..\FSComp.txt:272) The byref-typed variable '%s' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. - (Originally from ../FSComp.txt:238) + (Originally from ..\FSComp.txt:241) The 'base' keyword is used in an invalid way. Base calls cannot be used in closures. Consider using a private member to make base calls. - (Originally from ../FSComp.txt:239) + (Originally from ..\FSComp.txt:242) The attribute type '%s' has 'AllowMultiple=false'. Multiple instances of this attribute cannot be attached to a single language element. - (Originally from ../FSComp.txt:259) + (Originally from ..\FSComp.txt:262) Redundant arguments are being ignored in function '%s'. Expected %d but got %d arguments. - (Originally from ../FSComp.txt:1343) + (Originally from ..\FSComp.txt:1360) Type inference caused an inference type variable to escape its scope. Consider adding type annotations to make your code less generic. - (Originally from ../FSComp.txt:1342) + (Originally from ..\FSComp.txt:1359) Type inference caused the type variable %s to escape its scope. Consider adding an explicit type parameter declaration or adjusting your code to be less generic. - (Originally from ../FSComp.txt:1341) + (Originally from ..\FSComp.txt:1358) Lowercase literal '%s' is being shadowed by a new pattern with the same name. Only uppercase and module-prefixed literals can be used as named patterns. - (Originally from ../FSComp.txt:1344) + (Originally from ..\FSComp.txt:1361) The operator '%s' cannot be resolved. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'. - (Originally from ../FSComp.txt:1315) + (Originally from ..\FSComp.txt:1332) Unrecognized option: '%s' - (Originally from ../FSComp.txt:69) + (Originally from ..\FSComp.txt:72) The non-generic type '%s' does not expect any type arguments, but here is given %d type argument(s) - (Originally from ../FSComp.txt:30) + (Originally from ..\FSComp.txt:30) Filename '%s' contains invalid character '%s' - (Originally from ../FSComp.txt:1102) + (Originally from ..\FSComp.txt:1113) The signature file '%s' does not have a corresponding implementation file. If an implementation file exists then check the 'module' and 'namespace' declarations in the signature and implementation files match. - (Originally from ../FSComp.txt:66) + (Originally from ..\FSComp.txt:69) A signature for the file or module '%s' has already been specified - (Originally from ../FSComp.txt:63) + (Originally from ..\FSComp.txt:66) The search directory '%s' could not be found - (Originally from ../FSComp.txt:41) + (Originally from ..\FSComp.txt:42) Problem with filename '%s': %s - (Originally from ../FSComp.txt:37) + (Originally from ..\FSComp.txt:38) Problem reading assembly '%s': %s - (Originally from ../FSComp.txt:1308) + (Originally from ..\FSComp.txt:1325) The '--pdb' option requires the '--debug' option to be used - (Originally from ../FSComp.txt:39) + (Originally from ..\FSComp.txt:40) Option requires parameter: %s - (Originally from ../FSComp.txt:51) + (Originally from ..\FSComp.txt:52) No inputs specified - (Originally from ../FSComp.txt:38) + (Originally from ..\FSComp.txt:39) This file contains multiple declarations of the form 'module SomeNamespace.SomeModule'. Only one declaration of this form is permitted in a file. Change your file to use an initial namespace declaration and/or use 'module ModuleName = ...' to define your modules. - (Originally from ../FSComp.txt:50) + (Originally from ..\FSComp.txt:51) Files in libraries or multiple-file applications must begin with a namespace or module declaration, e.g. 'namespace SomeNamespace.SubNamespace' or 'module SomeNamespace.SomeModule'. Only the last source file of an application may omit such a declaration. - (Originally from ../FSComp.txt:48) + (Originally from ..\FSComp.txt:49) Invalid warning number '%s' - (Originally from ../FSComp.txt:34) + (Originally from ..\FSComp.txt:35) Invalid version string '%s' - (Originally from ../FSComp.txt:35) + (Originally from ..\FSComp.txt:36) Invalid version file '%s' - (Originally from ../FSComp.txt:36) + (Originally from ..\FSComp.txt:37) + + + + + The file extension of '%s' is not recognized. Source files must have extension .fs, .fsi, .fsx or .fsscript + (Originally from ..\FSComp.txt:55) + + + + + The file extension of '%s' is not recognized. Source files must have extension .fs, .fsi, .fsx or .fsscript. To enable the deprecated use of .ml or .mli extensions, use '--langversion:5.0' and '--mlcompatibility'. + (Originally from ..\FSComp.txt:56) The file extension of '%s' is not recognized. Source files must have extension .fs, .fsi, .fsx, .fsscript, .ml or .mli. - (Originally from ../FSComp.txt:53) + (Originally from ..\FSComp.txt:54) The search directory '%s' is invalid - (Originally from ../FSComp.txt:40) + (Originally from ..\FSComp.txt:41) Unrecognized privacy setting '%s' for managed resource, valid options are 'public' and 'private' - (Originally from ../FSComp.txt:44) + (Originally from ..\FSComp.txt:45) Invalid module or namespace name - (Originally from ../FSComp.txt:70) + (Originally from ..\FSComp.txt:73) Invalid directive. Expected '#time', '#time \"on\"' or '#time \"off\"'. - (Originally from ../FSComp.txt:61) + (Originally from ..\FSComp.txt:64) Invalid directive. Expected '#r \"<file-or-assembly>\"'. - (Originally from ../FSComp.txt:59) + (Originally from ..\FSComp.txt:62) Invalid directive. Expected '#load \"<file>\" ... \"<file>\"'. - (Originally from ../FSComp.txt:60) + (Originally from ..\FSComp.txt:63) Invalid directive. Expected '#I \"<path>\"'. - (Originally from ../FSComp.txt:58) + (Originally from ..\FSComp.txt:61) '%s' is not a valid filename - (Originally from ../FSComp.txt:42) + (Originally from ..\FSComp.txt:43) '%s' is not a valid assembly name - (Originally from ../FSComp.txt:43) + (Originally from ..\FSComp.txt:44) The declarations in this file will be placed in an implicit module '%s' based on the file name '%s'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. - (Originally from ../FSComp.txt:47) + (Originally from ..\FSComp.txt:48) An implementation of file or module '%s' has already been given. Compilation order is significant in F# because of type inference. You may need to adjust the order of your files to place the signature file before the implementation. In Visual Studio files are type-checked in the order they appear in the project file, which can be edited manually or adjusted using the solution explorer. - (Originally from ../FSComp.txt:64) + (Originally from ..\FSComp.txt:67) An implementation of the file or module '%s' has already been given - (Originally from ../FSComp.txt:65) + (Originally from ..\FSComp.txt:68) FSharp.Core.sigdata not found alongside FSharp.Core. File expected in %s. Consider upgrading to a more recent version of FSharp.Core, where this file is no longer be required. - (Originally from ../FSComp.txt:1100) + (Originally from ..\FSComp.txt:1111) File '%s' not found alongside FSharp.Core. File expected in %s. Consider upgrading to a more recent version of FSharp.Core, where this file is no longer be required. - (Originally from ../FSComp.txt:1101) + (Originally from ..\FSComp.txt:1112) Error opening binary file '%s': %s - (Originally from ../FSComp.txt:56) + (Originally from ..\FSComp.txt:59) Directives inside modules are ignored - (Originally from ../FSComp.txt:62) + (Originally from ..\FSComp.txt:65) The F#-compiled DLL '%s' needs to be recompiled to be used with this version of F# - (Originally from ../FSComp.txt:57) + (Originally from ..\FSComp.txt:60) Could not resolve assembly '%s' required by '%s' - (Originally from ../FSComp.txt:55) + (Originally from ..\FSComp.txt:58) Could not resolve assembly '%s' - (Originally from ../FSComp.txt:54) + (Originally from ..\FSComp.txt:57) Source file '%s' could not be found - (Originally from ../FSComp.txt:52) + (Originally from ..\FSComp.txt:53) The file extensions '.ml' and '.mli' are for ML compatibility - (Originally from ../FSComp.txt:1085) + (Originally from ..\FSComp.txt:1095) Unable to read assembly '%s' - (Originally from ../FSComp.txt:45) + (Originally from ..\FSComp.txt:46) Assembly resolution failure at or near this location - (Originally from ../FSComp.txt:46) + (Originally from ..\FSComp.txt:47) '%s' is not a valid integer argument - (Originally from ../FSComp.txt:67) + (Originally from ..\FSComp.txt:70) '%s' is not a valid floating point argument - (Originally from ../FSComp.txt:68) + (Originally from ..\FSComp.txt:71) A type cannot have both the 'ReferenceEquality' and 'StructuralEquality' or 'StructuralComparison' attributes - (Originally from ../FSComp.txt:212) + (Originally from ..\FSComp.txt:215) The 'StructuralEquality' attribute must be used in conjunction with the 'NoComparison' or 'StructuralComparison' attributes - (Originally from ../FSComp.txt:211) + (Originally from ..\FSComp.txt:214) The 'StructuralComparison' attribute must be used in conjunction with the 'StructuralEquality' attribute - (Originally from ../FSComp.txt:210) + (Originally from ..\FSComp.txt:213) A type with attribute 'ReferenceEquality' cannot have an explicit implementation of 'Object.Equals(obj)', 'System.IEquatable<_>' or 'System.Collections.IStructuralEquatable' - (Originally from ../FSComp.txt:214) + (Originally from ..\FSComp.txt:217) Only record, union, exception and struct types may be augmented with the 'ReferenceEquality', 'StructuralEquality' and 'StructuralComparison' attributes - (Originally from ../FSComp.txt:213) + (Originally from ..\FSComp.txt:216) The 'ReferenceEquality' attribute cannot be used on structs. Consider using the 'StructuralEquality' attribute instead, or implement an override for 'System.Object.Equals(obj)'. - (Originally from ../FSComp.txt:207) + (Originally from ..\FSComp.txt:210) The 'NoEquality' attribute must be used in conjunction with the 'NoComparison' attribute - (Originally from ../FSComp.txt:209) + (Originally from ..\FSComp.txt:212) A type with attribute 'NoEquality' should not usually have an explicit implementation of 'Object.Equals(obj)'. Disable this warning if this is intentional for interoperability purposes - (Originally from ../FSComp.txt:217) + (Originally from ..\FSComp.txt:220) A type with attribute 'NoComparison' should not usually have an explicit implementation of 'System.IComparable', 'System.IComparable<_>' or 'System.Collections.IStructuralComparable'. Disable this warning if this is intentional for interoperability purposes - (Originally from ../FSComp.txt:218) + (Originally from ..\FSComp.txt:221) This type uses an invalid mix of the attributes 'NoEquality', 'ReferenceEquality', 'StructuralEquality', 'NoComparison' and 'StructuralComparison' - (Originally from ../FSComp.txt:208) + (Originally from ..\FSComp.txt:211) A type with attribute 'CustomEquality' must have an explicit implementation of at least one of 'Object.Equals(obj)', 'System.IEquatable<_>' or 'System.Collections.IStructuralEquatable' - (Originally from ../FSComp.txt:215) + (Originally from ..\FSComp.txt:218) The 'CustomEquality' attribute must be used in conjunction with the 'NoComparison' or 'CustomComparison' attributes - (Originally from ../FSComp.txt:219) + (Originally from ..\FSComp.txt:222) A type with attribute 'CustomComparison' must have an explicit implementation of at least one of 'System.IComparable' or 'System.Collections.IStructuralComparable' - (Originally from ../FSComp.txt:216) + (Originally from ..\FSComp.txt:219) Error while parsing embedded IL type - (Originally from ../FSComp.txt:204) + (Originally from ..\FSComp.txt:207) Error while parsing embedded IL - (Originally from ../FSComp.txt:203) + (Originally from ..\FSComp.txt:206) Invalid expression on left of assignment - (Originally from ../FSComp.txt:206) + (Originally from ..\FSComp.txt:209) This indexer notation has been removed from the F# language - (Originally from ../FSComp.txt:205) + (Originally from ..\FSComp.txt:208) .NET Framework - (Originally from ../FSComp.txt:955) + (Originally from ..\FSComp.txt:958) Global Assembly Cache - (Originally from ../FSComp.txt:956) + (Originally from ..\FSComp.txt:959) Found by AssemblyFolders registry key - (Originally from ../FSComp.txt:953) + (Originally from ..\FSComp.txt:956) Found by AssemblyFoldersEx registry key - (Originally from ../FSComp.txt:954) + (Originally from ..\FSComp.txt:957) - All elements of an array must be of the same type as the first element, which here is '%s'. This element has type '%s'. - (Originally from ../FSComp.txt:22) + All elements of an array must be implicitly convertible to the type of the first element, which here is '%s'. This element has type '%s'. + (Originally from ..\FSComp.txt:22) Add . for indexer access. - (Originally from ../FSComp.txt:20) + (Originally from ..\FSComp.txt:20) Active pattern '%s' is not a function - (Originally from ../FSComp.txt:1087) + (Originally from ..\FSComp.txt:1098) Active pattern '%s' has a result type containing type variables that are not determined by the input. The common cause is a when a result case is not mentioned, e.g. 'let (|A|B|) (x:int) = A x'. This can be fixed with a type constraint, e.g. 'let (|A|B|) (x:int) : Choice<int,unit> = A x' - (Originally from ../FSComp.txt:1088) + (Originally from ..\FSComp.txt:1099) The mutable local '%s' is implicitly allocated as a reference cell because it has been captured by a closure. This warning is for informational purposes only to indicate where implicit allocations are performed. - (Originally from ../FSComp.txt:1333) + (Originally from ..\FSComp.txt:1350) Module '%s' contains\n %s \nbut its signature specifies\n %s \nOne is virtual and the other isn't - (Originally from ../FSComp.txt:112) + (Originally from ..\FSComp.txt:115) Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe types differ - (Originally from ../FSComp.txt:104) + (Originally from ..\FSComp.txt:107) Module '%s' contains\n %s \nbut its signature specifies\n %s \nOne is static and the other isn't - (Originally from ../FSComp.txt:111) + (Originally from ..\FSComp.txt:114) Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe compiled representation of this method is as a static member but the signature indicates its compiled representation is as an instance member - (Originally from ../FSComp.txt:117) + (Originally from ..\FSComp.txt:120) Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe respective type parameter counts differ - (Originally from ../FSComp.txt:103) + (Originally from ..\FSComp.txt:106) Module '%s' contains\n %s \nbut its signature specifies\n %s \nOne is marked as an override and the other isn't - (Originally from ../FSComp.txt:115) + (Originally from ..\FSComp.txt:118) Module '%s' contains\n %s \nbut its signature specifies\n %s \nOne is a type function and the other is not. The signature requires explicit type parameters if they are present in the implementation. - (Originally from ../FSComp.txt:102) + (Originally from ..\FSComp.txt:105) Module '%s' contains\n %s \nbut its signature specifies\n %s \nOne is a constructor/property and the other is not - (Originally from ../FSComp.txt:116) + (Originally from ..\FSComp.txt:119) Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe names differ - (Originally from ../FSComp.txt:96) + (Originally from ..\FSComp.txt:99) Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe literal constant values and/or attributes differ - (Originally from ../FSComp.txt:101) + (Originally from ..\FSComp.txt:104) Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe compiled representation of this method is as an instance member, but the signature indicates its compiled representation is as a static member - (Originally from ../FSComp.txt:118) + (Originally from ..\FSComp.txt:121) Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe inline flags differ - (Originally from ../FSComp.txt:100) + (Originally from ..\FSComp.txt:103) Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe number of generic parameters in the signature and implementation differ (the signature declares %s but the implementation declares %s - (Originally from ../FSComp.txt:107) + (Originally from ..\FSComp.txt:110) Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe generic parameters in the signature and implementation have different kinds. Perhaps there is a missing [<Measure>] attribute. - (Originally from ../FSComp.txt:108) + (Originally from ..\FSComp.txt:111) Module '%s' contains\n %s \nbut its signature specifies\n %s \nOne is final and the other isn't - (Originally from ../FSComp.txt:114) + (Originally from ..\FSComp.txt:117) Module '%s' contains\n %s \nbut its signature specifies\n %s \nOne is an extension member and the other is not - (Originally from ../FSComp.txt:105) + (Originally from ..\FSComp.txt:108) Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe CLI member names differ - (Originally from ../FSComp.txt:110) + (Originally from ..\FSComp.txt:113) Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe display names differ - (Originally from ../FSComp.txt:98) + (Originally from ..\FSComp.txt:101) Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe compiled names differ - (Originally from ../FSComp.txt:97) + (Originally from ..\FSComp.txt:100) Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe mutability attributes differ - (Originally from ../FSComp.txt:95) + (Originally from ..\FSComp.txt:98) Module '%s' contains\n %s \nbut its signature specifies\n %s \nAn arity was not inferred for this value - (Originally from ../FSComp.txt:106) + (Originally from ..\FSComp.txt:109) Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe arities in the signature and implementation differ. The signature specifies that '%s' is function definition or lambda expression accepting at least %s argument(s), but the implementation is a computed function value. To declare that a computed function value is a permitted implementation simply parenthesize its type in the signature, e.g.\n\tval %s: int -> (int -> int)\ninstead of\n\tval %s: int -> int -> int. - (Originally from ../FSComp.txt:109) + (Originally from ..\FSComp.txt:112) Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe accessibility specified in the signature is more than that specified in the implementation - (Originally from ../FSComp.txt:99) + (Originally from ..\FSComp.txt:102) Module '%s' contains\n %s \nbut its signature specifies\n %s \nOne is abstract and the other isn't - (Originally from ../FSComp.txt:113) + (Originally from ..\FSComp.txt:116) @@ -8899,337 +9319,337 @@ The module contains the constructor\n %s \nbut its signature specifies\n %s \nThe types of the fields differ - (Originally from ../FSComp.txt:153) + (Originally from ..\FSComp.txt:156) The module contains the constructor\n %s \nbut its signature specifies\n %s \nThe names differ - (Originally from ../FSComp.txt:151) + (Originally from ..\FSComp.txt:154) The module contains the constructor\n %s \nbut its signature specifies\n %s \nThe respective number of data fields differ - (Originally from ../FSComp.txt:152) + (Originally from ..\FSComp.txt:155) The module contains the constructor\n %s \nbut its signature specifies\n %s \nthe accessibility specified in the signature is more than that specified in the implementation - (Originally from ../FSComp.txt:154) + (Originally from ..\FSComp.txt:157) Invalid recursive reference to an abstract slot - (Originally from ../FSComp.txt:958) + (Originally from ..\FSComp.txt:961) The module contains the field\n %s \nbut its signature specifies\n %s \nThe types differ - (Originally from ../FSComp.txt:160) + (Originally from ..\FSComp.txt:163) The module contains the field\n %s \nbut its signature specifies\n %s \nThe 'static' modifiers differ - (Originally from ../FSComp.txt:157) + (Originally from ..\FSComp.txt:160) The module contains the field\n %s \nbut its signature specifies\n %s \nThe names differ - (Originally from ../FSComp.txt:155) + (Originally from ..\FSComp.txt:158) The module contains the field\n %s \nbut its signature specifies\n %s \nThe 'mutable' modifiers differ - (Originally from ../FSComp.txt:158) + (Originally from ..\FSComp.txt:161) The module contains the field\n %s \nbut its signature specifies\n %s \nThe 'literal' modifiers differ - (Originally from ../FSComp.txt:159) + (Originally from ..\FSComp.txt:162) The module contains the field\n %s \nbut its signature specifies\n %s \nthe accessibility specified in the signature is more than that specified in the implementation - (Originally from ../FSComp.txt:156) + (Originally from ..\FSComp.txt:159) The exception definitions are not compatible because the exception abbreviations in the signature and implementation differ. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s. - (Originally from ../FSComp.txt:178) + (Originally from ..\FSComp.txt:181) The exception definitions are not compatible because a CLI exception mapping is being hidden by a signature. The exception mapping must be visible to other modules. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s - (Originally from ../FSComp.txt:175) + (Originally from ..\FSComp.txt:178) The exception definitions are not compatible because the order of the fields is different in the signature and implementation. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s. - (Originally from ../FSComp.txt:182) + (Originally from ..\FSComp.txt:185) The exception definitions are not compatible because the field '%s' was required by the signature but was not specified by the implementation. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s. - (Originally from ../FSComp.txt:180) + (Originally from ..\FSComp.txt:183) The exception definitions are not compatible because the field '%s' was present in the implementation but not in the signature. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s. - (Originally from ../FSComp.txt:181) + (Originally from ..\FSComp.txt:184) The exception definitions are not compatible because the exception declarations differ. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s. - (Originally from ../FSComp.txt:179) + (Originally from ..\FSComp.txt:182) The exception definitions are not compatible because the CLI representations differ. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s - (Originally from ../FSComp.txt:176) + (Originally from ..\FSComp.txt:179) The exception definitions are not compatible because the exception abbreviation is being hidden by the signature. The abbreviation must be visible to other CLI languages. Consider making the abbreviation visible in the signature. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s. - (Originally from ../FSComp.txt:177) + (Originally from ..\FSComp.txt:180) The %s definitions for type '%s' in the signature and implementation are not compatible because the types have different base types - (Originally from ../FSComp.txt:131) + (Originally from ..\FSComp.txt:134) The %s definitions for type '%s' in the signature and implementation are not compatible because a type representation is being hidden by a signature - (Originally from ../FSComp.txt:137) + (Originally from ..\FSComp.txt:140) The %s definitions for type '%s' in the signature and implementation are not compatible because the types are of different kinds - (Originally from ../FSComp.txt:138) + (Originally from ..\FSComp.txt:141) The %s definitions for type '%s' in the signature and implementation are not compatible because the signature says this type may use nulls as an extra value but the implementation does not - (Originally from ../FSComp.txt:126) + (Originally from ..\FSComp.txt:129) The %s definitions for type '%s' in the signature and implementation are not compatible because the signature says this type may use nulls as a representation but the implementation does not - (Originally from ../FSComp.txt:125) + (Originally from ..\FSComp.txt:128) The %s definitions for type '%s' in the signature and implementation are not compatible because the signature is an abstract class but the implementation is not. Consider adding the [<AbstractClass>] attribute to the implementation. - (Originally from ../FSComp.txt:130) + (Originally from ..\FSComp.txt:133) The %s definitions for type '%s' in the signature and implementation are not compatible because the signature defines the %s '%s' but the implementation does not (or does, but not in the same order) - (Originally from ../FSComp.txt:133) + (Originally from ..\FSComp.txt:136) The %s definitions for type '%s' in the signature and implementation are not compatible because the signature declares a %s while the implementation declares a %s - (Originally from ../FSComp.txt:147) + (Originally from ..\FSComp.txt:150) The %s definitions for type '%s' in the signature and implementation are not compatible because the signature has an abbreviation while the implementation does not - (Originally from ../FSComp.txt:150) + (Originally from ..\FSComp.txt:153) The %s definitions for type '%s' in the signature and implementation are not compatible because the representations differ - (Originally from ../FSComp.txt:140) + (Originally from ..\FSComp.txt:143) The %s definitions for type '%s' in the signature and implementation are not compatible because the respective type parameter counts differ - (Originally from ../FSComp.txt:120) + (Originally from ..\FSComp.txt:123) The %s definitions for type '%s' in the signature and implementation are not compatible because the number of %ss differ - (Originally from ../FSComp.txt:132) + (Originally from ..\FSComp.txt:135) The %s definitions in the signature and implementation are not compatible because the names differ. The type is called '%s' in the signature file but '%s' in implementation. - (Originally from ../FSComp.txt:119) + (Originally from ..\FSComp.txt:122) The %s definitions for type '%s' in the signature and implementation are not compatible because the signature requires that the type supports the interface %s but the interface has not been implemented - (Originally from ../FSComp.txt:122) + (Originally from ..\FSComp.txt:125) The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation type is sealed but the signature implies it is not. Consider adding the [<Sealed>] attribute to the signature. - (Originally from ../FSComp.txt:127) + (Originally from ..\FSComp.txt:130) The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation says this type may use nulls as an extra value but the signature does not - (Originally from ../FSComp.txt:124) + (Originally from ..\FSComp.txt:127) The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation says this type may use nulls as a representation but the signature does not - (Originally from ../FSComp.txt:123) + (Originally from ..\FSComp.txt:126) The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation type is not sealed but signature implies it is. Consider adding the [<Sealed>] attribute to the implementation. - (Originally from ../FSComp.txt:128) + (Originally from ..\FSComp.txt:131) The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation is an abstract class but the signature is not. Consider adding the [<AbstractClass>] attribute to the signature. - (Originally from ../FSComp.txt:129) + (Originally from ..\FSComp.txt:132) The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation defines a struct but the signature defines a type with a hidden representation - (Originally from ../FSComp.txt:135) + (Originally from ..\FSComp.txt:138) The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation defines the %s '%s' but the signature does not (or does, but not in the same order) - (Originally from ../FSComp.txt:134) + (Originally from ..\FSComp.txt:137) The %s definitions for type '%s' in the signature and implementation are not compatible because the IL representations differ - (Originally from ../FSComp.txt:139) + (Originally from ..\FSComp.txt:142) The %s definitions for type '%s' in the signature and implementation are not compatible because the field %s was present in the implementation but not in the signature - (Originally from ../FSComp.txt:141) + (Originally from ..\FSComp.txt:144) The %s definitions for type '%s' in the signature and implementation are not compatible because the field %s was required by the signature but was not specified by the implementation - (Originally from ../FSComp.txt:143) + (Originally from ..\FSComp.txt:146) The %s definitions for type '%s' in the signature and implementation are not compatible because the order of the fields is different in the signature and implementation - (Originally from ../FSComp.txt:142) + (Originally from ..\FSComp.txt:145) The %s definitions for type '%s' in the signature and implementation are not compatible because the field '%s' was present in the implementation but not in the signature. Struct types must now reveal their fields in the signature for the type, though the fields may still be labelled 'private' or 'internal'. - (Originally from ../FSComp.txt:144) + (Originally from ..\FSComp.txt:147) The %s definitions for type '%s' in the signature and implementation are not compatible because a CLI type representation is being hidden by a signature - (Originally from ../FSComp.txt:136) + (Originally from ..\FSComp.txt:139) The %s definitions for type '%s' in the signature and implementation are not compatible because the accessibility specified in the signature is more than that specified in the implementation - (Originally from ../FSComp.txt:121) + (Originally from ..\FSComp.txt:124) The %s definitions for type '%s' in the signature and implementation are not compatible because the abstract member '%s' was present in the implementation but not in the signature - (Originally from ../FSComp.txt:146) + (Originally from ..\FSComp.txt:149) The %s definitions for type '%s' in the signature and implementation are not compatible because the abstract member '%s' was required by the signature but was not specified by the implementation - (Originally from ../FSComp.txt:145) + (Originally from ..\FSComp.txt:148) The %s definitions for type '%s' in the signature and implementation are not compatible because the abbreviations differ: %s versus %s - (Originally from ../FSComp.txt:148) + (Originally from ..\FSComp.txt:151) The %s definitions for type '%s' in the signature and implementation are not compatible because an abbreviation is being hidden by a signature. The abbreviation must be visible to other CLI languages. Consider making the abbreviation visible in the signature. - (Originally from ../FSComp.txt:149) + (Originally from ..\FSComp.txt:152) The default value does not have the same type as the argument. The DefaultParameterValue attribute and any Optional attribute will be ignored. Note: 'null' needs to be annotated with the correct type, e.g. 'DefaultParameterValue(null:obj)'. - (Originally from ../FSComp.txt:1366) + (Originally from ..\FSComp.txt:1383) The CallerMemberNameAttribute applied to parameter '%s' will have no effect. It is overridden by the CallerFilePathAttribute. - (Originally from ../FSComp.txt:1361) + (Originally from ..\FSComp.txt:1378) The argument names in the signature '%s' and implementation '%s' do not match. The argument name from the signature file will be used. This may cause problems when debugging or profiling. - (Originally from ../FSComp.txt:1462) + (Originally from ..\FSComp.txt:1481) Stopped due to error\n - (Originally from ../fsi/FSIstrings.txt:2) + (Originally from ..\fsi\FSIstrings.txt:2) Prevents references from being locked by the F# Interactive process - (Originally from ../fsi/FSIstrings.txt:54) + (Originally from ..\fsi\FSIstrings.txt:54) @@ -9245,319 +9665,319 @@ Use the given file on startup as initial input - (Originally from ../fsi/FSIstrings.txt:11) + (Originally from ..\fsi\FSIstrings.txt:11) Usage: %s <options> [script.fsx [<arguments>]] - (Originally from ../fsi/FSIstrings.txt:3) + (Originally from ..\fsi\FSIstrings.txt:3) - Unexpected ThreadAbortException (Ctrl-C) during event handling: Trying to restart... - (Originally from ../fsi/FSIstrings.txt:49) + (Originally from ..\fsi\FSIstrings.txt:49) --> Timing now on - (Originally from ../fsi/FSIstrings.txt:47) + (Originally from ..\fsi\FSIstrings.txt:47) --> Timing now off - (Originally from ../fsi/FSIstrings.txt:48) + (Originally from ..\fsi\FSIstrings.txt:48) Real: %s, CPU: %s, GC %s - (Originally from ../fsi/FSIstrings.txt:25) + (Originally from ..\fsi\FSIstrings.txt:25) gen - (Originally from ../fsi/FSIstrings.txt:26) + (Originally from ..\fsi\FSIstrings.txt:26) Treat remaining arguments as command line arguments, accessed using fsi.CommandLineArgs - (Originally from ../fsi/FSIstrings.txt:13) + (Originally from ..\fsi\FSIstrings.txt:13) Support TAB completion in console (on by default) - (Originally from ../fsi/FSIstrings.txt:18) + (Originally from ..\fsi\FSIstrings.txt:18) Suppress fsi writing to stdout - (Originally from ../fsi/FSIstrings.txt:17) + (Originally from ..\fsi\FSIstrings.txt:17) F# Interactive for F# %s - (Originally from ../fsi/FSIstrings.txt:53) + (Originally from ..\fsi\FSIstrings.txt:53) Microsoft (R) F# Interactive version %s - (Originally from ../fsi/FSIstrings.txt:52) + (Originally from ..\fsi\FSIstrings.txt:52) Operation failed. The error text has been printed in the error stream. To return the corresponding FSharpDiagnostic use the EvalInteractionNonThrowing, EvalScriptNonThrowing or EvalExpressionNonThrowing - (Originally from ../fsi/FSIstrings.txt:56) + (Originally from ..\fsi\FSIstrings.txt:56) Operation could not be completed due to earlier error - (Originally from ../fsi/FSIstrings.txt:55) + (Originally from ..\fsi\FSIstrings.txt:55) - MISCELLANEOUS - - (Originally from ../fsi/FSIstrings.txt:8) + (Originally from ..\fsi\FSIstrings.txt:8) Loading - (Originally from ../fsi/FSIstrings.txt:38) + (Originally from ..\fsi\FSIstrings.txt:38) #load the given file on startup - (Originally from ../fsi/FSIstrings.txt:12) + (Originally from ..\fsi\FSIstrings.txt:12) Warning: line too long, ignoring some characters\n - (Originally from ../fsi/FSIstrings.txt:24) + (Originally from ..\fsi\FSIstrings.txt:24) - LANGUAGE - - (Originally from ../fsi/FSIstrings.txt:7) + (Originally from ..\fsi\FSIstrings.txt:7) '%s' is not a valid assembly name - (Originally from ../fsi/FSIstrings.txt:22) + (Originally from ..\fsi\FSIstrings.txt:22) See '%s' for options - (Originally from ../fsi/FSIstrings.txt:37) + (Originally from ..\fsi\FSIstrings.txt:37) F# Interactive command line options: - (Originally from ../fsi/FSIstrings.txt:36) + (Originally from ..\fsi\FSIstrings.txt:36) F# Interactive directives: - (Originally from ../fsi/FSIstrings.txt:28) + (Originally from ..\fsi\FSIstrings.txt:28) Toggle timing on/off - (Originally from ../fsi/FSIstrings.txt:33) + (Originally from ..\fsi\FSIstrings.txt:33) Reference (dynamically load) the given DLL - (Originally from ../fsi/FSIstrings.txt:29) + (Originally from ..\fsi\FSIstrings.txt:29) Exit - (Originally from ../fsi/FSIstrings.txt:35) + (Originally from ..\fsi\FSIstrings.txt:35) Load the given file(s) as if compiled and referenced - (Originally from ../fsi/FSIstrings.txt:32) + (Originally from ..\fsi\FSIstrings.txt:32) Display help - (Originally from ../fsi/FSIstrings.txt:34) + (Originally from ..\fsi\FSIstrings.txt:34) Add the given search path for referenced DLLs - (Originally from ../fsi/FSIstrings.txt:30) + (Originally from ..\fsi\FSIstrings.txt:30) Include package source uri when searching for packages - (Originally from ../fsi/FSIstrings.txt:31) + (Originally from ..\fsi\FSIstrings.txt:31) \n- Interrupt\n - (Originally from ../fsi/FSIstrings.txt:39) + (Originally from ..\fsi\FSIstrings.txt:39) - INPUT FILES - - (Originally from ../fsi/FSIstrings.txt:4) + (Originally from ..\fsi\FSIstrings.txt:4) Display this usage message (Short form: -?) - (Originally from ../fsi/FSIstrings.txt:14) + (Originally from ..\fsi\FSIstrings.txt:14) Execute interactions on a Windows Forms event loop (on by default) - (Originally from ../fsi/FSIstrings.txt:16) + (Originally from ..\fsi\FSIstrings.txt:16) Failed to resolve assembly '%s' - (Originally from ../fsi/FSIstrings.txt:50) + (Originally from ..\fsi\FSIstrings.txt:50) \n- Exit...\n - (Originally from ../fsi/FSIstrings.txt:40) + (Originally from ..\fsi\FSIstrings.txt:40) Exit fsi after loading the files or running the .fsx script given on the command line - (Originally from ../fsi/FSIstrings.txt:15) + (Originally from ..\fsi\FSIstrings.txt:15) Exception raised when starting remoting server.\n%s - (Originally from ../fsi/FSIstrings.txt:10) + (Originally from ..\fsi\FSIstrings.txt:10) \n\nException raised during pretty printing.\nPlease report this so it can be fixed.\nTrace: %s\n - (Originally from ../fsi/FSIstrings.txt:27) + (Originally from ..\fsi\FSIstrings.txt:27) - ERRORS AND WARNINGS - - (Originally from ../fsi/FSIstrings.txt:6) + (Originally from ..\fsi\FSIstrings.txt:6) Emit debug information in quotations - (Originally from ../fsi/FSIstrings.txt:19) + (Originally from ..\fsi\FSIstrings.txt:19) Directory '%s' doesn't exist - (Originally from ../fsi/FSIstrings.txt:23) + (Originally from ..\fsi\FSIstrings.txt:23) --> Referenced '%s' (an assembly with a different timestamp has already been referenced from this location, reset fsi to load the updated assembly) - (Originally from ../fsi/FSIstrings.txt:45) + (Originally from ..\fsi\FSIstrings.txt:45) --> Referenced '%s' (file may be locked by F# Interactive process) - (Originally from ../fsi/FSIstrings.txt:44) + (Originally from ..\fsi\FSIstrings.txt:44) --> Referenced '%s' - (Originally from ../fsi/FSIstrings.txt:43) + (Originally from ..\fsi\FSIstrings.txt:43) --> Added '%s' to library include path - (Originally from ../fsi/FSIstrings.txt:46) + (Originally from ..\fsi\FSIstrings.txt:46) Failed to install ctrl-c handler - Ctrl-C handling will not be available. Error was:\n\t%s - (Originally from ../fsi/FSIstrings.txt:42) + (Originally from ..\fsi\FSIstrings.txt:42) A problem occurred starting the F# Interactive process. This may be due to a known problem with background process console support for Unicode-enabled applications on some Windows systems. Try selecting Tools->Options->F# Interactive for Visual Studio and enter '--fsi-server-no-unicode'. - (Originally from ../fsi/FSIstrings.txt:21) + (Originally from ..\fsi\FSIstrings.txt:21) - CODE GENERATION - - (Originally from ../fsi/FSIstrings.txt:5) + (Originally from ..\fsi\FSIstrings.txt:5) Binding session to '%s'... - (Originally from ../fsi/FSIstrings.txt:51) + (Originally from ..\fsi\FSIstrings.txt:51) For help type #help;; - (Originally from ../fsi/FSIstrings.txt:20) + (Originally from ..\fsi\FSIstrings.txt:20) - ADVANCED - - (Originally from ../fsi/FSIstrings.txt:9) + (Originally from ..\fsi\FSIstrings.txt:9) - Aborting main thread... - (Originally from ../fsi/FSIstrings.txt:41) + (Originally from ..\fsi\FSIstrings.txt:41) @@ -9578,13 +9998,13 @@ %s for F# %s - (Originally from ../utils/UtilsStrings.txt:2) + (Originally from ..\utils\UtilsStrings.txt:2) Microsoft (R) F# Compiler version %s - (Originally from ../utils/UtilsStrings.txt:1) + (Originally from ..\utils\UtilsStrings.txt:1) @@ -9592,379 +10012,6 @@ Call this method once to validate that all known resources are valid; throws if not - - - Interpret tables for a unicode lexer generated by <c>fslex.exe</c>. - - - - - Create the tables from raw data - - - - - The type of tables for an unicode lexer generated by <c>fslex.exe</c>. - - - - - The start position for the lexeme. - - - - - True if the refill of the buffer ever failed , or if explicitly set to True. - - - - - The end position for the lexeme. - - - - - The start position for the lexeme. - - - - - Determines if the parser can report FSharpCore library-only features. - - - - - The currently matched text as a Span, it is only valid until the lexer is advanced - - - - - True if the refill of the buffer ever failed , or if explicitly set to True. - - - - - The end position for the lexeme. - - - - - Dynamically typed, non-lexically scoped parameter table. - - - - - True if the refill of the buffer ever failed , or if explicitly set to True. - - - - - Fast helper to turn the matched characters into a string, avoiding an intermediate array. - - - - - Determine if Lexeme contains a specific character - - - - - Get single character of matched string - - - - - Create a lex buffer backed by source text. - - - - - Create a lex buffer that reads character or byte inputs by using the given function. - - - - - Create a lex buffer suitable for Unicode lexing that reads characters from the given array. - Important: does take ownership of the array. - - - - - Input buffers consumed by lexers generated by <c>fslex.exe</c>. - The type must be generic to match the code generated by FsLex and FsYacc (if you would like to - fix this, please submit a PR to the FsLexYacc repository allowing for optional emit of a non-generic type reference). - - - - - Return absolute offset of the start of the line marked by the position. - - - - - The character number in the input stream. - - - - - The line number for the position in the input stream, assuming fresh positions have been updated - using for the new line. - - - - - The line number in the input stream, assuming fresh positions have been updated - for the new line by modifying the EndPos property of the LexBuffer. - - - - - The file index for the file associated with the input stream, use <c>fileOfFileIndex</c> to decode - - - - - Given a position just beyond the end of a line, return a position at the start of the next line. - - - - - Get an arbitrary position, with the empty string as filename. - - - - - Same line, column -1. - - - - - Return the column number marked by the position, - i.e. the difference between the <c>AbsoluteOffset</c> and the <c>StartOfLineAbsoluteOffset</c> - - - - - Gives a position shifted by specified number of characters. - - - - - Given a position at the start of a token of length n, return a position just beyond the end of the token. - - - - - Apply a #line directive. - - - - - Position information stored for lexing tokens - - - - - The tag of the error terminal. - - - - - The total number of terminals. - - - - - This function is used to hold the user specified "parse_error" or "parse_error_rich" functions. - - - - - This table is logically part of the Goto table. - - - - - The sparse table offsets for the productions active for each state. - - - - - The sparse table for the productions active for each state. - - - - - The sparse goto table row offsets. - - - - - The sparse goto table. - - - - - The immediate action table. - - - - - The number of symbols for each reduction. - - - - - The sparse action table row offsets. - - - - - The sparse action table elements. - - - - - A function to compute the data carried by a token. - - - - - A function to compute the tag of a token. - - - - - The token number indicating the end of input. - - - - - The reduction table. - - - - - Interpret the parser table taking input from the given lexer, using the given lex buffer, and the given start state. - Returns an object indicating the final synthesized value for the parse. - - - - - Tables generated by fsyacc - The type of the tables contained in a file produced by the <c>fsyacc.exe</c> parser generator. - - - - - The stack of state indexes active at the parse error . - - - - - The token that would cause a shift at the parse error. - - - - - The stack of productions that would be reduced at the parse error. - - - - - The tokens that would cause a reduction at the parse error. - - - - - The state active at the parse error. - - - - - The message associated with the parse error. - - - - - The token that caused the parse error. - - - - - The context provided when a parse error occurs. - - - - - Get the start of the range of positions matched by the production. - - - - - Get the full range of positions matched by the production. - - - - - Get the end of the range of positions matched by the production. - - - - - Return the LexBuffer for this parser instance. - - - - - Raise an error in this parse context. - - - - - Get the start position for the terminal or non-terminal at a given index matched by the production. - - - - - Get the start and end position for the terminal or non-terminal at a given index matched by the production. - - - - - Get the end position for the terminal or non-terminal at a given index matched by the production. - - - - - Get the value produced by the terminal or non-terminal at the given position. - - - - - Indicates a parse error has occurred and parse recovery is in progress. - - - - - Indicates an accept action has occurred. - - - - - The default implementation of the parse_error function. - - - - - The default implementation of the parse_error_rich function. - - - - - Helpers used by generated parsers. - - Split an array of pairs into two arrays. @@ -10831,13 +10878,6 @@ Generates unique stamps - - - Cancellable computations that can cooperatively yield - - - You can take an Eventually value and run it with Eventually.forceForTimeSlice - - Represents a synchronous cancellable computation with explicit representation of a cancelled result. @@ -10908,53 +10948,6 @@ Intern tables to save space. - - - Create the resource and install it on the stack each time the Eventually is restarted - - - - - Represents a canceled computation - - - - - Bind the cancellation token associated with the computation - - - - - Map a computation over a collection - - - - - Fold a computation over a collection - - - - - Take steps in the computation. Needed for inlined combinators. - - - - - Check if cancellation or time limit has been reached. Needed for inlined combinators - - - - - Run for at most the given time slice, returning the residue computation, which may be complete. - If cancellation is requested then just return the computation at the point where cancellation - was detected. - - - - - Return a simple value as the result of an eventually computation - - Implement try/with for a cancellable computation @@ -11104,6 +11097,11 @@ pass an array byref to reverse it in place + + + Runs the computation synchronously, always starting on the current thread. + + Get an initialization hole @@ -11263,6 +11261,16 @@ Get the least significant byte of a 32-bit integer + + + Type alias for System.Collections.Immutable.ImmutableArray<'T>.Builder + + + + + Type alias for System.Collections.Immutable.ImmutableArray<'T> + + Rational arithmetic, used for exponents on units-of-measure @@ -11285,6 +11293,389 @@ Add a path mapping to the map. + + + Interpret tables for a unicode lexer generated by <c>fslex.exe</c>. + + + + + Create the tables from raw data + + + + + The type of tables for an unicode lexer generated by <c>fslex.exe</c>. + + + + + The start position for the lexeme. + + + + + True if the refill of the buffer ever failed , or if explicitly set to True. + + + + + The end position for the lexeme. + + + + + The start position for the lexeme. + + + + + Determines if the parser can report FSharpCore library-only features. + + + + + The currently matched text as a Span, it is only valid until the lexer is advanced + + + + + Get the language version being supported + + + + + True if the refill of the buffer ever failed , or if explicitly set to True. + + + + + The end position for the lexeme. + + + + + Dynamically typed, non-lexically scoped parameter table. + + + + + True if the specified language feature is supported. + + + + + Fast helper to turn the matched characters into a string, avoiding an intermediate array. + + + + + Determine if Lexeme contains a specific character + + + + + Get single character of matched string + + + + + Create a lex buffer backed by source text. + + + + + Create a lex buffer that reads character or byte inputs by using the given function. + + + + + Create a lex buffer suitable for Unicode lexing that reads characters from the given array. + Important: does take ownership of the array. + + + + + Logs a recoverable error if a language feature is unsupported, at the specified range. + + + + + Input buffers consumed by lexers generated by <c>fslex.exe</c>. + The type must be generic to match the code generated by FsLex and FsYacc (if you would like to + fix this, please submit a PR to the FsLexYacc repository allowing for optional emit of a non-generic type reference). + + + + + Return absolute offset of the start of the line marked by the position. + + + + + The character number in the input stream. + + + + + The line number for the position in the input stream, assuming fresh positions have been updated + using for the new line. + + + + + The line number in the input stream, assuming fresh positions have been updated + for the new line by modifying the EndPos property of the LexBuffer. + + + + + The file index for the file associated with the input stream, use <c>fileOfFileIndex</c> to decode + + + + + Given a position just beyond the end of a line, return a position at the start of the next line. + + + + + Get an arbitrary position, with the empty string as filename. + + + + + Same line, column -1. + + + + + Return the column number marked by the position, + i.e. the difference between the <c>AbsoluteOffset</c> and the <c>StartOfLineAbsoluteOffset</c> + + + + + Gives a position shifted by specified number of characters. + + + + + Given a position at the start of a token of length n, return a position just beyond the end of the token. + + + + + Apply a #line directive. + + + + + Position information stored for lexing tokens + + + + + The tag of the error terminal. + + + + + The total number of terminals. + + + + + This function is used to hold the user specified "parse_error" or "parse_error_rich" functions. + + + + + This table is logically part of the Goto table. + + + + + The sparse table offsets for the productions active for each state. + + + + + The sparse table for the productions active for each state. + + + + + The sparse goto table row offsets. + + + + + The sparse goto table. + + + + + The immediate action table. + + + + + The number of symbols for each reduction. + + + + + The sparse action table row offsets. + + + + + The sparse action table elements. + + + + + A function to compute the data carried by a token. + + + + + A function to compute the tag of a token. + + + + + The token number indicating the end of input. + + + + + The reduction table. + + + + + Interpret the parser table taking input from the given lexer, using the given lex buffer, and the given start state. + Returns an object indicating the final synthesized value for the parse. + + + + + Tables generated by fsyacc + The type of the tables contained in a file produced by the <c>fsyacc.exe</c> parser generator. + + + + + The stack of state indexes active at the parse error . + + + + + The token that would cause a shift at the parse error. + + + + + The stack of productions that would be reduced at the parse error. + + + + + The tokens that would cause a reduction at the parse error. + + + + + The state active at the parse error. + + + + + The message associated with the parse error. + + + + + The token that caused the parse error. + + + + + The context provided when a parse error occurs. + + + + + Get the start of the range of positions matched by the production. + + + + + Get the full range of positions matched by the production. + + + + + Get the end of the range of positions matched by the production. + + + + + Return the LexBuffer for this parser instance. + + + + + Raise an error in this parse context. + + + + + Get the start position for the terminal or non-terminal at a given index matched by the production. + + + + + Get the start and end position for the terminal or non-terminal at a given index matched by the production. + + + + + Get the end position for the terminal or non-terminal at a given index matched by the production. + + + + + Get the value produced by the terminal or non-terminal at the given position. + + + + + Indicates a parse error has occurred and parse recovery is in progress. + + + + + Indicates an accept action has occurred. + + + + + The default implementation of the parse_error function. + + + + + The default implementation of the parse_error_rich function. + + + + + Helpers used by generated parsers. + + Test to report for the name of the type provider that produced the value @@ -11477,6 +11868,11 @@ Information about the compilation environment + + + Get the text used to specify the version, several of which may map to the same version + + Get the list of valid versions @@ -11507,6 +11903,11 @@ Does the selected LanguageVersion support the specified feature + + + Has been explicitly specified as 4.6, 4.7 or 5.0 + + Get a version string associated with the given feature. @@ -11542,6 +11943,11 @@ Coordinating compiler operations - configuration, loading initial context, reporting errors etc. + + + Creates a ByteStorage that has a copy of the given Memory<byte>. + + Creates a ByteStorage that has a copy of the given ByteMemory. @@ -11565,6 +11971,7 @@ Imperative buffers and streams of byte[] + Not thread safe. @@ -11668,7 +12075,8 @@ - A shim over Directory.Exists + A shim over Directory.Exists, but returns a string, the FullName of the resulting + DirectoryInfo. @@ -11809,6 +12217,145 @@ returned int will be 0 <= x <= 255 + + + The result type of a computational modality to colelct warnings and possibly fail + + + + + This is the textual subcategory to display in error and warning messages (shows only under --vserrors): + + file1.fs(72): subcategory warning FS0072: This is a warning message + + + + + + Return true if the textual phase given is from the compile part of the build process. + This set needs to be equal to the set of subcategories that the language service can produce. + + + + + Return true if this phase is one that's known to be part of the 'compile'. This is the initial phase of the entire compilation that + the language service knows about. + + + + + Construct a phased error + + + + + Closed enumeration of build phases. + + + + + Represents the style being used to format errors + + + + + fixes given string by replacing all control chars with spaces. + NOTE: newlines are recognized and replaced with stringThatIsAProxyForANewlineInFlatErrors (ASCII 29, the 'group separator'), + which is decoded by the IDE with 'NewlineifyErrorString' back into newlines, so that multi-line errors can be displayed in QuickInfo + + + + + Stop on first error. Accumulate warnings and continue. + + + + + Stop on first error. Accumulate warnings and continue. + + + + + Reports an informational diagnostic + + + + + Reports an error and raises a ReportedError exception + + + + + Reports a warning diagnostic + + + + + Reports an error diagnostic and continues + + + + + NOTE: The change will be undone when the returned "unwind" object disposes + + + + + NOTE: The change will be undone when the returned "unwind" object disposes + + + + + Thrown when we stop processing the F# Interactive entry or #load. + + + + + Thrown when immediate, local error recovery is not possible. This indicates + we've reported an error but need to make a non-local transfer of control. + Error recovery may catch this and continue (see 'errorRecovery') + + The exception that caused the report is carried as data because in some + situations (LazyWithContext) we may need to re-report the original error + when a lazy thunk is re-evaluated. + + + + + Thrown when we want to add some range information to a .NET exception + + + + + Reraise an exception if it is one we want to report to Watson. + + + + + Instruct the exception not to reset itself when thrown again. + + + + + Literal build phase subcategory strings. + + + + + Demangles a suggestion + + + + + We report a candidate if its edit distance is <= the threshold. + The threshold is set to about a quarter of the number of characters. + + + + + Functions to format error message details + + A record of options to control structural formatting. @@ -11824,14 +12371,6 @@ The ShowIEnumerable is set the printing process will force the evaluation of IEnumerable objects to a small, finite depth, as determined by the printing parameters. This may lead to additional computation being performed during printing. - - <example> - From F# Interactive the default settings can be adjusted using, for example, - <pre> - open FSharp.Compiler.Interactive.Settings;; - setPrintWidth 120;; - </pre> - </example> @@ -11889,56 +12428,6 @@ of this data type is only for the consumption of formatting engines. - - - Gets the total length of the input in characters - - - - - Gets a character in an input based on an index of characters from the start of the file - - - - - Checks if a section of the input is equal to the given string - - - - - Gets a section of the input - - - - - Gets a line of an input by index - - - - - Gets the count of lines in the input - - - - - Gets the last character position in the input, returning line and column - - - - - Copies a section of the input to the given destination ad the given index - - - - - Checks if one input is equal to another - - - - - Represents an input to the F# compiler - - Represents a range using zero-based line counting (used by Visual Studio) @@ -12021,16 +12510,32 @@ The end position of the range + + + When de-sugaring computation expressions we convert a debug point into a plain range, and then later + recover that the range definitely indicates a debug point. + + Convert a range to string + + + Note that a range indicates a debug point + + Convert a range to be synthetic + + + Check if the range is adjacent to another range + + Represents a range within a file @@ -12061,6 +12566,11 @@ The column number for the position + + + Check if the position is adjacent to another postition + + Decode a position fro a 64-bit integer @@ -12086,6 +12596,56 @@ An enhancement to TaggedText in the TaggedText layouts generated by FSharp.Compiler.Service + + + Gets the total length of the input in characters + + + + + Gets a character in an input based on an index of characters from the start of the file + + + + + Checks if a section of the input is equal to the given string + + + + + Gets a section of the input + + + + + Gets a line of an input by index + + + + + Gets the count of lines in the input + + + + + Gets the last character position in the input, returning line and column + + + + + Copies a section of the input to the given destination ad the given index + + + + + Checks if one input is equal to another + + + + + Represents an input to the F# compiler + + Convert any value to a layout using the given formatting options. The @@ -12248,6 +12808,11 @@ other atoms to be customized according to culture. + + + Check if the last character in the layout is the given character + + Is it the empty layout? @@ -12268,16 +12833,6 @@ A layout can be squashed to for given width which forces breaks as required. - - - Creates an ISourceText object from the given string - - - - - Functions related to ISourceText objects - - Convert a line number from one-based line counting (used internally in the F# compiler and in F# error messages) to zero-based line counting (used by Visual Studio) @@ -12474,123 +13029,14 @@ Run a render on a Layout - - - The result type of a computational modality to colelct warnings and possibly fail - - - - - This is the textual subcategory to display in error and warning messages (shows only under --vserrors): - - file1.fs(72): subcategory warning FS0072: This is a warning message - - - - - - Return true if the textual phase given is from the compile part of the build process. - This set needs to be equal to the set of subcategories that the language service can produce. - - - - - Return true if this phase is one that's known to be part of the 'compile'. This is the initial phase of the entire compilation that - the language service knows about. - - - - - Construct a phased error - - - - - Closed enumeration of build phases. - - - - - Represents the style being used to format errors - - - - - fixes given string by replacing all control chars with spaces. - NOTE: newlines are recognized and replaced with stringThatIsAProxyForANewlineInFlatErrors (ASCII 29, the 'group separator'), - which is decoded by the IDE with 'NewlineifyErrorString' back into newlines, so that multi-line errors can be displayed in QuickInfo - - - - - Stop on first error. Accumulate warnings and continue. - - - - - Stop on first error. Accumulate warnings and continue. - - - - - NOTE: The change will be undone when the returned "unwind" object disposes - - - - - NOTE: The change will be undone when the returned "unwind" object disposes - - - - - Thrown when we stop processing the F# Interactive entry or #load. - - - - - Thrown when immediate, local error recovery is not possible. This indicates - we've reported an error but need to make a non-local transfer of control. - Error recovery may catch this and continue (see 'errorRecovery') - - The exception that caused the report is carried as data because in some - situations (LazyWithContext) we may need to re-report the original error - when a lazy thunk is re-evaluated. - - - - - Thrown when we want to add some range information to a .NET exception - - - - - Reraise an exception if it is one we want to report to Watson. - - - - - Instruct the exception not to reset itself when thrown again. - - - - - Literal build phase subcategory strings. - - - - - Demangles a suggestion - - - + - We report a candidate if its edit distance is <= the threshold. - The threshold is set to about a quarter of the number of characters. + Creates an ISourceText object from the given string - + - Functions to format error message details + Functions related to ISourceText objects @@ -13141,6 +13587,31 @@ IL method bodies + + + Defines a set of opened namespace, type relevant to a code location. + + Emitted to the PortablePDB format. + + + + + Represents an 'open XYZ' opening a namespace + + + + + Represents an 'open type XYZ' opening a type + + + + + Defines an opened namespace, type relevant to a code location. + + Emitted to the PortablePDB format. Note the format supports additional variations on + imported things that are not yet emitted in F#. + + Local variables @@ -13215,6 +13686,21 @@ Actual generic parameters are always types. + + + The type being modified. + + + + + The class of the custom modifier. + + + + + True if modifier is "required". + + Custom modifiers. @@ -13260,13 +13746,6 @@ Used only in return and pointer types. - - - True if modifier is "required". - The class of the custom modifier. - The type being modified. - - Which type is being referred to? @@ -13531,12 +14010,12 @@ make a reference to its constructor. - + Derived functions for making some simple constructors - + Injecting initialization code into a class. Add some code to the end of the .cctor for a type. Create a .cctor @@ -13571,7 +14050,7 @@ Make field definitions. - + Make method definitions. @@ -13824,7 +14303,6 @@ - ILModuleReader objects only need to be explicitly disposed if memory mapping is used, i.e. reduceMemoryUsage = false Open a binary reader, except first copy the entire contents of the binary into memory, close the file and ensure any subsequent reads happen from the in-memory store. PDB files may not be read with this option. @@ -13864,11 +14342,44 @@ you need. + + + MVID of the generated .NET module (used by MDB files to identify debug info) + + + + + Represents an 'open XYZ' opening a namespace + + + + + Represents an 'open type XYZ' opening a type + + + + + Defines the set of 'imports' - that is, opened namespaces, types etc. - at each code location + + Note the C# debug evaluation engine used for F# will give C# semantics to these. That in general + is very close to F# semantics, except for things like union type. + + the local index the name corresponds to + + + Check to see if a scope has a local with the same name as any of its children + + If so, do not emit 'scope' itself. Instead, + 1. Emit a copy of 'scope' in each true gap, with all locals + 2. Adjust each child scope to also contain the locals from 'scope', + adding the text " (shadowed)" to the names of those with name conflicts. + + 28 is the size of the IMAGE_DEBUG_DIRECTORY in ntimage.h @@ -13904,22 +14415,27 @@ Write Abstract IL structures at runtime using Reflection.Emit - + + + Debug info for generated code for classunions + + + Debug info for generated code for classunions. - + Generate the helpers? - + Are the representation helpers public? - + Is the representation public? @@ -14049,7 +14565,7 @@ Make the instruction sequence for a "newdata" operation - + Will not dispose of the stream reader. @@ -14094,7 +14610,7 @@ Represents collected XmlDoc lines - + "fun (UnionCase x) (UnionCase y) -> body" ==> @@ -14132,13 +14648,6 @@ in the case of 'let' definitions. - - - For 'let' definitions, we infer syntactic argument information from the r.h.s. of a definition, if it - is an immediate 'fun ... -> ...' or 'function ...' expression. This is noted in the F# language specification. - This does not apply to member definitions. - - Transform a property declared using '[static] member P = expr' to a method taking a "unit" argument. @@ -14275,9 +14784,9 @@ directive is processed. This alters the behaviour of the lexfilter. - + - Keywords paired with their descriptions. Used in completion and quick info. + Arbitrary value @@ -14998,25 +15507,15 @@ Create a CCU with the given name and contents + + + Used at the end of comppiling an assembly to get a frozen, final stable CCU + for the compilation which we no longer mutate. + + A relinkable handle to the contents of a compilation unit. Relinking is performed by mutation. - A compilation unit is, more or less, the new material created in one - invocation of the compiler. Due to static linking assemblies may hold more - than one compilation unit (i.e. when two assemblies are merged into a compilation - the resulting assembly will contain 3 CUs). Compilation units are also created for referenced - .NET assemblies. - - References to items such as type constructors are via - cross-compilation-unit thunks, which directly reference the data structures that define - these modules. Thus, when saving out values to disk we only wish - to save out the "current" part of the term graph. When reading values - back in we "fixup" the links to previously referenced modules. - - All non-local accesses to the data structures are mediated - by ccu-thunks. Ultimately, a ccu-thunk is either a (named) element of - the data structure, or it is a delayed fixup, i.e. an invalid dangling - reference that has not had an appropriate fixup applied. @@ -15114,11 +15613,15 @@ TImplFile (qualifiedNameOfFile, pragmas, implementationExpressionWithSignature, hasExplicitEntryPoint, isScript, anonRecdTypeInfo) - + + + This is the body of the module/namespace + + + This ModuleOrNamespace that represents the compilation of a module as a class. The same set of tycons etc. are bound in the ModuleOrNamespace as in the ModuleOrNamespaceExpr - This is the body of the module/namespace @@ -15141,6 +15644,11 @@ Indicates the module fragment is a 'let' definition + + + Indicates the given 'open' declarations are active + + Indicates the module fragment is made of several module fragments in succession @@ -15156,6 +15664,46 @@ The contents of a module-or-namespace-fragment definition + + + If it's `namespace Xxx.Yyy` declaration. + + + + + Scope in which open declaration is visible. + + + + + Types whose static content is opened with this declaration. + + + + + Modules or namespaces which is opened with this declaration. + + + + + Full range of the open declaration. + + + + + Syntax after 'open' as it's presented in source code. + + + + + Create a new instance of OpenDeclaration. + + + + + Represents open declaration statement. + + A type for a module-or-namespace-fragment and the actual definition of the module-or-namespace-fragment @@ -15760,6 +16308,9 @@ A binding of a variable to an expression, as in a `let` binding or similar + -- val: The value being bound + -- expr: The expression to execute to get the value + -- debugPoint: The debug point for the binding @@ -15770,6 +16321,10 @@ A target of a decision tree. Can be thought of as a little function, though is compiled as a local block. + -- boundVals - The values bound at the target, matching the valuesin the TDSuccess + -- targetExpr - The expression to evaluate if we branch to the target + -- debugPoint - The debug point for the target + -- isStateVarFlags - Indicates which, if any, of the values are repesents as state machine variables @@ -16066,7 +16621,12 @@ - Get the name off the field + Get the name of the field + + + + + Get the name of the field, with backticks added for non-identifier names @@ -16298,6 +16858,11 @@ Indicates if this is an F#-defined value in a module, or an extension member, but excluding compiler generated bindings from optimizations + + + Indicates if this is a 'this' value for a member? + + Is this a member definition or module definition? @@ -16336,6 +16901,11 @@ Indicates if this member is an F#-defined dispatch slot. + + + Indicates if this is a 'this' value for an implicit ctor? + + Indicates if this is an F#-defined 'new' constructor member @@ -16354,11 +16924,21 @@ instance member), rather than an "inner" binding that may result in a closure. + + + Indicates if this is a 'base' value? + + Get the inline declaration on the value + + + Get the inline declaration on a parameter or other non-function-declaration value, used for optimization + + Dereference the ValRef to a Val. @@ -16778,21 +17358,29 @@ The display name of the namespace, module or type with <_, _, _> added for generic types, including static parameters + + Backticks are added implicitly for entities with non-identifier names - + - The display name of the namespace, module or type with <'T, 'U, 'V> added for generic types, including static parameters + The display name of the namespace, module or type, e.g. List instead of List`1, including static parameters + + Backticks are added implicitly for entities with non-identifier names - + - The display name of the namespace, module or type, e.g. List instead of List`1, including static parameters + The display name of the namespace, module or type, e.g. List instead of List`1, not including static parameters + + No backticks are added for entities with non-identifier names The display name of the namespace, module or type, e.g. List instead of List`1, not including static parameters + + Backticks are added implicitly for entities with non-identifier names @@ -17152,7 +17740,6 @@ Get the signature for the value's XML documentation The name of the property. - If this is a property then this is 'Foo' - - If this is an implementation of an abstract slot then this is the name of the property implemented by the abstract slot @@ -17217,6 +17804,11 @@ Get the signature for the value's XML documentation Indicates if this is an F#-defined value in a module, or an extension member, but excluding compiler generated bindings from optimizations + + + Indicates if this is a 'this' value for a member? + + Is this a member definition or module definition? @@ -17270,6 +17862,11 @@ Get the signature for the value's XML documentation Indicates if this member is an F#-defined dispatch slot. + + + Indicates if this is a 'this' value for an implicit ctor? + + Indicates if this is an F#-defined 'new' constructor member @@ -17309,11 +17906,21 @@ Get the signature for the value's XML documentation Indicates if this is a compiler-generated class constructor member + + + Indicates if this is a 'base' value? + + Get the inline declaration on the value + + + Get the inline declaration on a parameter or other non-function-declaration value, used for optimization + + Indicates if the value will ignore byref scoping rules @@ -17324,11 +17931,40 @@ Get the signature for the value's XML documentation Indicates if this is ever referenced? + + + The display name of the value or method but without operator names decompiled and without backticks etc. + This is very close to LogicalName except that properties have get_ removed. + + Note: here "Core" means "without added backticks or parens" + Note: here "Mangled" means "op_Addition" + + - If this is a property --> Foo + - If this is an implementation of an abstract slot then this is the name of the method implemented by the abstract slot + - If this is an active pattern --> |A|_| + - If this is an operator --> op_Addition + - If this is an identifier needing backticks --> A-B + + + + + The display name of the value or method with operator names decompiled but without backticks etc. + + Note: here "Core" means "without added backticks or parens" + + - - If this is a property then this is 'Foo' + The full text for the value to show in error messages and to use in code. + This includes backticks, parens etc. + + - If this is a property --> Foo - If this is an implementation of an abstract slot then this is the name of the method implemented by the abstract slot - - If this is an operator then this is '(+)' + - If this is an active pattern --> (|A|_|) + - If this is an operator --> (+) + - If this is an identifier needing backticks --> ``A-B`` + - If this is a base value --> base + - If this is a value named ``base`` --> ``base`` @@ -17341,14 +17977,6 @@ Get the signature for the value's XML documentation The parent type or module, if any (None for expression bindings and parameters) - - - The name of the method. - - If this is a property then this is 'Foo' - - If this is an implementation of an abstract slot then this is the name of the method implemented by the abstract slot - - If this is an operator then this is 'op_Addition' - - Indicates if this is a 'base' or 'this' value? @@ -17950,7 +18578,7 @@ Get the signature for the value's XML documentation Represents a module or namespace definition in the typed AST - + Mutation used during compilation of FSharp.Core.dll @@ -18195,7 +18823,7 @@ Get the signature for the value's XML documentation Attributes attached to generated property - + Name of the field @@ -18245,6 +18873,16 @@ Get the signature for the value's XML documentation Attributes attached to generated field + + + Name of the field. For fields this is the same as the logical name. + + + + + Name of the field + + Get the definition location of the field @@ -18322,14 +18960,32 @@ Get the signature for the value's XML documentation Get the declaration location of the union case + + + Get the logical name of the union case + + Indicates if the union case has no fields + + + Get the core of the display name of the union case + + Backticks and parens are not added for non-identifiers. + + Note logical names op_Nil and op_ConsCons become [] and :: respectively. + + Get the display name of the union case + + Backticks and parens are added for non-identifiers. + + Note logical names op_Nil and op_ConsCons become ([]) and (::) respectively. @@ -18340,6 +18996,8 @@ Get the signature for the value's XML documentation Get the name of the case in generated IL code. + Note logical names `op_Nil` and `op_ConsCons` become `Empty` and `Cons` respectively. + This is because this is how ILX union code gen expects to see them. @@ -18454,7 +19112,7 @@ Get the signature for the value's XML documentation - Indicates whether the type declaration is a class, interface, enum, delegate or struct + Indicates whether the type declaration is an F# class, interface, enum, delegate or struct @@ -18462,32 +19120,32 @@ Get the signature for the value's XML documentation Represents member values and class fields relating to the F# object model - + - Indicates the type is an enumeration + Indicates the type is an F#-declared enumeration - + - Indicates the type is a delegate with the given Invoke signature + Indicates the type is an F#-declared delegate with the given Invoke signature - + - Indicates the type is a struct + Indicates the type is an F#-declared struct - + - Indicates the type is an interface + Indicates the type is an F#-declared interface - + - Indicates the type is a class (also used for units-of-measure) + Indicates the type is an F#-declared class (also used for units-of-measure) - + Indicates if the type definition is a value type @@ -18589,14 +19247,14 @@ Get the signature for the value's XML documentation The information for exception definitions should be folded into here. - + Indicates the representation information for a provided namespace. - + - TProvidedTypeExtensionPoint + TProvidedTypeRepr Indicates the representation information for a provided type. @@ -18616,12 +19274,12 @@ Get the signature for the value's XML documentation Indicates the type is a type from a .NET assembly without F# metadata. - + Indicates the type is a discriminated union - + Indicates the type is a record @@ -19133,21 +19791,33 @@ Get the signature for the value's XML documentation The display name of the namespace, module or type with <_, _, _> added for generic types, plus static parameters if any + For modules the Module suffix is removed if FSharpModuleWithSuffix is used. + + Backticks are added implicitly for entities with non-identifier names - + - The display name of the namespace, module or type with <'T, 'U, 'V> added for generic types, plus static parameters if any + The display name of the namespace, module or type, e.g. List instead of List`1, including static parameters if any + For modules the Module suffix is removed if FSharpModuleWithSuffix is used. + + Backticks are added implicitly for entities with non-identifier names - + - The display name of the namespace, module or type, e.g. List instead of List`1, including static parameters if any + The display name of the namespace, module or type, e.g. List instead of List`1, and no static parameters. + For modules the Module suffix is removed if FSharpModuleWithSuffix is used. + + No backticks are added for entities with non-identifier names The display name of the namespace, module or type, e.g. List instead of List`1, and no static parameters + For modules the Module suffix is removed if FSharpModuleWithSuffix is used. + + Backticks are added implicitly for entities with non-identifier names @@ -19599,11 +20269,6 @@ Get the signature for the value's XML documentation Indicates the value is inlined but the .NET IL code for the function still exists, e.g. to satisfy interfaces on objects, but that it is also always inlined - - - Indicates the value must always be inlined and no .NET IL code is generated for the value/function - - Returns true if the implementation of a value must always be inlined @@ -20020,7 +20685,7 @@ Get the signature for the value's XML documentation Add a new destination target - + Add a new destination target that is an expression result @@ -20035,11 +20700,26 @@ Get the signature for the value's XML documentation Build decision trees imperatively + + + This uses 'expr thendo ()' with a note that there should be a debug point on the 'expr' + + Shared helper for binding attributes + + + The delegate type ResumableCode, or any function returning this a delegate type + + + + + Any delegate type with ResumableCode attribute, or any function returning such a delegate type + + Add a label to use as the target for a goto @@ -20065,6 +20745,41 @@ Get the signature for the value's XML documentation Recognise a while expression + + + Recognise a '__resumeAt' expression + + + + + Recognise a sequential or binding construct in a resumable code + + + + + Recognise a '__stateMachine' expression + + + + + Recognise a 'match __resumableEntry() with ...' expression + + + + + Match 'if __useResumableCode then ... else ...' expressions + + + + + Match a .Invoke on a delegate + + + + + Match expressions that represent the creation of an instance of an F# delegate value + + Match expressions that are an application of a particular F# function value @@ -20133,6 +20848,18 @@ Get the signature for the value's XML documentation Make a call to the 'isprintf' function for string interpolation + + + This is used for tacking on code _after_ the expression. The SuppressStmt + setting is used for debug points, suppressing the debug points for the statement if possible. + + + + + This is used for tacking on code _before_ the expression. The SuppressStmt + setting is used for debug points, suppressing the debug points for the statement if possible. + + Create the expression 'None' for an option-type @@ -20321,6 +21048,11 @@ Get the signature for the value's XML documentation Determine if a type is an interface type + + + Determine if a type is a delegate type defined in F# + + Determine if a type is a delegate type @@ -20486,6 +21218,11 @@ Get the signature for the value's XML documentation Determine is a type is a System.Nullable type + + + Try to take apart an option type + + Try to take apart an option type @@ -20501,6 +21238,11 @@ Get the signature for the value's XML documentation Determine if a type is an option type + + + Determine if a type is a value option type + + Build a single-dimensional array type @@ -20536,9 +21278,16 @@ Get the signature for the value's XML documentation Combine two static-resolution requirements on a type parameter + + + Make a delegate invoke expression for an F# delegate type, doing beta reduction by introducing let-bindings + if the delegate expression is a construction of a delegate. + + Make an application expression, doing beta reduction by introducing let-bindings + if the function expression is a construction of a lambda @@ -20615,7 +21364,7 @@ Get the signature for the value's XML documentation Reduce the application via let-bindings if the function value is a lambda expression. - + Build the application of a (possibly generic, possibly curried) function value to a set of type and expression arguments @@ -21328,17 +22077,17 @@ Get the signature for the value's XML documentation Build a conditional expression that checks for non-nullness - + Build a conditional expression - + Build a conditional expression - + Add an if-then-else boolean conditional node into a decision tree @@ -22028,11 +22777,6 @@ Get the signature for the value's XML documentation Get the raw Abstract IL metadata for the event - - - Get the name of the event - - Indicates if the property is static @@ -22043,6 +22787,11 @@ Get the signature for the value's XML documentation Get the declaring IL type of the event as an ILTypeInfo + + + Get the name of the event + + Get the enclosing ("parent"/"declaring") type of the field. @@ -22353,9 +23102,27 @@ Get the signature for the value's XML documentation Get the F# metadata for the declaring union type - + - Get the name of the union case + Get the logical name of the union case. + + + + + Get the core of the display name of the union case + + Backticks and parens are not added for non-identifiers. + + Note logical names op_Nil and op_ConsCons become [] and :: respectively. + + + + + Get the display name of the union case + + Backticks and parens are added implicitly for non-identifiers. + + Note logical names op_Nil and op_ConsCons become ([]) and (::) respectively. @@ -22393,9 +23160,9 @@ Get the signature for the value's XML documentation Get the F# metadata for the uninstantiated field - + - Get the name of the field in an F#-declared record, class or struct type + Get the logical name of the field in an F#-declared record, class or struct type @@ -22413,6 +23180,17 @@ Get the signature for the value's XML documentation Get the (instantiated) type of the field in an F#-declared record, class or struct type + + + Get the name of the field, same as LogicalName + Note: no double-backticks added for non-identifiers + + + + + Get the name of the field, with double-backticks added if necessary + + Get the enclosing (declaring) type of the field in an F#-declared record, class or struct type @@ -22660,6 +23438,11 @@ Get the signature for the value's XML documentation over extension members. + + + Get the method name in core DisplayName form (no backticks or parens added) + + Get the method name in DisplayName form @@ -23407,25 +24190,14 @@ Get the signature for the value's XML documentation and the overall F# function type for the function type associated with a .NET delegate type - - - Get overrides instead of abstract slots when measuring whether a class/interface implements all its required slots. - - - - - Prefer items toward the top of the hierarchy, which we do if the items are virtual - but not when resolving base calls. - - - + - Indicates if we prefer overrides or abstract slots. + Try and find a record or class field for a type. - + - Try and find a record or class field for a type. + Perform type-directed name resolution of a particular named member in an F# type @@ -23448,6 +24220,26 @@ Get the signature for the value's XML documentation Get the super-types of a type, excluding interface types. + + + Get the flattened list of intrinsic properties in the hierarchy + + + + + Get the sets intrinsic properties in the hierarchy (not including extension properties) + + + + + Get the flattened list of intrinsic methods in the hierarchy + + + + + Get the sets of intrinsic methods in the hierarchy (not including extension methods) + + Read the IL fields of a type, including inherited ones. Cache the result for monomorphic types. @@ -23463,6 +24255,21 @@ Get the signature for the value's XML documentation Get the super-types of a type, including interface types. + + + Find the op_Implicit for a type + + + + + Exclude properties from super types which have the same name as a property in a more specific type. + + + + + Exclude methods from super types which have the same signature as a method in a more specific type. + + Get the declared IL fields of a type, not including inherited fields @@ -23474,6 +24281,22 @@ Get the signature for the value's XML documentation We create one of these for each file we typecheck. + + + Get overrides instead of abstract slots when measuring whether a class/interface implements all its required slots. + + + + + Prefer items toward the top of the hierarchy, which we do if the items are virtual + but not when resolving base calls. + + + + + Indicates if we prefer overrides or abstract slots. + + Sets of methods up the hierarchy, ignoring duplicates by name and sig. @@ -23520,7 +24343,7 @@ Get the signature for the value's XML documentation Get a set of most specific override methods. - + Try to find a particular named property on a type. Only used to ensure that local 'let' definitions and property names are distinct, a somewhat adhoc check in tc.fs. @@ -23714,7 +24537,7 @@ Get the signature for the value's XML documentation Get the current source - + Record that an open declaration occured in a given scope range @@ -23764,46 +24587,6 @@ Get the signature for the value's XML documentation Source text and an array of line end positions, used for format string parsing - - - If it's `namespace Xxx.Yyy` declaration. - - - - - Scope in which open declaration is visible. - - - - - Types whose static content is opened with this declaration. - - - - - Modules or namespaces which is opened with this declaration. - - - - - Full range of the open declaration. - - - - - Syntax after 'open' as it's presented in source code. - - - - - Create a new instance of OpenDeclaration. - - - - - Represents open declaration statement. - - Empty collection of symbol uses @@ -24060,7 +24843,7 @@ Get the signature for the value's XML documentation - Pairs an Item with a TyparInst showing how generic type variables of the item are instantiated at + Pairs an Item with a TyparInst showing how generic type variables of the item are instantiated at a particular usage point. @@ -24191,6 +24974,20 @@ Get the signature for the value's XML documentation Represents the resolution of a name to an F# value or function. + + + The text for the item to use in the declaration list. + This does not include backticks, parens etc. + + Note: here "Core" means "without added backticks or parens" + + + + + The full text for the item to show in error messages and to use in code. + This includes backticks, parens etc. + + Represents an item that results from name resolution @@ -24316,7 +25113,7 @@ Get the signature for the value's XML documentation Get all the available properties of a type (both intrinsic and extension) - + Report an open declaration @@ -24654,6 +25451,12 @@ Get the signature for the value's XML documentation The called arguments corresponding to "unnamed" arguments + + + Indicates whether a type directed conversion (e.g. int32 to int64, or op_Implicit) + has been used in F# code + + Represents the list of unnamed / named arguments at method call site @@ -24734,7 +25537,7 @@ Get the signature for the value's XML documentation or there is an unexpected mismatch of some kind. - + Build the argument list for a method call. Adjust for param array, optional arguments, byref arguments and coercions. For example, if you pass an F# reference cell to a byref then we must get the address of the @@ -24769,9 +25572,26 @@ Get the signature for the value's XML documentation Is this a 'base' call - + + + F# supports some adhoc conversions to make expression fit known overall type + + + + + F# supports some adhoc conversions to make expression fit known overall type + + + + + Performs a set of constraint solver operations returning TypeDirectedConversionUsed and + combines their results. + + + - F# supports some adhoc conversions at method callsites + Performs a set of constraint solver operations returning TypeDirectedConversionUsed and + combines their results. @@ -24794,11 +25614,46 @@ Get the signature for the value's XML documentation Compile a pattern into a decision tree and a set of targets. + + + Add a post-inference check to run at the end of inference + + + + + Get the post-inference checks to run near the end of inference, but before defaults are applied + + + + + Get the post-inference checks to run at the end of inference + + A function that denotes captured tcVal, Used in constraint solver and elsewhere to get appropriate expressions for a ValRef. + + + Each branch of the expression must convert to the type indicated + + + + + Each branch of the expression must have the type indicated + + + + + Represents a point where no subsumption/widening is possible + + + + + Represents known information prior to checking an expression or pattern, e.g. it's expected type + + Cases for overload resolution failure that exists in the implementation of the compiler. @@ -24911,6 +25766,11 @@ Get the signature for the value's XML documentation Remove the global constraints where these type variables appear in the support of the constraint + + + The entry point to resolve the overloading for an entire call + + Given a set of formal type parameters and their constraints, make new inference type variables for @@ -25226,11 +26086,6 @@ Get the signature for the value's XML documentation Set to true if this file causes the creation of generated provided types. - - - Checks to run after all inference is complete. - - Push an entry every time a recursive value binding is used, @@ -25410,14 +26265,14 @@ Get the signature for the value's XML documentation Try to check a syntactic statement and indicate if it's type is not unit without emitting a warning - + Check a linear expression (e.g. a sequence of 'let') in a tail-recursive way and convert it to a typed tree expression, using the bodyChecker to check the parts that are not linear. - + Check a syntactic expression and convert it to a typed tree expression @@ -25427,6 +26282,13 @@ Get the signature for the value's XML documentation Check a syntactic statement and convert it to a typed tree expression. + + + Process a leaf construct where the actual type of that construct is already pre-known, + and the overall type can be eagerly propagated into the actual type, including pre-calculating + any type-directed conversion. + + Check a syntactic expression and convert it to a typed tree expression. Possibly allow for subsumption flexibility @@ -25438,7 +26300,13 @@ Get the signature for the value's XML documentation Check a syntactic expression and convert it to a typed tree expression - + + + Converts 'a..b' to a call to the '(..)' operator in FSharp.Core + Converts 'a..b..c' to a call to the '(.. ..)' operator in FSharp.Core + + + Check a syntactic expression and convert it to a typed tree expression @@ -25749,6 +26617,31 @@ Get the signature for the value's XML documentation Optimization information + + + For unit testing + + + + + The size after which we don't inline + + + + + size after which we start enforcing splitting sub-expressions to new methods, to avoid hitting .NET IL limitations + + + + + size after which we start chopping methods in two, though only at match targets + + + + + Indicates the value is only mutable during its initialization and before any access or capture + + Check if an expression has an effect @@ -25832,6 +26725,32 @@ Get the signature for the value's XML documentation optimizer in opt.fs + + + The construct was not a state machine + + + + + A state machine was recognised and was not compilable and no alternative is available + + + + + A state machine was recognised and was not compilable and an alternative is available + + + + + A state machine was recognised and was compilable + + + + + Analyze a TAST expression to detect the elaborated form of a state machine expression, a special kind + of object expression that uses special code generation constructs. + + Rewrite mutable locals to reference cells across an entire implementation file @@ -25950,7 +26869,7 @@ Get the signature for the value's XML documentation Indicates if we are generating debug symbols or not - + Indicates if local optimizations are active @@ -26140,6 +27059,128 @@ Get the signature for the value's XML documentation The results of ResolveDependencies + + + Return 'true' if the computation is in-progress. + + + + + Return 'true' if the computation has already been computed. + + + + + Return 'Some' if the computation has already been computed, else None if + the computation is in-progress or has not yet been started. + + + + + Return NodeCode which, when executed, will get the value of the computation if already computed, or + await an existing in-progress computation for the node if one exists, or else will synchronously + start the computation on the current thread. + + + + + By default, 'retryCompute' is 'true'. + + + + + - retryCompute - When set to 'true', subsequent requesters will retry the computation if the first-in request cancels. Retrying computations will have better callstacks. + - computation - The computation code to run. + + + + + Evaluate the computation, allowing asynchronous waits on existing ongoing evaluations of the + same node, and strongly cache the result. + + Once the result has been cached, the computation function will also be removed, or 'null'ed out, + as to prevent any references captured by the computation from being strongly held. + + + + + Only used for testing, do not use + + + + + Used in places where we don't care about cancellation, e.g. the command line compiler + and F# Interactive + + + + + Only used for testing, do not use + + + + + Execute the cancellable computation synchronously using the ambient cancellation token of + the NodeCode. + + + + + Only used for testing, do not use + + + + + Contains helpers to specify code that can be run as part of the build graph. + + + + + A limited form 'use' for establishing the compilation globals. (Note + that a proper generic 'use' could be implemented but has not currently been necessary) + + + + + A standard builder for node code. + + + + + Represents code that can be run as part of the build graph. + + This is essentially cancellable async code where the only asynchronous waits are on nodes. + When a node is evaluated the evaluation is run synchronously on the thread of the + first requestor. + + + + + This represents the global state established as each task function runs as part of the build. + + Use to reset error and warning handlers. + + + + + Specifies code that can be run as part of the build graph. + + + + + Asynchronously await code in the build graph + + + + + Allows to specify the language for error messages + + + + + Contains helpers related to the build graph + + Get a TcConfigProvider which will return only the exact TcConfig. @@ -26270,9 +27311,11 @@ Get the signature for the value's XML documentation are fatal errors in the options for the project. - + - Evaluate raw contents of the assembly file generated by the project + Evaluate raw contents of the assembly file generated by the project. + 'None' may be returned if an in-memory view of the contents is, for some reason, + not available. In this case the on-disk view of the contents will be preferred. @@ -26357,13 +27400,13 @@ Get the signature for the value's XML documentation Try to find a provider-generated assembly - + Try to find the given assembly reference by simple name. Used in magic assembly resolution. Effectively does implicit unification of assemblies by simple assembly name. - + Try to find the given assembly reference. @@ -26497,14 +27540,19 @@ Get the signature for the value's XML documentation Part of LegacyHostedCompilerForTesting - + Indicates if we should report a warning as an error - + + + Indicates if we should report a diagnostic as a warning + + + - Indicates if we should report a warning + Indicates if we should report a diagnostic as a warning @@ -26632,7 +27680,7 @@ Get the signature for the value's XML documentation State used to de-deduplicate module names along a list of file names - + Check a single input and finish the checking @@ -26652,12 +27700,12 @@ Get the signature for the value's XML documentation Finish the checking of multiple inputs - + Check one input, returned as an Eventually computation - + Get the initial type checking state for a set of inputs @@ -26678,6 +27726,16 @@ Get the signature for the value's XML documentation Parse one input file + + + Parse one input source text + + + + + Parse one input stream + + Process the #nowarn in an input and integrate them into the TcConfig @@ -26688,7 +27746,7 @@ Get the signature for the value's XML documentation Process all the #r, #I etc. in an input. For non-scripts report warnings about ignored directives. - + A general routine to process hash directives @@ -26768,15 +27826,13 @@ Get the signature for the value's XML documentation The source files along with the ranges of the #load positions in each file. - + Analyze a script text and find the closure of its references. Used from FCS, when editing a script file. - A temporary TcConfig is created along the way, is why this routine takes so many arguments. We want to be sure to use exactly the - same arguments as the rest of the application. - + Analyze a set of script files and find the closure of their references. The resulting references are then added to the given TcConfig. Used from fsi.fs and fsc.fs, for #load and command line. @@ -27566,12 +28622,7 @@ Get the signature for the value's XML documentation - Indicates the value is inlined but compiled code for the function still exists, e.g. to satisfy interfaces on objects, but that it is also always inlined - - - - - Indicates the value is inlined and compiled code for the function does not exist + Indicates the value is always inlined in statically compiled code @@ -28492,9 +29543,14 @@ Get the signature for the value's XML documentation may not be a valid identifier path in F# code, but rather a human-readable representation of the symbol. + + + Gets the display name for the symbol where double backticks are not added for non-identifiers + + - Gets the short display name for the symbol + Gets the display name for the symbol. Double backticks are added if the name is not a valid identifier. @@ -28971,13 +30027,6 @@ Get the signature for the value's XML documentation Patterns over FSharpSymbol and derivatives. - - - This represents the global state established as each task function runs as part of the build. - - Use to reset error and warning handlers. - - Get the captured diagnostics @@ -29000,7 +30049,7 @@ Get the signature for the value's XML documentation - Gets the start column for the diagnostic + Gets the start line for the diagnostic @@ -29050,7 +30099,7 @@ Get the signature for the value's XML documentation - Gets the end column for the diagnostic + Gets the end line for the diagnostic @@ -29226,11 +30275,6 @@ Get the signature for the value's XML documentation All the keywords in the F# language - - - A utility to help determine if an identifier needs to be quoted, this doesn't quote F# keywords. - - Keywords paired with their descriptions. Used in completion and quick info. @@ -29241,12 +30285,13 @@ Get the signature for the value's XML documentation Remove backticks if present. - + Add backticks if the identifier is a keyword. + A utility to help determine if an identifier needs to be quoted, this doesn't quote F# keywords. - + Checks if adding backticks to identifier is needed. @@ -29701,6 +30746,16 @@ Get the signature for the value's XML documentation Represents a parsed hash directive + + + Gets the syntax range of this construct + + + + + Represents a parsed hash directive argument + + Gets the syntax range of this construct @@ -30434,6 +31489,11 @@ Get the signature for the value's XML documentation A long identifier pattern possibly with argument patterns + + + A conjunctive pattern 'pat1 as pat2' + + A conjunctive pattern 'pat1 & pat2' @@ -30456,7 +31516,7 @@ Get the signature for the value's XML documentation - A named pattern 'pat as ident' + A name pattern 'ident' @@ -30544,8 +31604,8 @@ Get the signature for the value's XML documentation name of the identifier is already bound. isCompilerGenerated: true if a compiler generated name - isThisVar: true if 'this' variable in member - isOptArg: true if a '?' is in front of the name + isThisVal: true if 'this' variable in member + isOptional: true if a '?' is in front of the name @@ -30553,31 +31613,6 @@ Get the signature for the value's XML documentation Represents a syntax tree for simple F# patterns - - - A one-element item indexer argument - - - - - A two-element range indexer argument - - - - - Gets the syntax range of this construct - - - - - Get the one or two expressions as a list - - - - - Represents a syntax tree for an F# indexer expression argument - - F# syntax: interpolated string, e.g. "abc{x}" or "abc{x,3}" or "abc{x:N4}" @@ -30848,12 +31883,27 @@ Get the signature for the value's XML documentation F# syntax: fun pat -> expr - + F# syntax: { expr } - + + + F# syntax: ^expr + + + + + F# syntax: expr.. + F# syntax: ..expr + F# syntax: expr..expr + F# syntax: * + A two-element range indexer argument a..b, a.., ..b. Also used to represent + a range in a list, array or sequence expression. + + + F# syntax: [ expr ], [| expr |] @@ -31048,6 +32098,12 @@ Get the signature for the value's XML documentation Represents a syntax tree for F# types + + + List of type parameter declarations with optional type constraints, + enclosed in `< ... >` (postfix) or `( ... )` (prefix), or a single prefix parameter. + + F# syntax is 'typar: delegate<'Args, unit> @@ -31203,12 +32259,19 @@ Get the signature for the value's XML documentation - Represents whether a debug point should be present for either the + Represents whether a debug point should be suppressed for either the first or second part of a sequential execution, that is whether the construct corresponds to a debug point in the original source. - + + + Represents whether a debug point should be present at the switch + logic of a decision tree. These are introduced for 'when' expressions + and the encoding of 'a && b', 'a || b' + + + Represents whether a debug point should be present for the target of a decision tree, that is whether the construct corresponds to a debug @@ -31517,6 +32580,21 @@ Get the signature for the value's XML documentation Used to track route during traversal of syntax using SyntaxTraversal.Traverse + + + Keywords paired with their descriptions. Used in completion and quick info. + + + + + Indicates a ValRef generated to facilitate tuple eliminations + + + + + Mark some variables (the ones we introduce via abstractBigTargets) as don't-eliminate + + The prefix of the names used for the fake namespace path added to all dynamic code entries in FSI.EXE @@ -31542,11 +32620,6 @@ Get the signature for the value's XML documentation Mangle the static parameters for a provided type or method - - - Determines if the specified name is a valid name for an active pattern. - - Try to chop "get_" or "set_" from a string. @@ -31573,29 +32646,124 @@ Get the signature for the value's XML documentation The characters that are allowed to be the first character of an identifier. + + + Like ConvertValNameToDisplayName but produces a tagged layout + + + + + Like ConvertNameToDisplayName but produces a tagged layout + + + + + Take a core display name for a value (e.g. op_Addition or PropertyName) and convert it to display text + Foo --> Foo + + --> ``+`` + op_Addition --> (+) + op_Multiply --> ( * ) + op_DereferencePercent --> (!%) + A-B --> ``A-B`` + |A|_| --> (|A|_|) + base --> base + or --> or + mod --> mod + + + + + Take a core display name (e.g. "List" or "Strange module name") and convert it to display text + by adding backticks if necessary. + Foo --> Foo + + --> ``+`` + A-B --> ``A-B`` + + - Decompiles a mangled operator name back into an operator. - For example, "op_DereferencePercent" becomes "!%". - This function accepts mangled names for both built-in and custom operators. + Decompiles a potentially-mangled operator name back into a display name. For example: + Foo --> Foo + + --> + + op_Addition --> + + op_DereferencePercent --> !% + A-B --> A-B + |A|_| --> |A|_| + Used on names of all kinds - Compiles an operator into a mangled operator name. - For example, "!%" becomes "op_DereferencePercent". - This function accepts both built-in and custom operators. + Compiles an operator into a mangled operator name. For example, + + --> op_Addition + !% --> op_DereferencePercent + Only used on actual operator names + + + + + Is the name a mangled operator name (approximate) + op_Addition - yes + op_Quack - yes + + + + + Removes double backticks if not necessary to make a valid identifier, e.g. + ``A`` --> A + ``A-B`` --> ``A-B`` + + + + + Adds double backticks if necessary to make a valid identifier, e.g. + op_Addition --> op_Addition + + --> ``+`` (this is not op_Addition) + |>> --> ``|>>`` (this is not an op_) + A-B --> ``A-B`` + AB --> AB + |A|_| --> |A|_| this is an active pattern name, needs parens not backticks - + - Returns `true` if given string is an operator display name, e.g. ( |>> ) + Returns `true` if given string requires double backticks to be a valid identifier, e.g. + + true, e.g. ``+`` (this is not op_Addition) + |>> true, e.g. ``|>>`` (this is not op_Addition) + A-B true, e.g. ``A-B`` + AB false, e.g. AB + |A|_| false // this is an active pattern name, needs parens not backticks - + + + Determines if the specified name is a valid name for an active pattern. + |A|_| --> true + |A|B| --> true + |A| --> true + | --> false + || --> false + op_Addition --> false + + + - Returns `true` if given string is an operator or double backticked name, e.g. ( |>> ) or ( long identifier ). - (where ( long identifier ) is the display name for ``long identifier``). + Is the name a valid F# identifier + A --> true + A' --> true + _A --> true + A0 --> true + |A|B| --> false + op_Addition --> true + + --> false + + + + + Returns `true` if given string is an operator display name, e.g. + ( |>> ) + |>> + .. @@ -31730,12 +32898,22 @@ Get the signature for the value's XML documentation - Get the name for the declaration as it's presented in source code. + Get the text for the declaration as it's to be inserted into source code. - Get the display name for the declaration. + Get the text to display in the declaration list for the declaration. + + + + + Get the completion kind of the item + + + + + Get the glyph to use @@ -31743,6 +32921,11 @@ Get the signature for the value's XML documentation Get the description + + + Get the accessibility of the item + + Represents a declaration in F# source code, with information attached ready for display by an editor. @@ -32973,96 +34156,50 @@ Get the signature for the value's XML documentation Indicates a script or source being edited or compiled. Uses reference assemblies (not implementation assemblies). - - - The timespan in milliseconds before background work begins after the operations queue is empty - - - - - Get the reactor - - - - - The timespan in milliseconds before background work begins after the operations queue is empty - - - - - For debug purposes - - - - - Block until the current implicit background build is complete. Unit test only. - - - - - Allows to specify the language for error messages - - - - - Set the background building function, which is called repeatedly - until it returns 'false'. If None then no background operation is used. - The operation is an Eventually which can be run in time slices. - - - + - Enqueue an uncancellable operation and return immediately. + A builder that will build an item key store based on the written Item and its associated range. - + - Put the operation in the queue, and return an async handle to its result. + Stores a list of item key strings and their ranges in a memory mapped file. - + - Block until all operations in the queue are complete + The timestamp of the source. - + - Cancel any work being don by the background building function. + The file path of the source. - + - Reactor is intended for long-running but interruptible operations, interleaved - with one-off asynchronous operations. - - It is used to guard the global compiler state while maintaining responsiveness on - the UI thread. - Reactor operations + Gets the internal text container. Text may be on-disk, in a stream, or a source text. - + - Enqueue an operation and return immediately. + Creates a FSharpSource from disk. Only used internally. - + - Put the operation in the queue, and return an async handle to its result. + Creates a FSharpSource from the specified file path by shadow-copying the file. - + - Represents the capability to schedule work in the compiler service operations queue for the compilation thread + Creates a FSharpSource. - + - A builder that will build an item key store based on the written Item and its associated range. - - - - - Stores a list of item key strings and their ranges in a memory mapped file. + The storage container for a F# source item that could either be on-disk or in-memory. + TODO: Make this public. @@ -33081,9 +34218,14 @@ Get the signature for the value's XML documentation overall analysis results for the project will be quick. + + + Check if one of the build's references is invalidated. + + - Raised when a type provider invalidates the build. + Raised when the build is invalidated. @@ -33116,12 +34258,12 @@ Get the signature for the value's XML documentation This is safe for use from non-compiler threads but the objects returned must in many cases be accessed only from the compiler thread. - + Create the incremental builder - + The project build. Return true if the background work is finished. @@ -33138,20 +34280,34 @@ Get the signature for the value's XML documentation Get the logical time stamp that is associated with the output of the project if it were gully built immediately - + + + Get the preceding typecheck state of a slot. Compute the entire type check of the project up + to the necessary point if the result is not available. This may be a long-running operation. + This will get full type-check info for the file, meaning no partial type-checking. + + + Get the final typecheck result. If 'generateTypedImplFiles' was set on Create then the TypedAssemblyAfterOptimization will contain implementations. This may be a long-running operation. This will get full type-check info for the project, meaning no partial type-checking. - - + Get the typecheck state after checking a file. Compute the entire type check of the project up to the necessary point if the result is not available. This may be a long-running operation. This will get full type-check info for the file, meaning no partial type-checking. + + + + + Get the typecheck state of a slot, without checking if it is up-to-date w.r.t. + the timestamps on files and referenced DLLs prior to this one. Return None if the result is not available. + This is a very quick operation. + This is safe for use from non-compiler threads but the objects returned must in many cases be accessed only from the compiler thread. @@ -33163,32 +34319,28 @@ Get the signature for the value's XML documentation This is safe for use from non-compiler threads but the objects returned must in many cases be accessed only from the compiler thread. - + Get the preceding typecheck state of a slot. Compute the entire type check of the project up to the necessary point if the result is not available. This may be a long-running operation. - - + Get the final typecheck result. If 'generateTypedImplFiles' was set on Create then the TypedAssemblyAfterOptimization will contain implementations. This may be a long-running operation. - - + Get the typecheck result after the end of the last file. The typecheck of the project is not 'completed'. This may be a long-running operation. - - + Get the typecheck state after checking a file. Compute the entire type check of the project up to the necessary point if the result is not available. This may be a long-running operation. - @@ -33210,30 +34362,34 @@ Get the signature for the value's XML documentation Manages an incremental build graph for the build of an F# project - - - Compute the "ItemKeyStore" parts of the results. - Can cause a second type-check if `enablePartialTypeChecking` is true in the checker. - Only use when it's absolutely necessary to get rich information on a file. - - - + Compute both the "TcInfo" and "TcInfoExtras" parts of the results. Can cause a second type-check if `enablePartialTypeChecking` is true in the checker. Only use when it's absolutely necessary to get rich information on a file. - + Compute the "TcInfo" part of the results. If `enablePartialTypeChecking` is false then extras will also be available. - + + + Can cause a second type-check if `enablePartialTypeChecking` is true in the checker. + Only use when it's absolutely necessary to get rich information on a file. + + Will return 'None' for enableBackgroundItemKeyStoreAndSemanticClassification=false. + + + + Compute the "ItemKeyStore" parts of the results. Can cause a second type-check if `enablePartialTypeChecking` is true in the checker. Only use when it's absolutely necessary to get rich information on a file. + + Will return 'None' for enableBackgroundItemKeyStoreAndSemanticClassification=false. @@ -33256,21 +34412,6 @@ Get the signature for the value's XML documentation Result of checking most recent file, if any - - - Accumulated 'open' declarations, last file first - - - - - Accumulated symbol uses, last file first - - - - - Accumulated resolutions, last file first - - Accumulated results of type checking. Optional data that isn't needed to type-check a file, but needed for more information for in tooling. @@ -33524,7 +34665,7 @@ Get the signature for the value's XML documentation Internal constructor - + Internal constructor @@ -33598,6 +34739,14 @@ Get the signature for the value's XML documentation Find the most precise display environment for the given line and column. + + Compute a formatted tooltip for the given symbol at position + + The symbol. + Generic arguments. + Display the symbol full name. + The position. + Resolve the names at the given location to the declaration location of the corresponding construct. @@ -33758,7 +34907,7 @@ Get the signature for the value's XML documentation Represents the use of an F# symbol from F# source code - + Creates a reference for any portable executable, including F#. The stream is owned by this reference. The stream will be automatically disposed when there are no references to FSharpReferencedProject and is GC collected. @@ -33865,25 +35014,6 @@ Get the signature for the value's XML documentation Delays the creation of an ILModuleReader - - - Get or set the pause time in milliseconds before background work is started. - - - - - A maximum number of megabytes of allocated memory. If the figure reported by System.GC.GetTotalMemory(false) goes over this limit, the FSharpChecker object will attempt to free memory and reduce cache sizes to a minimum. - - - - - Get or set a flag which controls if background work is started implicitly. - - If true, calls to CheckFileInProject implicitly start a background check of that project, replacing - any other background checks in progress. This is useful in IDE applications with spare CPU cycles as - it prepares the project analysis results for use. The default is 'true'. - - Notify the host that a project has been fully checked in the background (using file contents provided by the file system API) @@ -33891,30 +35021,6 @@ Get the signature for the value's XML documentation The event may be raised on a background thread. - - - Get or set the pause time in milliseconds before background work is started. - - - - - Raised after the maxMB memory threshold limit is reached - - - - - A maximum number of megabytes of allocated memory. If the figure reported by System.GC.GetTotalMemory(false) goes over this limit, the FSharpChecker object will attempt to free memory and reduce cache sizes to a minimum. - - - - - Get or set a flag which controls if background work is started implicitly. - - If true, calls to CheckFileInProject implicitly start a background check of that project, replacing - any other background checks in progress. This is useful in IDE applications with spare CPU cycles as - it prepares the project analysis results for use. The default is 'true'. - - Raised after a parse of a file in the background analysis. @@ -33929,13 +35035,6 @@ Get the signature for the value's XML documentation The event will be raised on a background thread. - - - Current queue length of the service, for debug purposes. - In addition, a single async operation or a step of a background build - may be in progress - such an operation is not counted in the queue length. - - Notify the host that the logical type checking context for a file has now been updated internally @@ -33953,11 +35052,6 @@ Get the signature for the value's XML documentation Report a statistic for testability - - - Block until the background compile finishes. - - Try to get type check results for a file. This looks up the results of recent type checks of the @@ -33981,11 +35075,6 @@ Get the signature for the value's XML documentation Tokenize an entire file, line by line - - - Stop the background compile. - - Parses a source code for a file. Returns an AST that can be traversed for various features. @@ -34067,13 +35156,12 @@ Get the signature for the value's XML documentation Parsing options for the project or script. An optional string used for tracing compiler operations associated with this request. - + This function is called when the configuration is known to have changed for reasons not encoded in the ProjectOptions. For example, dependent references may have been deleted or created. The options for the project or script, used to determine active --define conditionals and other options relevant to parsing. - Start a background compile of the project if a project with the same name has already been seen before. An optional string used for tracing compiler operations associated with this request. @@ -34263,9 +35351,6 @@ Get the signature for the value's XML documentation The given project options. An optional string used for tracing compiler operations associated with this request. - - Set the project to be checked in the background. Overrides any previous call to CheckProjectInBackground. - Check a source code file, returning a handle to the results of the parse including @@ -34383,14 +35468,6 @@ Get the signature for the value's XML documentation Already parsed files will be cached so subsequent compilations will be faster. - - - Parses and checks file in project, will compile and cache all the files up to this one - (if not already done before), or fetch them from cache. Returns partial project results, - up to and including the file requested. Returns parse and typecheck results containing - name resolutions and symbol uses for the file requested only, so intellisense etc. works. - - Clears parse and typecheck caches. diff --git a/lib/fcs/FSharp.Core.dll b/lib/fcs/FSharp.Core.dll index 41bc722ce4..7441cc2d1a 100644 Binary files a/lib/fcs/FSharp.Core.dll and b/lib/fcs/FSharp.Core.dll differ diff --git a/lib/fcs/FSharp.Core.xml b/lib/fcs/FSharp.Core.xml index 7129bbb4f7..42125f0bd7 100644 --- a/lib/fcs/FSharp.Core.xml +++ b/lib/fcs/FSharp.Core.xml @@ -82,6 +82,30 @@ + + All the values in the map, including the duplicates. + The sequence will be ordered by the keys of the map. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + sample.Values // evaluates to seq ["a"; "b"] + + + + + The keys in the map. + The sequence will be ordered by the keys of the map. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + sample.Keys // evaluates to seq [1; 2] + + + Lookup an element in the map. Raise KeyNotFoundException if no binding exists in the map. @@ -90,14 +114,41 @@ Thrown when the key is not found. The value mapped to the key. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + sample.[1] // evaluates to "a" + sample.[3] // throws KeyNotFoundException + + Returns true if there are no bindings in the map. + + + + let emptyMap: Map<int, string> = Map.empty + emptyMap.IsEmpty // evaluates to true + + let notEmptyMap = Map [ (1, "a"); (2, "b") ] + notEmptyMap.IsEmpty // evaluates to false + + The number of bindings in the map. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + sample.Count // evaluates to 2 + + - + Lookup an element in the map, assigning to value if the element is in the domain of the map and returning false if not. @@ -105,6 +156,21 @@ A reference to the output value. true if the value is present, false if not. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + sample.TryGetValue 1 // evaluates to (true, "a") + sample.TryGetValue 3 // evaluates to (false, null) + + let mutable x = "" + sample.TryGetValue (1, &x) // evaluates to true, x set to "a" + + let mutable y = "" + sample.TryGetValue (3, &y) // evaluates to false, y unchanged + + Lookup an element in the map, returning a Some value if the element is in the domain @@ -113,6 +179,15 @@ The input key. The mapped value, or None if the key is not in the map. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + sample.TryFind 1 // evaluates to Some "a" + sample.TryFind 3 // evaluates to None + + Removes an element from the domain of the map. No exception is raised if the element is not present. @@ -120,6 +195,15 @@ The input key. The resulting map. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + sample.Remove 1 // evaluates to map [(2, "b")] + sample.Remove 3 // equal to sample + + Tests if an element is in the domain of the map. @@ -127,6 +211,15 @@ The input key. True if the map contains the given key. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + sample.ContainsKey 1 // evaluates to true + sample.ContainsKey 3 // evaluates to false + + Returns a new map with the value stored under key changed according to f. @@ -135,6 +228,19 @@ The change function. The resulting map. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + let f x = + match x with + | Some s -> Some (s + "z") + | None -> None + + sample.Change (1, f) // evaluates to map [(1, "az"); (2, "b")] + + Returns a new map with the binding added to the given map. @@ -143,6 +249,15 @@ The value to add. The resulting map. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + sample.Add (3, "c") // evaluates to map [(1, "a"); (2, "b"); (3, "c")] + sample.Add (2, "aa") // evaluates to map [(1, "a"); (2, "aa")] + + Builds a map that contains the bindings of the given IEnumerable. @@ -150,6 +265,12 @@ The input sequence of key/value pairs. The resulting map. + + + + Map [ (1, "a"); (2, "b") ] // evaluates to map [(1, "a"); (2, "b")] + + Immutable maps based on binary trees, where keys are ordered by F# generic comparison. By default @@ -166,6 +287,8 @@ The second input set. A set containing elements of the first set that are not contained in the second set. + + Compute the union of the two sets. @@ -174,18 +297,28 @@ The second input set. The union of the two input sets. + + Returns the lowest element in the set according to the ordering being used for the set. + + Returns the highest element in the set according to the ordering being used for the set. + + A useful shortcut for Set.isEmpty. See the Set module for further operations on sets. + + The number of elements in the set + + A useful shortcut for Set.remove. Note this operation produces a new set @@ -195,6 +328,8 @@ The value to remove from the set. The result set. + + Evaluates to "true" if all elements of the second set are in the first. @@ -202,6 +337,8 @@ The set to test against. True if this set is a superset of otherSet. + + Evaluates to "true" if all elements of the first set are in the second. @@ -209,6 +346,8 @@ The set to test against. True if this set is a subset of otherSet. + + Evaluates to "true" if all elements of the second set are in the first, and at least @@ -217,6 +356,8 @@ The set to test against. True if this set is a proper superset of otherSet. + + Evaluates to "true" if all elements of the first set are in the second, and at least @@ -225,6 +366,8 @@ The set to test against. True if this set is a proper subset of otherSet. + + A useful shortcut for Set.contains. See the Set module for further operations on sets. @@ -232,6 +375,8 @@ The value to check. True if the set contains value. + + A useful shortcut for Set.add. Note this operation produces a new set @@ -241,12 +386,16 @@ The value to add to the set. The result set. + + Create a set containing elements drawn from the given sequence. The input sequence. The result set. + + Immutable sets based on binary trees, where elements are ordered by F# generic comparison. By default @@ -256,7 +405,7 @@ All members of this class are thread-safe and may be used concurrently from multiple threads. - + Fetches an element from a 2D array. You can also use the syntax array.[index1,index2]. The input array. @@ -265,17 +414,55 @@ The value of the array at the given index. Thrown when the indices are negative or exceed the bounds of the array. + + + Indexer syntax is generally preferred, e.g. + + let array = array2D [ [ 1.0; 2.0 ]; [ 3.0; 4.0 ] ] + + array[0,1] + + Evaluates to 2.0. + + + + + let array = array2D [ [ 1.0; 2.0 ]; [ 3.0; 4.0 ] ] + + Array2D.get array 0 1 + + Evaluates to 2.0. + - + Sets the value of an element in an array. You can also use the syntax array.[index1,index2] <- value. The input array. The index along the first dimension. The index along the second dimension. The value to set in the array. + Thrown when the indices are negative or exceed the bounds of the array. + + + Indexer syntax is generally preferred, e.g. + + let array = Array2D.zeroCreate 2 2 + + array[0,1] <- 4.0 + + + + + + let array = Array2D.zeroCreate 2 2 + + Array2D.set array 0 1 4.0 + + After evaluation array is a 2x2 array with contents [[0.0; 4.0]; [0.0; 0.0]] + - + Builds a new array whose elements are the same as the input array but where a non-zero-based input array generates a corresponding zero-based output array. @@ -283,8 +470,17 @@ The input array. The zero-based output array. + + + + let inputs = Array2D.createBased 1 1 2 3 1 + + inputs |> Array2D.rebase + + Evaluates to a 2x2 zero-based array with contents [[1; 1]; [1; 1]] + - + Builds a new array whose elements are the results of applying the given function to each of the elements of the array. The integer indices passed to the function indicates the element being transformed. @@ -297,8 +493,17 @@ The input array. An array whose elements have been transformed by the given mapping. + + + + let inputs = array2D [ [ 3; 4 ]; [ 13; 14 ] ] + + inputs |> Array2D.mapi (fun i j v -> i + j + v) + + Evaluates to a 2x2 array with contents [[3; 5;]; [14; 16]] + - + Builds a new array whose elements are the results of applying the given function to each of the elements of the array. @@ -309,33 +514,92 @@ The input array. An array whose elements have been transformed by the given mapping. + + + + let inputs = array2D [ [ 3; 4 ]; [ 13; 14 ] ] + + inputs |> Array2D.map (fun v -> 2 * v) + + Evaluates to a 2x2 array with contents [[6; 8;]; [26; 28]] + - + Returns the length of an array in the second dimension. The input array. The length of the array in the second dimension. + + + + let array = array2D [ [ 3; 4; 5 ]; [ 13; 14; 15 ] ] + + array |> Array2D.length2 + + Evaluates to 3. + - + Returns the length of an array in the first dimension. The input array. The length of the array in the first dimension. + + + + let array = array2D [ [ 3; 4; 5 ]; [ 13; 14; 15 ] ] + + array |> Array2D.length1 + + Evaluates to 2. + - + Applies the given function to each element of the array. The integer indices passed to the function indicates the index of element. A function to apply to each element of the array with the indices available as an argument. The input array. + + + + let inputs = array2D [ [ 3; 4 ]; [ 13; 14 ] ] + + inputs |> Array2D.iteri (fun i j v -> printfn $"value at ({i},{j}) = {v}") + + Evaluates to unit and prints + + value at (0,0) = 3 + value at (0,1) = 4 + value at (1,0) = 13 + value at (1,1) = 14 + + in the console. + - + Applies the given function to each element of the array. A function to apply to each element of the array. The input array. + + + + let inputs = array2D [ [ 3; 4 ]; [ 13; 14 ] ] + + inputs |> Array2D.iter (fun v -> printfn $"value = {v}") + + Evaluates to unit and prints + + value = 3 + value = 4 + value = 13 + value = 14 + + in the console. + Creates a based array where the entries are initially Unchecked.defaultof<'T>. @@ -347,6 +611,14 @@ The created array. Thrown when base1, base2, length1, or length2 is negative. + + + + Array2D.zeroCreateBased 1 1 2 3 + + Evaluates to a 2x3 1-based array with contents [[0; 0; 0]; [0; 0; 0]] + + Creates a based array whose elements are all initially the given value. @@ -359,6 +631,14 @@ The created array. Thrown when base1, base2, length1, or length2 is negative. + + + + Array2D.createBased 1 1 2 3 1 + + Evaluates to a 2x3 1-based array with contents [[1; 1; 1]; [1; 1; 1]] + + Creates a based array given the dimensions and a generator function to compute the elements. @@ -371,6 +651,14 @@ The created array. Thrown when base1, base2, length1, or length2 is negative. + + + + Array2D.initBased 1 1 2 3 (fun i j -> i + j) + + Evaluates to a 2x3 1-based array with contents [[2; 3; 4]; [3; 4; 5]] + + Creates an array where the entries are initially Unchecked.defaultof<'T>. @@ -380,6 +668,14 @@ The created array. Thrown when length1 or length2 is negative. + + + + Array2D.zeroCreate 2 3 + + Evaluates to a 2x3 array with contents [[0; 0; 0]; [0; 0; 0]] + + Creates an array whose elements are all initially the given value. @@ -390,6 +686,14 @@ The created array. Thrown when length1 or length2 is negative. + + + + Array2D.create 2 3 1 + + Evaluates to a 2x3 array with contents [[1; 1; 1]; [1; 1; 1]] + + Creates an array given the dimensions and a generator function to compute the elements. @@ -400,8 +704,16 @@ The generated array. Thrown when either of the lengths is negative. + + + + Array2D.init 2 3 (fun i j -> i + j) + + Evaluates to a 2x3 array with contents [[0; 1; 2]; [1; 2; 3]] + + - + Reads a range of elements from the first array and write them into the second. The source array. @@ -414,8 +726,27 @@ The number of elements to copy across the second dimension of the arrays. Thrown when any of the indices are negative or if either of the counts are larger than the dimensions of the array allow. + + + Slicing syntax is generally preferred, e.g. + + let source = array2D [ [ 3; 4 ]; [ 13; 14 ] ] + let target = array2D [ [ 2; 2; 2 ]; [ 12; 12; 12 ] ] + target[0..1,1..2] <- source + + + + + + let source = array2D [ [ 3; 4 ]; [ 13; 14 ] ] + let target = array2D [ [ 2; 2; 2 ]; [ 12; 12; 12 ] ] + + Array2D.blit source 0 0 target 0 1 2 2 + + After evaluation target contains [ [ 2; 3; 4 ]; [ 12; 13; 14 ] ]. + - + Builds a new array whose elements are the same as the input array. For non-zero-based arrays the basing on an input array will be propagated to the output @@ -424,20 +755,53 @@ The input array. A copy of the input array. + + + + open System + + let array = Array2D.zeroCreate<int> 10 10 + + array |> Array2D.copy + + Evaluates to a new copy of the 10x10 array. + - + Fetches the base-index for the second dimension of the array. The input array. The base-index of the second dimension of the array. + + Create a 10x10 1-based array: + + open System + + let array = Array.CreateInstance(typeof<int>, [| 10; 10 |], [| 1; 1 |]) :?> int[,] + + array |> Array2D.base2 + + Evaluates to 1. + - + Fetches the base-index for the first dimension of the array. The input array. The base-index of the first dimension of the array. + + Create a 10x10 1-based array: + + open System + + let array = Array.CreateInstance(typeof<int>, [| 10; 10 |], [| 1; 1 |]) :?> int[,] + + array |> Array2D.base1 + + Evaluates to 1. + Contains operations for working with 2-dimensional arrays. @@ -463,6 +827,19 @@ A function to test equality of two values. An object implementing using the given functions. + + Create a dictionary which uses the given functions for equality and hashing: + + open System.Collections.Generic + + let modIdentity = HashIdentity.FromFunctions((fun i -> i%5), (fun i1 i2 -> i1%5 = i2%5)) + let dict = new Dictionary<int,int>(HashIdentity.FromFunctions) + + dict.[2] <- 6 + dict.[7] <- 10 + + In this example, only one entry is added, as the keys 2 and 7 have the same hash and are equal according to the provided functions. + Get an implementation of equality semantics using reference equality and reference hashing. @@ -471,11 +848,42 @@ An object implementing using and . + + Create a dictionary which uses reference equality and hashing on the key, giving each key reference identity: + + open System.Collections.Generic + + let dict = new Dictionary<int[],int>(HashIdentity.Structural) + + let arr1 = [| 1;2;3 |] + let arr2 = [| 1;2;3 |] + dict.Add(arr1, 6) + dict.Add(arr2, 7) + + In this example, two entries are added to the dictionary, as the arrays have different object reference identity. + - Get an implementation of equality semantics semantics using structural equality and structural hashing. + Get an implementation of equality semantics semantics using limited structural equality and structural hashing. + + The limit on the number of hashing operations used. An object implementing . + + Create a dictionary which uses limited structural equality and structural hashing on the key, allowing trees as efficient keys: + + open System.Collections.Generic + + type Tree = Tree of int * Tree list + + let dict = new Dictionary<Tree,int>(HashIdentity.LimitedStructural 4) + + let tree1 = Tree(0, []) + let tree2 = Tree(0, [tree1; tree1]) + dict.Add(tree1, 6) + dict.Add(tree2, 7) + + Get an implementation of equality semantics using non-structural equality and non-structural hashing. @@ -484,11 +892,36 @@ An object implementing using and . + + Create a dictionary which uses non-structural equality and hashing on the key: + + open System.Collections.Generic + + let dict = new Dictionary<System.DateTime,int>(HashIdentity.NonStructural) + + dict.Add(System.DateTime.Now, 1) + + Get an implementation of equality semantics using structural equality and structural hashing. An object implementing using and . + + Create a dictionary which uses structural equality and structural hashing on the key, allowing an array as a key: + + open System.Collections.Generic + + let dict = new Dictionary<int[],int>(HashIdentity.Structural) + + let arr1 = [| 1;2;3 |] + let arr2 = [| 1;2;3 |] + + dict.[arr1] <- 6 + dict.[arr2] >- 7 + + In this example, only one entry is added to the dictionary, as the arrays identical by structural equality. + Common notions of value identity implementing the @@ -500,71 +933,231 @@ A function to compare two values. An object implementing using the supplied function. + + Create and use a comparer using the given function: + + let comparer = ComparisonIdentity.FromFunction(fun i1 i2 -> compare (i1%5) (i2%5)) + + comparer.Compare(7, 2) + + Evaluates to 0because 7 and 2 compare as equal using to the provided function. + Get an implementation of comparison semantics using non-structural comparison. An object implementing using . + + Create and use a comparer using structural comparison: + + let comparer = ComparisonIdentity.NonStructural<System.DateTime> + + comparer.Compare(System.DateTime.Now, System.DateTime.Today) + + Evaluates to 1. + Get an implementation of comparison semantics using structural comparison. An object implementing using . + + Create and use a comparer using structural comparison: + + let compareTuples = ComparisonIdentity.Structural<int * int> + + compareTuples.Compare((1, 4), (1, 5)) + + Evaluates to -1. + Common notions of value ordering implementing the interface, for constructing sorted data structures and performing sorting operations. - - Combines the three sequences into a list of triples. The sequences need not have equal lengths: - when one sequence is exhausted any remaining elements in the other - sequences are ignored. + + Return a new sequence with new items inserted before the given index. - The first input sequence. - The second input sequence. - The third input sequence. + The index where the items should be inserted. + The values to insert. + The input sequence. The result sequence. - Thrown when any of the input sequences is null. + Thrown when index is below 0 or greater than source.Length. + + + + seq { 0; 1; 2 } |> Seq.insertManyAt 1 [8; 9] + + Evaluates to a sequence yielding the same results as seq { 0; 8; 9; 1; 2 }. + - - Combines 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. + + Return a new sequence with a new item inserted before the given index. - The first input sequence. - The second input sequence. + The index where the item should be inserted. + The value to insert. + The input sequence. The result sequence. - Thrown when either of the input sequences is null. + Thrown when index is below 0 or greater than source.Length. + + + + seq { 0; 1; 2 } |> Seq.insertAt 1 9 + + Evaluates to a sequence yielding the same results as seq { 0; 9; 1; 2 }. + - - Returns a sequence that yields sliding windows containing elements drawn from the input - sequence. Each window is returned as a fresh array. + + Return a new sequence with the item at a given index set to the new value. - The number of elements in each window. + The index of the item to be replaced. + The new value. The input sequence. The result sequence. - Thrown when the input sequence is null. - Thrown when windowSize is not positive. - - - Returns a sequence 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. - The stream will be recomputed each time an IEnumerator is requested and iterated for the Seq. + Thrown when index is outside 0..source.Length - 1 - A function that takes in the current state and returns an option tuple of the next + + + seq { 0; 1; 2 } |> Seq.updateAt 1 9 + + Evaluates to a sequence yielding the same results as seq { 0; 9; 2 }. + + + + Return a new sequence with the number of items starting at a given index removed. + + The index of the item to be removed. + The number of items to remove. + The input sequence. + + The result sequence. + + Thrown when index is outside 0..source.Length - count + + + + seq { 0; 1; 2; 3 } |> Seq.removeManyAt 1 2 + + Evaluates to a sequence yielding the same results as seq { 0; 3 }. + + + + Return a new sequence with the item at a given index removed. + + The index of the item to be removed. + The input sequence. + + The result sequence. + + Thrown when index is outside 0..source.Length - 1 + + + + seq { 0; 1; 2 } |> Seq.removeAt 1 + + Evaluates to a sequence yielding the same results as seq { 0; 2 }. + + + + Combines the three sequences into a sequence of triples. The sequences need not have equal lengths: + when one sequence is exhausted any remaining elements in the other + sequences are ignored. + + The first input sequence. + The second input sequence. + The third input sequence. + + The result sequence. + + Thrown when any of the input sequences is null. + + + + let numbers = [1; 2] + let names = ["one"; "two"] + let roman = ["I"; "II"] + + Seq.zip3 numbers names roman + + Evaluates to a sequence yielding the same results as seq { (1, "one", "I"); (2, "two", "II") }. + + + + Combines the two sequences into a sequence of pairs. The two sequences need not have equal lengths: + when one sequence is exhausted any remaining elements in the other + sequence are ignored. + + The first input sequence. + The second input sequence. + + The result sequence. + + Thrown when either of the input sequences is null. + + + + let numbers = [1; 2] + let names = ["one"; "two"] + + Seq.zip numbers names + + Evaluates to a sequence yielding the same results as seq { (1, "one"); (2, "two") }. + + + + Returns a sequence yielding sliding windows containing elements drawn from the input + sequence. Each window is returned as a fresh array. + + The number of elements in each window. + The input sequence. + + The result sequence. + Thrown when the input sequence is null. + Thrown when windowSize is not positive. + + + + let inputs = [1; 2; 3; 4; 5] + + inputs |> Seq.windowed 3 + + Evaluates to a sequence of arrays yielding the results seq { [| 1; 2; 3 |]; [| 2; 3; 4 |]; [| 3; 4; 5 |] } + + + + Returns a sequence 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. + + The stream will be recomputed each time an IEnumerator is requested and iterated for the Seq. + + A function that takes in the current state and returns an option tuple of the next element of the sequence and the next state value. The initial state value. The result sequence. + + + + 1 |> Seq.unfold (fun state -> if state > 100 then None else Some (state, state * 2)) + + Evaluates to a sequence yielding the same results as seq { 1; 2; 4; 8; 16; 32; 64 } + + + + + 1I |> Seq.unfold (fun state -> Some (state, state * 2I)) + + Evaluates to an infinite sequence yielding the results seq { 1I; 2I; 4I; 8I; ... } + Returns a sequence that when enumerated returns at most N elements. @@ -575,6 +1168,33 @@ The result sequence. Thrown when the input sequence is null. + + + + let inputs = ["a"; "b"; "c"; "d"] + + inputs |> Seq.truncate 2 + + Evaluates to a sequence yielding the same results as seq { "a"; "b" } + + + + + let inputs = ["a"; "b"; "c"; "d"] + + inputs |> Seq.truncate 6 + + Evaluates to a sequence yielding the same results as seq { "a"; "b"; "c"; "d" } + + + + + let inputs = ["a"; "b"; "c"; "d"] + + inputs |> Seq.truncate 0 + + Evaluates to the empty sequence. + Returns the transpose of the given sequence of sequences. @@ -588,6 +1208,17 @@ The transposed sequence. Thrown when the input sequence is null. + + + + let inputs = + [ [ 10; 20; 30 ] + [ 11; 21; 31 ] ] + + inputs |> Seq.transpose + + Evaluates to a sequence of sequences yielding the same results as [ [10; 11]; [20; 21]; [30; 31] ]. + Applies the given function to successive elements, returning the first @@ -599,6 +1230,24 @@ The chosen element or None. Thrown when the input sequence is null. + + + + let input = [1; 2; 3] + + input |> Seq.tryPick (fun n -> if n % 2 = 0 then Some (string n) else None) + + Evaluates to Some "2". + + + + + let input = [1; 2; 3] + + input |> Seq.tryPick (fun n -> if n > 3 = 0 then Some (string n) else None) + + Evaluates to None. + Returns the index of the last element in the sequence @@ -613,6 +1262,24 @@ The found index or None. Thrown when the input sequence is null. + + Try to find the index of the first even number from the back: + + let inputs = [1; 2; 3; 4; 5] + + inputs |> Seq.tryFindIndexBack (fun elm -> elm % 2 = 0) + + Evaluates to Some 3 + + + Try to find the index of the first even number from the back: + + let inputs = [1; 3; 5; 7] + + inputs |> Seq.tryFindIndexBack (fun elm -> elm % 2 = 0) + + Evaluates to None + Tries to find the nth element in the sequence. @@ -623,9 +1290,27 @@ The nth element of the sequence or None. Thrown when the input sequence is null. + + + + let inputs = ["a"; "b"; "c"] + + inputs |> Seq.tryItem 1 + + Evaluates to Some "b". + + + + + let inputs = ["a"; "b"; "c"] + + inputs |> Seq.tryItem 4 + + Evaluates to None. + - Returns the index of the first element in the sequence + Returns the index of the first element in the sequence that satisfies the given predicate. Return None if no such element exists. A function that evaluates to a Boolean when given an item in the sequence. @@ -634,6 +1319,24 @@ The found index or None. Thrown when the input sequence is null. + + Try to find the index of the first even number: + + let inputs = [1; 2; 3; 4; 5] + + inputs |> Seq.tryFindIndex (fun elm -> elm % 2 = 0) + + Evaluates to Some 1 + + + Try to find the index of the first even number: + + let inputs = [1; 3; 5; 7] + + inputs |> Seq.tryFindIndex (fun elm -> elm % 2 = 0) + + Evaluates to None + Returns the last element for which the given function returns True. @@ -648,6 +1351,24 @@ The found element or None. Thrown when the input sequence is null. + + Try to find the first even number from the back: + + let inputs = [1; 2; 3; 4; 5] + + inputs |> Seq.tryFindBack (fun elm -> elm % 2 = 0) + + Evaluates to Some 4 + + + Try to find the first even number from the back: + + let inputs = [1; 5; 3] + + inputs |> Seq.tryFindBack (fun elm -> elm % 2 = 0) + + Evaluates to None + Returns the first element for which the given function returns True. @@ -659,6 +1380,24 @@ The found element or None. Thrown when the input sequence is null. + + Try to find the first even number: + + let inputs = [1; 2; 3] + + inputs |> Seq.tryFind (fun elm -> elm % 2 = 0) + + Evaluates to Some 2 + + + Try to find the first even number: + + let inputs = [1; 5; 3] + + inputs |> Seq.tryFind (fun elm -> elm % 2 = 0) + + Evaluates to None + Builds a list from the given collection. @@ -668,6 +1407,15 @@ The result list. Thrown when the input sequence is null. + + + + let inputs = seq { 1; 2; 5 } + + inputs |> Seq.toList + + Evaluates to [ 1; 2; 5 ]. + Builds an array from the given collection. @@ -677,9 +1425,18 @@ The result array. Thrown when the input sequence is null. + + + + let inputs = seq { 1; 2; 5 } + + inputs |> Seq.toArray + + Evaluates to [| 1; 2; 5 |]. + - Returns a sequence that, when iterated, yields elements of the underlying sequence while the + Returns a sequence that, when iterated, yields elements of the underlying sequence while the given predicate returns True, and then returns no further elements. A function that evaluates to false when no more items should be returned. @@ -688,6 +1445,15 @@ The result sequence. Thrown when the input sequence is null. + + + + let inputs = ["a"; "bb"; "ccc"; "d"] + + inputs |> Seq.takeWhile (fun x -> x.Length < 3) + + Evaluates to a sequence yielding the same results as seq { "a"; "bb" } + Returns the first N elements of the sequence. @@ -702,9 +1468,36 @@ The result sequence. Thrown when the input sequence is null. - Thrown when the input sequence is empty. + Thrown when the input sequence is empty and the count is greater than zero. Thrown when count exceeds the number of elements in the sequence. + + + + let inputs = ["a"; "b"; "c"; "d"] + + inputs |> Seq.take 2 + + Evaluates to a sequence yielding the same results as ["a"; "b"] + + + + + let inputs = ["a"; "b"; "c"; "d"] + + inputs |> Seq.take 6 + + Throws InvalidOperationException. + + + + + let inputs = ["a"; "b"; "c"; "d"] + + inputs |> Seq.take 0 + + Evaluates to a sequence yielding no results. + Returns a sequence that skips 1 element of the underlying sequence and then yields the @@ -716,6 +1509,16 @@ Thrown when the input sequence is null. Thrown when the input sequence is empty. + + + + let inputs = ["a"; "bb"; "ccc"] + + inputs |> Seq.tail + + Evaluates to a sequence yielding the same results as seq { "bb"; "ccc" } + + Returns the sum of the results generated by applying the function to each element of the sequence. @@ -726,6 +1529,15 @@ The input sequence. The computed sum. + + + + let input = [ "aa"; "bbb"; "cc" ] + + input |> Seq.sumBy (fun s -> s.Length) + + Evaluates to 7. + Returns the sum of the elements in the sequence. @@ -735,14 +1547,23 @@ The input sequence. The computed sum. + + + + let input = [ 1; 5; 3; 2 ] + + input |> Seq.sum + + Evaluates to 11. + Applies a key-generating function to each element of a sequence and yield a sequence ordered - descending by keys. The keys are compared using generic comparison as implemented by . - - This function returns a sequence that digests the whole initial sequence as soon as - that sequence is iterated. As a result this function should not be used with - large or infinite sequences. The function makes no assumption on the ordering of the original + descending by keys. The keys are compared using generic comparison as implemented by . + + This function returns a sequence that digests the whole initial sequence as soon as + that sequence is iterated. As a result this function should not be used with + large or infinite sequences. The function makes no assumption on the ordering of the original sequence. This is a stable sort, that is the original order of equal elements is preserved. @@ -753,13 +1574,22 @@ The result sequence. Thrown when the input sequence is null. + + + + let input = ["a"; "bbb"; "cccc"; "dd"] + + input |> Seq.sortByDescending (fun s -> s.Length) + + Evaluates to a sequence yielding the same results as seq { "cccc"; "bbb"; "dd"; "a" }. + Yields a sequence ordered descending by keys. - - This function returns a sequence that digests the whole initial sequence as soon as - that sequence is iterated. As a result this function should not be used with - large or infinite sequences. The function makes no assumption on the ordering of the original + + This function returns a sequence that digests the whole initial sequence as soon as + that sequence is iterated. As a result this function should not be used with + large or infinite sequences. The function makes no assumption on the ordering of the original sequence. This is a stable sort, that is the original order of equal elements is preserved. @@ -769,16 +1599,25 @@ The result sequence. Thrown when the input sequence is null. + + + + let input = seq { 8; 4; 3; 1; 6; 1 } + + input |> Seq.sortDescending + + Evaluates to a sequence yielding the same results as seq { 8; 6; 4; 3; 1; 1 }. + Applies a key-generating function to each element of a sequence and yield a sequence ordered - by keys. The keys are compared using generic comparison as implemented by . - - This function returns a sequence that digests the whole initial sequence as soon as - that sequence is iterated. As a result this function should not be used with - large or infinite sequences. + by keys. The keys are compared using generic comparison as implemented by . + + This function returns a sequence that digests the whole initial sequence as soon as + that sequence is iterated. As a result this function should not be used with + large or infinite sequences. - The function makes no assumption on the ordering of the original + The function makes no assumption on the ordering of the original sequence and uses a stable sort, that is the original order of equal elements is preserved. A function to transform items of the input sequence into comparable keys. @@ -787,6 +1626,15 @@ The result sequence. Thrown when the input sequence is null. + + + + let input = [ "a"; "bbb"; "cccc"; "dd" ] + + input |> Seq.sortBy (fun s -> s.Length) + + Evaluates to a sequence yielding the same results as seq { "a"; "dd"; "bbb"; "cccc" }. + Yields a sequence ordered using the given comparison function. @@ -795,22 +1643,36 @@ that sequence is iterated. As a result this function should not be used with large or infinite sequences. - The function makes no assumption on the ordering of the original + The function makes no assumption on the ordering of the original sequence and uses a stable sort, that is the original order of equal elements is preserved. The function to compare the collection elements. The input sequence. The result sequence. + + Sort a sequence of pairs using a comparison function that compares string lengths then index numbers: + + let compareEntries (n1: int, s1: string) (n2: int, s2: string) = + let c = compare s1.Length s2.Length + if c <> 0 then c else + compare n1 n2 + + let input = [ (0,"aa"); (1,"bbb"); (2,"cc"); (3,"dd") ] + + input |> Seq.sortWith compareEntries + + Evaluates to a sequence yielding the same results as seq { (0, "aa"); (2, "cc"); (3, "dd"); (1, "bbb") }. + Yields a sequence ordered by keys. - - This function returns a sequence that digests the whole initial sequence as soon as - that sequence is iterated. As a result this function should not be used with + + This function returns a sequence that digests the whole initial sequence as soon as + that sequence is iterated. As a result this function should not be used with large or infinite sequences. - The function makes no assumption on the ordering of the original + The function makes no assumption on the ordering of the original sequence and uses a stable sort, that is the original order of equal elements is preserved. The input sequence. @@ -818,9 +1680,18 @@ The result sequence. Thrown when the input sequence is null. + + + + let input = seq { 8; 4; 3; 1; 6; 1 } + + Seq.sort input + + Evaluates to a sequence yielding the same results as seq { 1; 1 3; 4; 6; 8 }. + - Returns a sequence that, when iterated, skips elements of the underlying sequence while the + Returns a sequence that, when iterated, skips elements of the underlying sequence while the given predicate returns True, and then yields the remaining elements of the sequence. A function that evaluates an element of the sequence to a boolean value. @@ -829,6 +1700,15 @@ The result sequence. Thrown when the input sequence is null. + + + + let inputs = seq { "a"; "bbb"; "cc"; "d" } + + inputs |> Seq.skipWhile (fun x -> x.Length < 3) + + Evaluates a sequence yielding the same results as seq { "bbb"; "cc"; "d" } + Returns a sequence that skips N elements of the underlying sequence and then yields the @@ -842,13 +1722,47 @@ Thrown when the input sequence is null. Thrown when count exceeds the number of elements in the sequence. + + + + let inputs = ["a"; "b"; "c"; "d"] + + inputs |> Seq.skip 2 + + Evaluates a sequence yielding the same results as seq { "c"; "d" } + + + + + let inputs = ["a"; "b"; "c"; "d"] + + inputs |> Seq.skip 5 + + Throws ArgumentException. + + + + + let inputs = ["a"; "b"; "c"; "d"] + + inputs |> Seq.skip -1 + + Evaluates a sequence yielding the same results as seq { "a"; "b"; "c"; "d" }. + - Returns a sequence that yields one item only. + Returns a sequence yielding one item only. The input item. The result sequence of one item. + + + + Seq.singleton 7 + + Evaluates to a sequence yielding the same results as seq { 7 }. + Like foldBack, but returns the sequence of intermediary and final results. @@ -864,6 +1778,24 @@ The resulting sequence of computed states. Thrown when the input sequence is null. + + Apply a list charges from back to front, and collect the running balances as each is applied: + + type Charge = + | In of int + | Out of int + + let inputs = [ In 1; Out 2; In 3 ] + + (inputs, 0) ||> Seq.scanBack (fun charge acc -> + match charge with + | In i -> acc + i + | Out o -> acc - o) + + Evaluates to a sequence yielding the same results as seq { 2; 1; 3; 0 } by processing each input from back to front. Note 0 is the intial + state, 3 the next state, 1 the next state, and 2 the final state, and the states + are produced from back to front. + Like fold, but computes on-demand and returns the sequence of intermediary and final results. @@ -875,6 +1807,23 @@ The resulting sequence of computed states. Thrown when the input sequence is null. + + Apply a list charges and collect the running balances as each is applied: + + type Charge = + | In of int + | Out of int + + let inputs = seq { In 1; Out 2; In 3 } + + (0, inputs) ||> Seq.scan (fun acc charge -> + match charge with + | In i -> acc + i + | Out o -> acc - o) + + Evaluates to a sequence yielding the same results as seq { 0; 1; -1; 2 }. Note 0 is the intial + state, 1 the next state, -1 the next state, and 2 the final state. + Returns a new sequence with the elements in reverse order. @@ -886,10 +1835,19 @@ Thrown when the input sequence is null. This function consumes the whole input sequence before yielding the first element of the reversed sequence. + + + + let input = seq { 0; 1; 2 } + + input |> Seq.rev + + Evaluates to a sequence yielding the same results as seq { 2; 1; 0 }. + Applies a function to each element of the sequence, starting from the end, threading an accumulator argument - through the computation. If the input function is f and the elements are i0...iN + through the computation. If the input function is f and the elements are i0...iN then computes f i0 (...(f iN-1 iN)). A function that takes in the next-to-last element of the sequence and the @@ -902,6 +1860,15 @@ Thrown when the input sequence is empty. This function consumes the whole input sequence before returning the result. + + + + let inputs = [1; 3; 4; 2] + + inputs |> Seq.reduceBack (fun a b -> a + b * 10) + + Evaluates to 2431, by computing 1 + (3 + (4 + 2 * 10) * 10) * 10 + Creates a sequence by replicating the given initial value. @@ -910,11 +1877,18 @@ The value to replicate The generated sequence. + + + + Seq.replicate 3 "a" + + Evaluates to a sequence yielding the same results as seq { "a"; "a"; "a" }. + Applies 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. + Then feed this result into the function along with the third element and so on. Return the final result. A function that takes in the current accumulated result and the next @@ -925,10 +1899,19 @@ Thrown when the input sequence is null. Thrown when the input sequence is empty. + + + + let inputs = [1; 3; 4; 2] + + inputs |> Seq.reduce (fun a b -> a * 10 + b) + + Evaluates to 1342, by computing ((1 * 10 + 3) * 10 + 4) * 10 + 2 + - Builds a new sequence object that delegates to the given sequence object. This ensures - the original sequence cannot be rediscovered and mutated by a type cast. For example, + Builds a new sequence object that delegates to the given sequence object. This ensures + the original sequence cannot be rediscovered and mutated by a type cast. For example, if given an array the returned sequence will return the elements of the array, but you cannot cast the returned sequence object to an array. @@ -937,6 +1920,26 @@ The result sequence. Thrown when the input sequence is null. + + + + let input = [| 1; 2; 3 |] + + input |> Seq.readonly + + Evaluates to a sequence yielding the same results as seq { 1; 2; 3 }. + + + + + let input = [| 1; 2; 3 |] + + let readonlyView = input |> Seq.readonly + + (readonlyView :?> int[]).[1] <- 4 + + Throws an InvalidCastException. + Applies the given function to successive elements, returning the first @@ -950,6 +1953,25 @@ Thrown when the input sequence is null. Thrown when every item of the sequence evaluates to None when the given function is applied. + + + + let input = [1; 2; 3] + + input |> Seq.pick (fun n -> if n % 2 = 0 then Some (string n) else None) + + Evaluates to "2". + + + + + let input = [1; 2; 3] + + input |> Seq.pick (fun n -> if n > 3 = 0 then Some (string n) else None) + + Throws KeyNotFoundException. + + Returns a sequence with all elements permuted according to the @@ -964,6 +1986,15 @@ Thrown when the input sequence is null. Thrown when indexMap does not produce a valid permutation. + + + + let inputs = [1; 2; 3; 4] + + inputs |> Seq.permute (fun x -> (x + 1) % 4) + + Evaluates to a sequence yielding the same results as seq { 4; 1; 2; 3 }. + Returns a sequence of each element in the input sequence and its predecessor, with the @@ -974,6 +2005,15 @@ The result sequence. Thrown when the input sequence is null. + + + + let inputs = seq { 1; 2; 3; 4 } + + inputs |> Seq.pairwise + + Evaluates to a sequence yielding the same results as seq { (1, 2); (2, 3); (3, 4) }. + Views the given list as a sequence. @@ -981,6 +2021,15 @@ The input list. The result sequence. + + + + let inputs = [ 1; 2; 5 ] + + inputs |> Seq.ofList + + Evaluates to a sequence yielding the same results as seq { 1; 2; 5 }. + Views the given array as a sequence. @@ -990,6 +2039,15 @@ The result sequence. Thrown when the input sequence is null. + + + + let inputs = [| 1; 2; 5 |] + + inputs |> Seq.ofArray + + Evaluates to a sequence yielding the same results as seq { 1; 2; 5 }. + Computes the nth element in the collection. @@ -1012,6 +2070,24 @@ Thrown when the input sequence is null. Thrown when the input sequence is empty. + + + + let inputs = [ "aaa"; "b"; "cccc" ] + + inputs |> Seq.minBy (fun s -> s.Length) + + Evaluates to "b" + + + + + let inputs = [] + + inputs |> Seq.minBy (fun (s: string) -> s.Length) + + Throws System.ArgumentException. + Returns the lowest of all elements of the sequence, compared via Operators.min. @@ -1022,6 +2098,24 @@ Thrown when the input sequence is null. Thrown when the input sequence is empty. + + + + let inputs = [10; 12; 11] + + inputs |> Seq.min + + Evaluates to 10 + + + + + let inputs = [] + + inputs |> Seq.min + + Throws System.ArgumentException. + Returns the greatest of all elements of the sequence, compared via Operators.max on the function result. @@ -1033,6 +2127,24 @@ Thrown when the input sequence is null. Thrown when the input sequence is empty. + + + + let inputs = ["aaa"; "b"; "cccc"] + + inputs |> Seq.maxBy (fun s -> s.Length) + + Evaluates to "cccc" + + + + + let inputs = [ ] + + inputs |> Seq.maxBy (fun s -> s.Length) + + Throws System.ArgumentException. + Returns the greatest of all elements of the sequence, compared via Operators.max @@ -1043,10 +2155,28 @@ Thrown when the input sequence is empty. The largest element of the sequence. + + + + let inputs = [ 10; 12; 11 ] + + inputs |> Seq.max + + Evaluates to 12 + + + + + let inputs = [ ] + + inputs |> Seq.max + + Throws System.ArgumentException. + Builds a new collection whose elements are the results of applying the given function - to the corresponding pairs of elements from the two sequences. If one input sequence is shorter than + to the corresponding pairs of elements from the two sequences. If one input sequence is shorter than the other then the remaining elements of the longer sequence are ignored. The integer index passed to the function indicates the index (from 0) of element being transformed. @@ -1057,6 +2187,16 @@ The result sequence. Thrown when either of the input sequences is null. + + + + let inputs1 = ["a"; "bad"; "good"] + let inputs2 = [0; 2; 1] + + (inputs1, inputs2) ||> Seq.mapi2 (fun i x y -> i, x[y]) + + Evaluates to a sequence yielding the same results as seq { (0, 'a'); (1, 'd'); (2, 'o') } + Builds a new collection whose elements are the results of applying the given function @@ -1069,6 +2209,15 @@ The result sequence. Thrown when the input sequence is null. + + + + let inputs = [ 10; 10; 10 ] + + inputs |> Seq.mapi (fun i x -> i + x) + + Evaluates to a sequence yielding the same results as seq { 10; 11; 12 } + Builds a new collection whose elements are the results of applying the given function @@ -1083,6 +2232,18 @@ The result sequence. Thrown when any of the input sequences is null. + + + + let inputs1 = [ "a"; "t"; "ti" ] + let inputs2 = [ "l"; "h"; "m" ] + let inputs3 = [ "l"; "e"; "e" ] + + (inputs1, inputs2, inputs3) |||> Seq.map3 (fun x y z -> x + y + z) + + Evaluates to a sequence yielding the same results as seq { "all"; "the"; "time" } + + Combines map and foldBack. Builds a new collection whose elements are the results of applying the given function @@ -1098,6 +2259,23 @@ Thrown when the input collection is null. The collection of transformed elements, and the final accumulated value. + + Accumulate the charges from back to front, and double them as well + + type Charge = + | In of int + | Out of int + + let inputs = seq { In 1; Out 2; In 3 } + + let newCharges, balance = + (inputs, 0) ||> Seq.mapFoldBack (fun charge acc -> + match charge with + | In i -> In (i*2), acc + i + | Out o -> Out (o*2), acc - o) + + Evaluates newCharges to seq { In 2; Out 4; In 6 } and balance to 2. + Combines map and fold. Builds a new collection whose elements are the results of applying the given function @@ -1113,10 +2291,27 @@ Thrown when the input collection is null. The collection of transformed elements, and the final accumulated value. + + + Accumulate the charges, and double them as well + type Charge = + | In of int + | Out of int + + let inputs = seq { In 1; Out 2; In 3 } + + let newCharges, balance = + (0, inputs) ||> Seq.mapFold (fun acc charge -> + match charge with + | In i -> In (i*2), acc + i + | Out o -> Out (o*2), acc - o) + + Evaluates newCharges to seq { In 2; Out 4; In 6 } and balance to 2. + Builds a new collection whose elements are the results of applying the given function - to the corresponding pairs of elements from the two sequences. If one input sequence is shorter than + to the corresponding pairs of elements from the two sequences. If one input sequence is shorter than the other then the remaining elements of the longer sequence are ignored. A function to transform pairs of items from the input sequences. @@ -1126,6 +2321,16 @@ The result sequence. Thrown when either of the input sequences is null. + + + + let inputs1 = ["a"; "bad"; "good"] + let inputs2 = [0; 2; 1] + + (inputs1, inputs2) ||> Seq.map2 (fun x y -> x.[y]) + + Evaluates to a sequence yielding the same results as seq { 'a'; 'd'; 'o' } + Builds a new collection whose elements are the results of applying the given function @@ -1133,7 +2338,7 @@ as elements are demanded using the MoveNext method on enumerators retrieved from the object. - The returned sequence may be passed between threads safely. However, + The returned sequence may be passed between threads safely. However, individual IEnumerator values generated from the returned sequence should not be accessed concurrently. A function to transform items from the input sequence. @@ -1142,6 +2347,15 @@ The result sequence. Thrown when the input sequence is null. + + + + let inputs = ["a"; "bbb"; "cc"] + + inputs |> Seq.map (fun x -> x.Length) + + Evaluates to a sequence yielding the same results as seq { 1; 3; 2 } + Returns the length of the sequence @@ -1151,9 +2365,18 @@ The length of the sequence. Thrown when the input sequence is null. + + + + let inputs = ["a"; "b"; "c"] + + inputs |> Seq.length + + Evaluates to 3 + - Applies the given function to two collections simultaneously. If one sequence is shorter than + Applies the given function to two collections simultaneously. If one sequence is shorter than the other then the remaining elements of the longer sequence are ignored. The integer passed to the function indicates the index of element. @@ -1162,9 +2385,25 @@ The second input sequence. Thrown when either of the input sequences is null. + + + + let inputs1 = ["a"; "b"; "c"] + let inputs2 = ["banana"; "pear"; "apple"] + + (inputs1, inputs2) ||> Seq.iteri2 (fun i s1 s2 -> printfn "Index {i}: {s1} - {s2}") + + Evaluates to unit and prints + + Index 0: a - banana + Index 1: b - pear + Index 2: c - apple + + in the console. + - Applies the given function to two collections simultaneously. If one sequence is shorter than + Applies the given function to two collections simultaneously. If one sequence is shorter than the other then the remaining elements of the longer sequence are ignored. A function to apply to each pair of elements from the input sequences. @@ -1172,6 +2411,22 @@ The second input sequence. Thrown when either of the input sequences is null. + + + + let inputs1 = ["a"; "b"; "c"] + let inputs2 = [1; 2; 3] + + (inputs1, inputs2) ||> Seq.iter2 (printfn "%s: %i") + + Evaluates to unit and prints + + a: 1 + b: 2 + c: 3 + + in the console. + Applies the given function to each element of the collection. The integer passed to the @@ -1181,6 +2436,22 @@ The input sequence. Thrown when the input sequence is null. + + + + let inputs = ["a"; "b"; "c"] + + inputs |> Seq.iteri (fun i v -> printfn "{i}: {v}") + + + Evaluates to unit and prints + + 0: a + 1: b + 2: c + + in the console. + Applies the given function to each element of the collection. @@ -1189,6 +2460,19 @@ The input sequence. Thrown when the input sequence is null. + + + + ["a"; "b"; "c"] |> Seq.iter (printfn "%s") + + Evaluates to unit and prints + + a + b + c + + in the console. + Computes the element at the specified index in the collection. @@ -1200,6 +2484,24 @@ Thrown when the input sequence is null. Thrown when the index is negative or the input sequence does not contain enough elements. + + + + let inputs = ["a"; "b"; "c"] + + inputs |> Seq.item 1 + + Evaluates to "b" + + + + + let inputs = ["a"; "b"; "c"] + + inputs |> Seq.item 4 + + Throws ArgumentException + Generates a new sequence which, when iterated, will return successive @@ -1208,13 +2510,20 @@ regenerate the elements. The function is passed the index of the item being generated. - The returned sequence may be passed between threads safely. However, + The returned sequence may be passed between threads safely. However, individual IEnumerator values generated from the returned sequence should not be accessed concurrently. Iteration can continue up to Int32.MaxValue. A function that generates an item in the sequence from a given index. The result sequence. + + + + (+) 5 |> Seq.initInfinite + + Evaluates to a sequence yielding the same results as seq { 5; 6; 7; 8; ... } + Generates a new sequence which, when iterated, will return successive @@ -1222,7 +2531,7 @@ initialization. The function is passed the index of the item being generated. - The returned sequence may be passed between threads safely. However, + The returned sequence may be passed between threads safely. However, individual IEnumerator values generated from the returned sequence should not be accessed concurrently. The maximum number of items to generate for the sequence. @@ -1231,6 +2540,20 @@ The result sequence. Thrown when count is negative. + + + + Seq.init 4 (fun v -> v + 5) + + Evaluates to a sequence yielding the same results as seq { 5; 6; 7; 8 } + + + + + Seq.init -5 (fun v -> v + 5) + + Throws ArgumentException + Builds a new collection whose elements are the corresponding elements of the input collection @@ -1239,7 +2562,15 @@ The input sequence. The result sequence. + Thrown when the input sequence is null. + + + + ["a"; "b"; "c"] |> Seq.indexed + + Evaluates to a sequence yielding the same results as seq { (0, "a"); (1, "b"); (2, "c") } + Returns true if the sequence contains no elements, false otherwise. @@ -1249,6 +2580,20 @@ True if the sequence is empty; false otherwise. Thrown when the input sequence is null. + + + + [] |> Seq.isEmpty + + Evaluates to true + + + + + ["pear"; "banana"] |> Seq.isEmpty + + Evaluates to false + Returns the only element of the sequence or None if sequence is empty or contains more than one element. @@ -1258,6 +2603,31 @@ The only element of the sequence or None. Thrown when the input sequence is null. + + + + let inputs = ["banana"] + + inputs |> Seq.tryExactlyOne + + Evaluates to Some banana + + + + + let inputs = ["pear"; "banana"] + + inputs |> Seq.tryExactlyOne + + Evaluates to None + + + + + [] |> Seq.tryExactlyOne + + Evaluates to None + Returns the only element of the sequence. @@ -1268,6 +2638,31 @@ Thrown when the input sequence is null. Thrown when the input does not have precisely one element. + + + + let inputs = ["banana"] + + inputs |> Seq.exactlyOne + + Evaluates to banana + + + + + let inputs = ["pear"; "banana"] + + inputs |> Seq.exactlyOne + + Throws ArgumentException + + + + + [] |> Seq.exactlyOne + + Throws ArgumentException + Returns the last element of the sequence. @@ -1278,6 +2673,20 @@ The last element of the sequence or None. Thrown when the input sequence is null. + + + + ["pear"; "banana"] |> Seq.tryLast + + Evaluates to Some "banana" + + + + + [] |> Seq.tryLast + + Evaluates to None + Returns the last element of the sequence. @@ -1288,6 +2697,20 @@ Thrown when the input sequence is null. Thrown when the input does not have any elements. + + + + ["pear"; "banana"] |> Seq.last + + Evaluates to banana + + + + + [] |> Seq.last + + Throws ArgumentException + Returns the first element of the sequence, or None if the sequence is empty. @@ -1297,6 +2720,20 @@ The first element of the sequence or None. Thrown when the input sequence is null. + + + + ["banana"; "pear"] |> Seq.tryHead + + Evaluates to Some "banana" + + + + + [] |> Seq.tryHead + + Evaluates to None + Returns the first element of the sequence. @@ -1307,25 +2744,50 @@ Thrown when the input sequence is null. Thrown when the input does not have any elements. + + + + let inputs = ["banana"; "pear"] + + inputs |> Seq.head + + Evaluates to banana + + + + + [] |> Seq.head + + Throws ArgumentException + - Applies a key-generating function to each element of a sequence and yields a sequence of - unique keys. Each unique key contains a sequence of all elements that match + Applies a key-generating function to each element of a sequence and yields a sequence of + unique keys. Each unique key contains a sequence of all elements that match to this key. - - This function returns a sequence that digests the whole initial sequence as soon as - that sequence is iterated. As a result this function should not be used with - large or infinite sequences. The function makes no assumption on the ordering of the original + + This function returns a sequence that digests the whole initial sequence as soon as + that sequence is iterated. As a result this function should not be used with + large or infinite sequences. The function makes no assumption on the ordering of the original sequence. A function that transforms an element of the sequence into a comparable key. The input sequence. The result sequence. + + + + let inputs = [1; 2; 3; 4; 5] + + inputs |> Seq.groupBy (fun n -> n % 2) + + Evaluates to a sequence yielding the same results as seq { (1, seq { 1; 3; 5 }); (0, seq { 2; 4 }) } + Tests the all pairs of elements drawn from the two sequences satisfy the - given predicate. If one sequence is shorter than + given predicate. If one sequence is shorter than the other then the remaining elements of the longer sequence are ignored. A function to test pairs of elements from the input sequences. @@ -1335,12 +2797,32 @@ True if all pairs satisfy the predicate; false otherwise. Thrown when either of the input sequences is null. + + + + let inputs1 = [1; 2; 3; 4; 5; 6] + let inputs2 = [1; 2; 3; 4; 5] + + (inputs1, inputs2) ||> Seq.forall2 (=) + + Evaluates to true. + + + + + let items1 = [2017; 1; 1] + let items2 = [2019; 19; 8] + + (items1, items2) ||> Seq.forall2 (=) + + Evaluates to false. + Tests if all elements of the sequence satisfy the given predicate. - The predicate is applied to the elements of the input sequence. If any application - returns false then the overall result is false and no further elements are tested. + The predicate is applied to the elements of the input sequence. If any application + returns false then the overall result is false and no further elements are tested. Otherwise, true is returned. A function to test an element of the input sequence. @@ -1349,6 +2831,16 @@ True if every element of the sequence satisfies the predicate; false otherwise. Thrown when the input sequence is null. + + + + let isEven a = a % 2 = 0 + + [2; 42] |> Seq.forall isEven // evaluates to true + + [1; 2] |> Seq.forall isEven // evaluates to false + + Applies a function to corresponding elements of two collections, starting from the end of the shorter collection, @@ -1364,6 +2856,42 @@ The final state value. Thrown when the either of the input sequences is null. + + + This function consumes the whole of both inputs sequences before returning the result. As a + result this function should not be used with large or infinite sequences. + + + + + type Count = + { Positive: int + Negative: int + Text: string } + + let inputs1 = [-1; -2; -3] + let inputs2 = [3; 2; 1; 0] + let initialState = {Positive = 0; Negative = 0; Text = ""} + + (inputs1, inputs2, initialState) |||> Seq.foldBack2 (fun a b acc -> + let text = acc.Text + "(" + string a + "," + string b + ") " + if a + b >= 0 then + { acc with + Positive = acc.Positive + 1 + Text = text } + else + { acc with + Negative = acc.Negative + 1 + Text = text } + ) + + Evaluates to + + { Positive = 2 + Negative = 1 + Text = " (-3,1) (-2,2) (-1,3)" } + + Applies a function to each element of the collection, starting from the end, threading an accumulator argument @@ -1375,9 +2903,39 @@ The initial state. The state object after the folding function is applied to each element of the sequence. + Thrown when the input sequence is null. This function consumes the whole input sequence before returning the result. + + + + type Count = + { Positive: int + Negative: int + Text: string } + + let sequence = [1; 0; -1; -2; 3] + let initialState = {Positive = 0; Negative = 0; Text = ""} + + (sequence, initialState) ||> Seq.foldBack (fun a acc -> + let text = acc.Text + " " + string a + if a >= 0 then + { acc with + Positive = acc.Positive + 1 + Text = text } + else + { acc with + Negative = acc.Negative + 1 + Text = text }) + + Evaluates to + + { Positive = 2 + Negative = 3 + Text = " 3 -2 -1 0 1" } + + Applies a function to corresponding elements of two collections, threading an accumulator argument @@ -1394,11 +2952,28 @@ The second input sequence. The final state value. + Thrown when the either of the input sequences is null. + + + + type CoinToss = Head | Tails + + let data1 = [Tails; Head; Tails] + let data2 = [Tails; Head; Head] + + (0, data1, data2) |||> Seq.fold2 (fun acc a b -> + match (a, b) with + | Head, Head -> acc + 1 + | Tails, Tails -> acc + 1 + | _ -> acc - 1) + + Evaluates to 1 + Applies a function to each element of the collection, threading an accumulator argument - through the computation. If the input function is f and the elements are i0...iN + through the computation. If the input function is f and the elements are i0...iN then computes f (... (f s i0)...) iN A function that updates the state with each element from the sequence. @@ -1408,6 +2983,22 @@ The state object after the folding function is applied to each element of the sequence. Thrown when the input sequence is null. + + + + type Charge = + | In of int + | Out of int + + let inputs = [In 1; Out 2; In 3] + + (0, inputs) ||> Seq.fold (fun acc charge -> + match charge with + | In i -> acc + i + | Out o -> acc - o) + + Evaluates to 2 + Returns the index of the last element for which the given function returns True. @@ -1423,6 +3014,24 @@ Thrown if no element returns true when evaluated by the predicate Thrown when the input sequence is null + + + + let input = [1; 2; 3; 4; 5] + + input |> Seq.findIndex (fun elm -> elm % 2 = 0) + + Evaluates to 3 + + + + + let input = [1; 2; 3; 4; 5] + + input |> Seq.findIndex (fun elm -> elm % 6 = 0) + + Throws KeyNotFoundException + Returns the index of the first element for which the given function returns True. @@ -1435,20 +3044,56 @@ Thrown if no element returns true when evaluated by the predicate Thrown when the input sequence is null + + + + let inputs = [1; 2; 3; 4; 5] + + inputs |> Seq.findIndex (fun elm -> elm % 2 = 0) + + Evaluates to 1 + + + + + let inputs = [1; 2; 3; 4; 5] + inputs |> Seq.findIndex (fun elm -> elm % 6 = 0) + + Throws KeyNotFoundException + Returns the last element for which the given function returns True. This function digests the whole initial sequence as soon as it is called. As a result this function should not be used with large or infinite sequences. + A function to test whether an item in the sequence should be returned. The input sequence. The last element for which the predicate returns True. + Thrown if no element returns true when evaluated by the predicate Thrown when the input sequence is null - This function consumes the whole input sequence before returning the result. + + + + let inputs = [2; 3; 4] + + inputs |> Seq.findBack (fun elm -> elm % 2 = 0) + + Evaluates to 4 + + + + + let inputs = [2; 3; 4] + + inputs |> Seq.findBack (fun elm -> elm % 6 = 0) + + Throws KeyNotFoundException + Returns the first element for which the given function returns True. @@ -1461,16 +3106,34 @@ Thrown if no element returns true when evaluated by the predicate Thrown when the input sequence is null + + + + let inputs = [1; 2; 3] + + inputs |> Seq.find (fun elm -> elm % 2 = 0) + + Evaluates to 2 + + + + + let inputs = [1; 2; 3] + + inputs |> Seq.find (fun elm -> elm % 6 = 0) + + Throws KeyNotFoundException + Returns a new collection containing only the elements of the collection for which the given predicate returns "true". - The returned sequence may be passed between threads safely. However, + The returned sequence may be passed between threads safely. However, individual IEnumerator values generated from the returned sequence should not be accessed concurrently. Remember sequence is lazy, effects are delayed until it is enumerated. - + A synonym for Seq.filter. A function to test whether each item in the input sequence should be included in the output. @@ -1478,13 +3141,20 @@ The result sequence. - Thrown when the input sequence is null. + Thrown when the input sequence is null. + + + + [1; 2; 3; 4] |> Seq.where (fun elm -> elm % 2 = 0) + + Evaluates to a sequence yielding the same results as seq { 2; 4 } + Returns a new collection containing only the elements of the collection for which the given predicate returns "true". This is a synonym for Seq.where. - The returned sequence may be passed between threads safely. However, + The returned sequence may be passed between threads safely. However, individual IEnumerator values generated from the returned sequence should not be accessed concurrently. Remember sequence is lazy, effects are delayed until it is enumerated. @@ -1494,14 +3164,23 @@ The result sequence. - Thrown when the input sequence is null. + Thrown when the input sequence is null. + + + + let inputs = [1; 2; 3; 4] + + inputs |> Seq.filter (fun elm -> elm % 2 = 0) + + Evaluates to a sequence yielding the same results as seq { 2; 4 } + Tests if any pair of corresponding elements of the input sequences satisfies the given predicate. - The predicate is applied to matching elements in the two sequences up to the lesser of the - two lengths of the collections. If any application returns true then the overall result is - true and no further elements are tested. Otherwise, false is returned. If one sequence is shorter than + The predicate is applied to matching elements in the two sequences up to the lesser of the + two lengths of the collections. If any application returns true then the overall result is + true and no further elements are tested. Otherwise, false is returned. If one sequence is shorter than the other then the remaining elements of the longer sequence are ignored. A function to test each pair of items from the input sequences. @@ -1511,12 +3190,32 @@ True if any result from the predicate is true; false otherwise. Thrown when either of the two input sequences is null. + + + + let inputs1 = [1; 2] + let inputs2 = [1; 2; 0] + + (inputs1, inputs2) ||> Seq.exists2 (fun a b -> a > b) + + Evaluates to false + + + + + let inputs1 = [1; 4] + let inputs2 = [1; 3; 5] + + (inputs1, inputs2) ||> Seq.exists2 (fun a b -> a > b) + + Evaluates to true + Tests if any element of the sequence satisfies the given predicate. - The predicate is applied to the elements of the input sequence. If any application - returns true then the overall result is true and no further elements are tested. + The predicate is applied to the elements of the input sequence. If any application + returns true then the overall result is true and no further elements are tested. Otherwise, false is returned. A function to test each item of the input sequence. @@ -1525,6 +3224,24 @@ True if any result from the predicate is true; false otherwise. Thrown when the input sequence is null. + + + + let input = [1; 2; 3; 4; 5] + + input |> Seq.exists (fun elm -> elm % 4 = 0) + + Evaluates to true + + + + + let input = [1; 2; 3; 4; 5] + + input |> Seq.exists (fun elm -> elm % 6 = 0) + + Evaluates to false + Returns a new sequence with the distinct elements of the second sequence which do not appear in the first sequence, @@ -1542,26 +3259,64 @@ A sequence that contains the set difference of the elements of two sequences. Thrown when either of the two input sequences is null. + + + + let original = [1; 2; 3; 4; 5] + let itemsToExclude = [1; 3; 5] + + original |> Seq.except itemsToExclude + + Evaluates to a sequence yielding the same results as seq { 2; 4 } + Creates an empty sequence. An empty sequence. + + + + Seq.empty // Evaluates to seq { } + + Splits the input sequence into at most count chunks. + This function returns a sequence that digests the whole initial sequence as soon as that sequence is iterated. As a result this function should not be used with large or infinite sequences. + The maximum number of chunks. The input sequence. The sequence split into chunks. + Thrown when the input sequence is null. Thrown when count is not positive. + This function consumes the whole input sequence before yielding the first element of the result sequence. + + + + let inputs = [1; 2; 3; 4; 5] + + inputs |> Seq.splitInto 3 + + Evaluates to a sequence yielding the same results as seq { [|1; 2|]; [|3; 4|]; [|5|] } + + + + + let inputs = [1; 2; 3; 4; 5] + + inputs |> Seq.splitInto -1 + + Throws ArgumentException + - Returns a sequence that contains no duplicate entries according to the + Returns a sequence that contains no duplicate entries according to the generic hash and equality comparisons on the keys returned by the given key-generating function. If an element occurs multiple times in the sequence then the later occurrences are discarded. @@ -1571,6 +3326,15 @@ The result sequence. Thrown when the input sequence is null. + + + + let inputs = [{Bar = 1 };{Bar = 1}; {Bar = 2}; {Bar = 3}] + + inputs |> Seq.distinctBy (fun foo -> foo.Bar) + + Evaluates to a sequence yielding the same results as seq { { Bar = 1 }; { Bar = 2 }; { Bar = 3 } } + Returns a sequence that contains no duplicate entries according to generic hash and @@ -1582,23 +3346,39 @@ The result sequence. Thrown when the input sequence is null. + + + + [1; 1; 2; 3] |> Seq.distinct + + Evaluates to a sequence yielding the same results as seq { 1; 2; 3 } + Returns a sequence that is built from the given delayed specification of a sequence. - The input function is evaluated each time an IEnumerator for the sequence + The input function is evaluated each time an IEnumerator for the sequence is requested. The generating function for the sequence. + The result sequence. + + + + Seq.delay (fun () -> Seq.ofList [1; 2; 3]) + + Evaluates to a sequence yielding the same results as seq { 1; 2; 3 }, executing + the generator function every time is consumed. + Applies a key-generating function to each element of a sequence and returns a sequence yielding unique keys and their number of occurrences in the original sequence. - - Note that this function returns a sequence that digests the whole initial sequence as soon as - that sequence is iterated. As a result this function should not be used with - large or infinite sequences. The function makes no assumption on the ordering of the original + + Note that this function returns a sequence that digests the whole initial sequence as soon as + that sequence is iterated. As a result this function should not be used with + large or infinite sequences. The function makes no assumption on the ordering of the original sequence. A function transforming each item of the input sequence into a key to be @@ -1608,6 +3388,17 @@ The result sequence. Thrown when the input sequence is null. + + + + type Foo = { Bar: string } + + let inputs = [{Bar = "a"}; {Bar = "b"}; {Bar = "a"}] + + inputs |> Seq.countBy (fun foo -> foo.Bar) + + Evaluates to a sequence yielding the same results as seq { ("a", 2); ("b", 1) } + Tests if the sequence contains the specified element. @@ -1616,13 +3407,21 @@ The input sequence. True if the input sequence contains the specified element; false otherwise. + Thrown when the input sequence is null. + + + + [1; 2] |> Seq.contains 2 // evaluates to true + [1; 2] |> Seq.contains 5 // evaluates to false + + Combines the given enumeration-of-enumerations as a single concatenated enumeration. - The returned sequence may be passed between threads safely. However, + The returned sequence may be passed between threads safely. However, individual IEnumerator values generated from the returned sequence should not be accessed concurrently. The input enumeration-of-enumerations. @@ -1630,6 +3429,15 @@ The result sequence. Thrown when the input sequence is null. + + + + let inputs = [[1; 2]; [3]; [4; 5]] + + inputs |> Seq.concat + + Evaluates to a sequence yielding the same results as seq { 1; 2; 3; 4; 5 } + Compares two sequences using the given comparison function, element by element. @@ -1645,6 +3453,71 @@ Thrown when either of the input sequences is null. + + + + let closerToNextDozen a b = + (a % 12).CompareTo(b % 12) + + let input1 = [1; 10] + let input2 = [1; 10] + + (input1, input2) ||> Seq.compareWith closerToNextDozen + + Evaluates to 0 + + + + + let closerToNextDozen a b = + (a % 12).CompareTo(b % 12) + + let input1 = [1; 5] + let input2 = [1; 8] + + (input1, input2) ||> Seq.compareWith closerToNextDozen + + Evaluates to -1 + + + + + let closerToNextDozen a b = + (a % 12).CompareTo(b % 12) + + let input1 = [1; 11] + let input2 = [1; 13] + + (input1, input2) ||> Seq.compareWith closerToNextDozen + + Evaluates to 1 + + + + + let closerToNextDozen a b = + (a % 12).CompareTo(b % 12) + + let input1 = [1; 2] + let input2 = [1] + + (input1, input2) ||> Seq.compareWith closerToNextDozen + + Evaluates to 1 + + + + + let closerToNextDozen a b = + (a % 12).CompareTo(b % 12) + + let input1 = [1] + let input2 = [1; 2] + + (input1, input2) ||> Seq.compareWith closerToNextDozen + + Evaluates to -1 + Applies the given function to each element of the sequence and concatenates all the @@ -1659,6 +3532,26 @@ The result sequence. Thrown when the input sequence is null. + + + + type Foo = { Bar: int seq } + + let input = seq { {Bar = [1; 2]}; {Bar = [3; 4]} } + + input |> Seq.collect (fun foo -> foo.Bar) + + Evaluates to a sequence yielding the same results as seq { 1; 2; 3; 4 } + + + + + let input = [[1; 2]; [3; 4]] + + input |> Seq.collect id + + Evaluates to a sequence yielding the same results as seq { 1; 2; 3; 4 } + Divides the input sequence into chunks of size at most chunkSize. @@ -1667,15 +3560,30 @@ The input sequence. The sequence divided into chunks. + Thrown when the input sequence is null. Thrown when chunkSize is not positive. + + + + [1; 2; 3] |> Seq.chunkBySize 2 + + Evaluates to a sequence yielding the same results as seq { [|1; 2|]; [|3|] } + + + + + [1; 2; 3] |> Seq.chunkBySize -2 + + Throws ArgumentException + - Applies the given function to each element of the list. Return - the list comprised of the results "x" for each element where + Applies the given function to each element of the sequence. Returns + a sequence comprised of the results "x" for each element where the function returns Some(x). - The returned sequence may be passed between threads safely. However, + The returned sequence may be passed between threads safely. However, individual IEnumerator values generated from the returned sequence should not be accessed concurrently. @@ -1683,8 +3591,22 @@ The input sequence of type T. The result sequence. - + Thrown when the input sequence is null. + + + + [Some 1; None; Some 2] |> Seq.choose id + + Evaluates to a sequence yielding the same results as seq { 1; 2 } + + + + + [1; 2; 3] |> Seq.choose (fun n -> if n % 2 = 0 then Some n else None) + + Evaluates to a sequence yielding the same results as seq { 2 } + Wraps a loosely-typed System.Collections sequence as a typed sequence. @@ -1693,34 +3615,41 @@ An incorrect type annotation may result in runtime type errors. Individual IEnumerator values generated from the returned sequence should not be accessed concurrently. - + The input sequence. The result sequence. Thrown when the input sequence is null. + + + + [box 1; box 2; box 3] |> Seq.cast<int> + + Evaluates to a sequence yielding the same results as seq { 1; 2; 3 }, explicitly typed as seq<int>. + Returns a sequence that corresponds to a cached version of the input sequence. - The result sequence will have the same elements as the input sequence. The result - can be enumerated multiple times. The input sequence will be enumerated at most + The result sequence will have the same elements as the input sequence. The result + can be enumerated multiple times. The input sequence will be enumerated at most once and only as far as is necessary. Caching a sequence is typically useful when repeatedly evaluating items in the original sequence is computationally expensive or if iterating the sequence causes side-effects that the user does not want to be repeated multiple times. Enumeration of the result sequence is thread safe in the sense that multiple independent IEnumerator - values may be used simultaneously from different threads (accesses to + values may be used simultaneously from different threads (accesses to the internal lookaside table are thread safe). Each individual IEnumerator is not typically thread safe and should not be accessed concurrently. Once enumeration of the input sequence has started, it's enumerator will be kept live by this object until the enumeration has completed. - At that point, the enumerator will be disposed. + At that point, the enumerator will be disposed. - The enumerator may be disposed and underlying cache storage released by + The enumerator may be disposed and underlying cache storage released by converting the returned sequence object to type IDisposable, and calling the Dispose method on this object. The sequence object may then be re-enumerated and a fresh enumerator will be used. @@ -1730,12 +3659,23 @@ The result sequence. Thrown when the input sequence is null. + + + + let fibSeq =(0, 1) |> Seq.unfold (fun (a,b) -> Some(a + b, (b, a + b))) + + let fibSeq3 = fibSeq |> Seq.take 3 |> Seq.cache + fibSeq3 + + Evaluates to a sequence yielding the same results as seq { 1; 2; 3 }, + and it will not do the calculation again when called. + - Returns the average of the results generated by applying the function to each element + Returns the average of the results generated by applying the function to each element of the sequence. - The elements are averaged using the + operator, DivideByInt method and Zero property + The elements are averaged using the + operator, DivideByInt method and Zero property associated with the generated type. A function applied to transform each element of the sequence. @@ -1745,11 +3685,31 @@ Thrown when the input sequence is null. Thrown when the input sequence has zero elements. + + + + type Foo = { Bar: float } + + let input = seq { {Bar = 2.0}; {Bar = 4.0} } + + input |> Seq.averageBy (fun foo -> foo.Bar) + + Evaluates to 3.0 + + + + + type Foo = { Bar: float } + + Seq.empty |> Seq.averageBy (fun (foo: Foo) -> foo.Bar) + + Throws ArgumentException + Returns the average of the elements in the sequence. - The elements are averaged using the + operator, DivideByInt method and Zero property + The elements are averaged using the + operator, DivideByInt method and Zero property associated with the element type. The input sequence. @@ -1758,6 +3718,20 @@ Thrown when the input sequence is null. Thrown when the input sequence has zero elements. + + + + [1.0; 2.0; 3.0] |> Seq.average + + Evaluates to 2.0 + + + + + [] |> Seq.average + + Throws ArgumentException + Wraps the two given enumerations as a single concatenated @@ -1774,6 +3748,13 @@ Thrown when either of the two provided sequences is null. + + + + Seq.append [1; 2] [3; 4] + + Evaluates to a sequence yielding the same results as seq { 1; 2; 3; 4 } + Returns a new sequence that contains all pairings of elements from the first and second sequences. @@ -1784,70 +3765,246 @@ The result sequence. Thrown when either of the input sequences is null. + + + + ([1; 2], [3; 4]) ||> Seq.allPairs + + Evaluates to a sequence yielding the same results as + + seq { (1, 3); (1, 4); (2, 3); (2, 4) } + + Contains operations for working with values of type . - - Combines the three lists into a list of triples. The lists must have equal lengths. + + Return a new list with new items inserted before the given index. - The first input list. - The second input list. - The third input list. + The index where the items should be inserted. + The values to insert. + The input list. + + The result list. - A single list containing triples of matching elements from the input lists. - - - Combines the two lists into a list of pairs. The two lists must have equal lengths. + Thrown when index is below 0 or greater than source.Length. - The first input list. - The second input list. + + + let inputs = [ 0; 1; 2 ] - A single list containing pairs of matching elements from the input lists. + inputs |> List.insertManyAt 1 [ 8; 9 ] + Evaluates to [ 0; 8; 9; 1; 2 ]. + + - - Returns a list of sliding windows containing elements drawn from the input - list. Each window is returned as a fresh list. - - The number of elements in each window. - The input list. + + Return a new list with a new item inserted before the given index. + The index where the item should be inserted. + The value to insert. + The input list. + The result list. - Thrown when windowSize is not positive. - - - Returns a new list containing only the elements of the list - for which the given predicate returns "true" + Thrown when index is below 0 or greater than source.Length. - The function to test the input elements. - The input list. + + + let inputs = [ 0; 1; 2 ] - A list containing only the elements that satisfy the predicate. + inputs |> List.insertAt 1 9 + + Evaluates to [ 0; 9; 1; 2 ]. + - - Splits a list of triples into three lists. + + Return a new list with the item at a given index set to the new value. - The input list. + The index of the item to be replaced. + The new value. + The input list. - Three lists of split elements. - - - Splits a list of pairs into two lists. + The result list. - The input list. + Thrown when index is outside 0..source.Length - 1 - Two lists of split elements. + + + let inputs = [ 0; 1; 2 ] + + inputs |> List.updateAt 1 9 + + Evaluates to [ 0; 9; 2 ]. + - - Returns a list that contains the elements generated by the given computation. - The given initial state argument is passed to the element generator. + + Return a new list with the number of items starting at a given index removed. - A function that takes in the current state and returns an option tuple of the next + The index of the item to be removed. + The number of items to remove. + The input list. + + The result list. + + Thrown when index is outside 0..source.Length - count + + + + let inputs = [ 0; 1; 2; 3 ] + + inputs |> List.removeManyAt 1 2 + + Evaluates to [ 0; 3 ]. + + + + Return a new list with the item at a given index removed. + + The index of the item to be removed. + The input list. + + The result list. + + Thrown when index is outside 0..source.Length - 1 + + + + let inputs = [ 0; 1; 2 ] + + inputs |> List.removeAt 1 + + let inputs = [ 0; 2 ] + + + + Combines the three lists into a list of triples. The lists must have equal lengths. + + The first input list. + The second input list. + The third input list. + + A single list containing triples of matching elements from the input lists. + + + + let numbers = [1; 2] + let names = ["one"; "two"] + let roman = ["I"; "II"] + + Array.zip3 numbers names roman + + Evaluates to [(1, "one", "I"); (2, "two", "II")]. + + + + Combines the two lists into a list of pairs. The two lists must have equal lengths. + + The first input list. + The second input list. + + A single list containing pairs of matching elements from the input lists. + + + + let numbers = [1; 2] + let names = ["one"; "two"] + + List.zip numbers names + + Evaluates to [(1, "one"); (2, "two")]. + + + + Returns a list of sliding windows containing elements drawn from the input + list. Each window is returned as a fresh list. + + The number of elements in each window. + The input list. + + The result list. + + Thrown when windowSize is not positive. + + + + let inputs = [1; 2; 3; 4; 5] + + inputs |> List.windowed 3 + + Evaluates to [[1; 2; 3]; [2; 3; 4]; [3; 4; 5]] + + + + Returns a new list containing only the elements of the list + for which the given predicate returns "true" + + The function to test the input elements. + The input list. + + A list containing only the elements that satisfy the predicate. + + This is identical to List.filter. + + Select only the even numbers: + + let inputs = [1; 2; 3; 4] + + inputs |> List.where (fun elm -> elm % 2 = 0) + + Evaluates to [2; 4] + + + + Splits a list of triples into three lists. + + The input list. + + Three lists of split elements. + + + + let inputs = [(1, "one", "I"); (2, "two", "II")] + + let numbers, names, roman = inputs |> List.unzip3 + + Evaluates numbers to [1; 2], names to ["one"; "two"] and roman to ["I"; "II"]. + + + + Splits a list of pairs into two lists. + + The input list. + + Two lists of split elements. + + + + let inputs = [(1, "one"); (2, "two")] + + let numbers, names = inputs |> List.unzip + + Evaluates numbers to [1; 2] and names to ["one"; "two"]. + + + + Returns a list that contains the elements generated by the given computation. + The generator is repeatedly called to build the list until it returns `None`. + The given initial state argument is passed to the element generator. + + A function that takes in the current state and returns an option tuple of the next element of the list and the next state value. The initial state value. The result list. + + + + 1 |> List.unfold (fun state -> if state > 100 then None else Some (state, state * 2)) + + Evaluates to [1; 2; 4; 8; 16; 32; 64] + Returns the index of the last element in the list @@ -1859,6 +4016,24 @@ The index of the last element for which the predicate returns true, or None if every element evaluates to false. + + Try to find the index of the first even number from the back: + + let inputs = [1; 2; 3; 4; 5] + + inputs |> List.tryFindIndexBack (fun elm -> elm % 2 = 0) + + Evaluates to Some 3 + + + Try to find the index of the first even number from the back: + + let inputs = [1; 3; 5; 7] + + inputs |> List.tryFindIndexBack (fun elm -> elm % 2 = 0) + + Evaluates to None + Tries to find the nth element in the list. @@ -1868,6 +4043,24 @@ The input list. The value at the given index or None. + + + + let inputs = ["a"; "b"; "c"] + + inputs |> List.tryItem 1 + + Evaluates to Some "b". + + + + + let inputs = ["a"; "b"; "c"] + + inputs |> List.tryItem 4 + + Evaluates to None. + Returns the index of the first element in the list @@ -1879,6 +4072,24 @@ The index of the first element for which the predicate returns true, or None if every element evaluates to false. + + Try to find the index of the first even number: + + let inputs = [1; 2; 3; 4; 5] + + inputs |> List.tryFindIndex (fun elm -> elm % 2 = 0) + + Evaluates to Some 1 + + + Try to find the index of the first even number: + + let inputs = [1; 3; 5; 7] + + inputs |> List.tryFindIndex (fun elm -> elm % 2 = 0) + + Evaluates to None + Returns the last element for which the given function returns True. @@ -1889,6 +4100,24 @@ The last element for which the predicate returns true, or None if every element evaluates to false. + + Try to find the first even number from the back: + + let inputs = [1; 2; 3; 4; 5] + + inputs |> List.tryFindBack (fun elm -> elm % 2 = 0) + + Evaluates to Some 4 + + + Try to find the first even number from the back: + + let inputs = [1; 5; 3] + + inputs |> List.tryFindBack (fun elm -> elm % 2 = 0) + + Evaluates to None + Returns the first element for which the given function returns True. @@ -1899,6 +4128,24 @@ The first element for which the predicate returns true, or None if every element evaluates to false. + + Try to find the first even number: + + let inputs = [1; 2; 3] + + inputs |> List.tryFind (fun elm -> elm % 2 = 0) + + Evaluates to Some 2 + + + Try to find the first even number: + + let inputs = [1; 5; 3] + + inputs |> List.tryFind (fun elm -> elm % 2 = 0) + + Evaluates to None + Applies the given function to successive elements, returning Some(x) the first @@ -1909,6 +4156,25 @@ The input list. The first resulting value or None. + + + + let input = [1; 2; 3] + + input |> List.tryPick (fun n -> if n % 2 = 0 then Some (string n) else None) + + Evaluates to Some "2". + + + + + let input = [1; 2; 3] + + input |> List.tryPick (fun n -> if n > 3 = 0 then Some (string n) else None) + + Evaluates to None. + + Returns at most N elements in a new list. @@ -1917,6 +4183,33 @@ The input list. The result list. + + + + let inputs = ["a"; "b"; "c"; "d"] + + inputs |> List.truncate 2 + + Evaluates to ["a"; "b"] + + + + + let inputs = ["a"; "b"; "c"; "d"] + + inputs |> List.truncate 6 + + Evaluates to ["a"; "b"; "c"; "d"] + + + + + let inputs = ["a"; "b"; "c"; "d"] + + inputs |> List.truncate 0 + + Evaluates to the empty list. + Returns the transpose of the given sequence of lists. @@ -1927,6 +4220,17 @@ Thrown when the input sequence is null. Thrown when the input lists differ in length. + + + + let inputs = + [ [ 10; 20; 30 ] + [ 11; 21; 31 ] ] + + inputs |> List.transpose + + Evaluates to [ [10; 11]; [20; 21]; [30; 31] ]. + Returns the first element of the list, or @@ -1935,6 +4239,24 @@ The input list. The first element of the list or None. + + + + let inputs = [ "banana"; "pear" ] + + inputs |> List.tryHead + + Evaluates to Some "banana" + + + + + let inputs : int list = [] + + inputs |> List.tryHead + + Evaluates to None + Views the given list as a sequence. @@ -1942,6 +4264,15 @@ The input list. The sequence of elements in the list. + + + + let inputs = [ 1; 2; 5 ] + + inputs |> List.toSeq + + Evaluates to seq { 1; 2; 5 }. + Builds an array from the given list. @@ -1949,6 +4280,15 @@ The input list. The array containing the elements of the list. + + + + let inputs = [ 1; 2; 5 ] + + inputs |> List.toArray + + Evaluates to [| 1; 2; 5 |]. + Returns a list that contains all elements of the original list while the @@ -1958,6 +4298,15 @@ The input list. The result list. + + + + let inputs = ["a"; "bb"; "ccc"; "d"] + + inputs |> List.takeWhile (fun x -> x.Length < 3) + + Evaluates to ["a"; "bb"] + Returns the first N elements of the list. @@ -1973,6 +4322,33 @@ Thrown when the input list is empty. Thrown when count exceeds the number of elements in the list. + + + + let inputs = ["a"; "b"; "c"; "d"] + + inputs |> List.take 2 + + Evaluates to ["a"; "b"] + + + + + let inputs = ["a"; "b"; "c"; "d"] + + inputs |> List.take 6 + + Throws InvalidOperationException. + + + + + let inputs = ["a"; "b"; "c"; "d"] + + inputs |> List.take 0 + + Evaluates to the empty list. + Returns the list after removing the first element. @@ -1982,6 +4358,16 @@ Thrown when the list is empty. The list after removing the first element. + + + + let inputs = ["a"; "bb"; "ccc"] + + inputs |> List.tail + + Evaluates to ["bb"; "ccc"] + + Returns the sum of the results generated by applying the function to each element of the list. @@ -1990,6 +4376,15 @@ The input list. The resulting sum. + + + + let input = [ "aa"; "bbb"; "cc" ] + + input |> List.sumBy (fun s -> s.Length) + + Evaluates to 7. + Returns the sum of the elements in the list. @@ -1997,6 +4392,15 @@ The input list. The resulting sum. + + + + let input = [ 1; 5; 3; 2 ] + + input |> List.sum + + Evaluates to 11. + Sorts the given list in descending order using . @@ -2005,6 +4409,15 @@ The input list. The sorted list. + + + + let input = [8; 4; 3; 1; 6; 1] + + input |> List.sortDescending + + Evaluates to [8; 6; 4; 3; 1; 1]. + Sorts the given list in descending order using keys given by the given projection. Keys are compared using . @@ -2014,6 +4427,15 @@ The input list. The sorted list. + + + + let input = ["a"; "bbb"; "cccc"; "dd"] + + input |> List.sortByDescending (fun s -> s.Length) + + Evaluates to ["cccc"; "bbb"; "dd"; "a"]. + Splits a list into two lists, at the given index. @@ -2025,6 +4447,15 @@ Thrown when split index exceeds the number of elements in the list. + + + + let input = [8; 4; 3; 1; 6; 1] + + let front, back = input |> List.splitAt 3 + + Evaluates front to [8; 4; 3] and back to [1; 6; 1]. + Sorts the given list using . @@ -2033,6 +4464,15 @@ The input list. The sorted list. + + + + let input = [8; 4; 3; 1; 6; 1] + + List.sort input + + Evaluates to [1; 1 3; 4; 6; 8]. + Sorts the given list using keys given by the given projection. Keys are compared using . @@ -2042,6 +4482,15 @@ The input list. The sorted list. + + + + let input = [ "a"; "bbb"; "cccc"; "dd" ] + + input |> List.sortBy (fun s -> s.Length) + + Evaluates to ["a"; "dd"; "bbb"; "cccc"]. + Sorts the given list using the given comparison function. @@ -2051,6 +4500,20 @@ The input list. The sorted list. + + Sort a list of pairs using a comparison function that compares string lengths then index numbers: + + let compareEntries (n1: int, s1: string) (n2: int, s2: string) = + let c = compare s1.Length s2.Length + if c <> 0 then c else + compare n1 n2 + + let input = [ (0,"aa"); (1,"bbb"); (2,"cc"); (3,"dd") ] + + input |> List.sortWith compareEntries + + Evaluates to [(0, "aa"); (2, "cc"); (3, "dd"); (1, "bbb")]. + Bypasses elements in a list while the given predicate returns True, and then returns @@ -2060,17 +4523,54 @@ The input list. The result list. + + + + let inputs = ["a"; "bbb"; "cc"; "d"] + + inputs |> List.skipWhile (fun x -> x.Length < 3) + + Evaluates to ["bbb"; "cc"; "d"] + + Returns the list after removing the first N elements. - The number of elements to skip. + The number of elements to skip. If the number is 0 or negative the input list is returned. The input list. The list after removing the first N elements. - Thrown when count is negative or exceeds the number of + Thrown when count exceeds the number of elements in the list. + + + + let inputs = ["a"; "b"; "c"; "d"] + + inputs |> List.skip 2 + + Evaluates to ["c"; "d"] + + + + + let inputs = ["a"; "b"; "c"; "d"] + + inputs |> List.skip 5 + + Throws ArgumentException. + + + + + let inputs = ["a"; "b"; "c"; "d"] + + inputs |> List.skip -1 + + Evaluates to ["a"; "b"; "c"; "d"]. + Returns a list that contains one item only. @@ -2078,6 +4578,13 @@ The input item. The result list of one item. + + + + List.singleton 7 + + Evaluates to [ 7 ]. + Like foldBack, but returns both the intermediary and final results @@ -2087,6 +4594,25 @@ The initial state. The list of states. + + Apply a list charges from back to front, and collect the running balances as each is applied: + + type Charge = + | In of int + | Out of int + + let inputs = [ In 1; Out 2; In 3 ] + + (inputs, 0) ||> List.scanBack (fun charge acc -> + match charge with + | In i -> acc + i + | Out o -> acc - o) + + Evaluates to [2; 1; 3; 0] by processing each input from back to front. Note 0 is the intial + state, 3 the next state, 1 the next state, and 2 the final state, and the states + are produced from back to front. + Note acc is a commonly used abbreviation for "accumulator". + Applies a function to each element of the collection, threading an accumulator argument @@ -2099,6 +4625,24 @@ The input list. The list of states. + + Apply a list charges and collect the running balances as each is applied: + + type Charge = + | In of int + | Out of int + + let inputs = [In 1; Out 2; In 3] + + (0, inputs) ||> List.scan (fun acc charge -> + match charge with + | In i -> acc + i + | Out o -> acc - o) + + Evaluates to [0; 1; -1; 2]. Note 0 is the intial + state, 1 the next state, -1 the next state, and 2 the final state. + Note acc is a commonly used abbreviation for "accumulator". + Returns a new list with the elements in reverse order. @@ -2106,6 +4650,15 @@ The input list. The reversed list. + + + + let inputs = [ 0; 1; 2 ] + + inputs |> List.rev + + Evaluates to [ 2; 1; 0 ]. + Creates a list by replicating the given initial value. @@ -2114,6 +4667,13 @@ The value to replicate The generated list. + + + + List.replicate 3 "a" + + Evaluates to [ "a"; "a"; "a" ]. + Applies a function to each element of the collection, starting from the end, threading an accumulator argument @@ -2127,6 +4687,15 @@ Thrown when the list is empty. The final result of the reductions. + + + + let inputs = [1; 3; 4; 2] + + inputs |> List.reduceBack (fun a b -> a + b * 10) + + Evaluates to 2431, by computing 1 + (3 + (4 + 2 * 10) * 10) * 10 + Apply a function to each element of the collection, threading an accumulator argument @@ -2143,6 +4712,15 @@ Thrown when the list is empty. The final reduced value. + + + + let inputs = [1; 3; 4; 2] + + inputs |> List.reduce (fun a b -> a * 10 + b) + + Evaluates to 1342, by computing ((1 * 10 + 3) * 10 + 4) * 10 + 2 + Returns a list with all elements permuted according to the @@ -2154,6 +4732,15 @@ The permuted list. Thrown when indexMap does not produce a valid permutation. + + + + let inputs = [1; 2; 3; 4] + + inputs |> List.permute (fun x -> (x + 1) % 4) + + Evaluates to [4; 1; 2; 3]. + Applies the given function to successive elements, returning the first @@ -2166,6 +4753,25 @@ Thrown when the list is empty. The first resulting value. + + + + let input = [1; 2; 3] + + input |> List.pick (fun n -> if n % 2 = 0 then Some (string n) else None) + + Evaluates to "2". + + + + + let input = [1; 2; 3] + + input |> List.pick (fun n -> if n > 3 = 0 then Some (string n) else None) + + Throws KeyNotFoundException. + + Splits the collection into two collections, containing the @@ -2175,8 +4781,17 @@ The function to test the input elements. The input list. - A list containing the elements for which the predicate evaluated to false and a list - containing the elements for which the predicate evaluated to true. + A list containing the elements for which the predicate evaluated to true and a list + containing the elements for which the predicate evaluated to false. + + + + let inputs = [1; 2; 3; 4] + + let evens, odds = inputs |> List.partition (fun x -> x % 2 = 0) + + Evaluates evens to [2; 4] and odds to [1; 3]. + Returns a list of each element in the input list and its predecessor, with the @@ -2185,6 +4800,15 @@ The input list. The result list. + + + + let inputs = [1; 2; 3; 4] + + inputs |> List.pairwise + + Evaluates to [(1, 2); (2, 3); (3, 4)]. + Builds a new list from the given enumerable object. @@ -2192,6 +4816,15 @@ The input sequence. The list of elements from the sequence. + + + + let inputs = seq { 1; 2; 5 } + + inputs |> List.ofSeq + + Evaluates to [ 1; 2; 5 ]. + Builds a list from the given array. @@ -2199,6 +4832,15 @@ The input array. The list of elements from the array. + + + + let inputs = [| 1; 2; 5 |] + + inputs |> List.ofArray + + Evaluates to [ 1; 2; 5 ]. + Indexes into the list. The first element has index 0. @@ -2220,6 +4862,24 @@ Thrown when the list is empty. The minimum value. + + + + let inputs = ["aaa"; "b"; "cccc"] + + inputs |> List.minBy (fun s -> s.Length) + + Evaluates to "b" + + + + + let inputs = [] + + inputs |> List.minBy (fun (s: string) -> s.Length) + + Throws System.ArgumentException. + Returns the lowest of all elements of the list, compared via Operators.min. @@ -2230,6 +4890,24 @@ Thrown when the list is empty. The minimum value. + + + + let inputs = [10; 12; 11] + + inputs |> List.min + + Evaluates to 10 + + + + + let inputs = [] + + inputs |> List.min + + Throws System.ArgumentException. + Returns the greatest of all elements of the list, compared via Operators.max on the function result. @@ -2241,6 +4919,24 @@ Thrown when the list is empty. The maximum element. + + + + let inputs = ["aaa"; "b"; "cccc"] + + inputs |> List.maxBy (fun s -> s.Length) + + Evaluates to "cccc" + + + + + let inputs = [] + + inputs |> List.maxBy (fun (s: string) -> s.Length) + + Throws System.ArgumentException. + Return the greatest of all elements of the list, compared via Operators.max. @@ -2251,6 +4947,24 @@ Thrown when the list is empty. The maximum element. + + + + let inputs = [ 10; 12; 11 ] + + inputs |> List.max + + Evaluates to 12 + + + + + let inputs = [ ] + + inputs |> List.max + + Throws System.ArgumentException. + Like mapi, but mapping corresponding elements from two lists of equal length. @@ -2260,6 +4974,16 @@ The second input list. The list of transformed elements. + + + + let inputs1 = ["a"; "bad"; "good"] + let inputs2 = [0; 2; 1] + + (inputs1, inputs2) ||> List.mapi2 (fun i x y -> i, x[y]) + + Evaluates to [(0, 'a'); (1, 'd'); (2, 'o')] + Builds a new collection whose elements are the results of applying the given function @@ -2270,6 +4994,15 @@ The input list. The list of transformed elements. + + + + let inputs = [ 10; 10; 10 ] + + inputs |> List.mapi (fun i x -> i + x) + + Evaluates to [ 10; 11; 12 ] + Combines map and foldBack. Builds a new list whose elements are the results of applying the given function @@ -2280,6 +5013,24 @@ The initial state. The list of transformed elements, and the final accumulated value. + + Accumulate the charges from back to front, and double them as well + + type Charge = + | In of int + | Out of int + + let charges = [ In 1; Out 2; In 3 ] + + let newCharges, balance = + (charges, 0) ||> List.mapFoldBack (fun charge acc -> + match charge with + | In i -> In (i*2), acc + i + | Out o -> Out (o*2), acc - o) + + Evaluates newCharges to [In 2; Out 4; In 6] and balance to 2. + Note acc is a commonly used abbreviation for "accumulator". + Combines map and fold. Builds a new list whose elements are the results of applying the given function @@ -2290,6 +5041,24 @@ The input list. The list of transformed elements, and the final accumulated value. + + + Accumulate the charges, and double them as well + type Charge = + | In of int + | Out of int + + let inputs = [ In 1; Out 2; In 3 ] + + let newCharges, balance = + (0, inputs) ||> List.mapFold (fun acc charge -> + match charge with + | In i -> In (i*2), acc + i + | Out o -> Out (o*2), acc - o) + + Evaluates newCharges to [In 2; Out 4; In 6] and balance to 2. + Note acc is a commonly used abbreviation for "accumulator". + Builds a new collection whose elements are the results of applying the given function @@ -2301,6 +5070,18 @@ The third input list. The list of transformed elements. + + + + let inputs1 = [ "a"; "t"; "ti" ] + let inputs2 = [ "l"; "h"; "m" ] + let inputs3 = [ "l"; "e"; "e" ] + + (inputs1, inputs2, inputs3) |||> List.map3 (fun x y z -> x + y + z) + + Evaluates to [ "all"; "the"; "time" ] + + Builds a new collection whose elements are the results of applying the given function @@ -2311,6 +5092,16 @@ The second input list. The list of transformed elements. + + + + let inputs1 = ["a"; "bad"; "good"] + let inputs2 = [0; 2; 1] + + (inputs1, inputs2) ||> List.map2 (fun x y -> x.[y]) + + Evaluates to seq ['a'; 'd'; 'o'] + Builds a new collection whose elements are the results of applying the given function @@ -2320,6 +5111,15 @@ The input list. The list of transformed elements. + + + + let inputs = [ "a"; "bbb"; "cc" ] + + inputs |> List.map (fun x -> x.Length) + + Evaluates to [ 1; 3; 2 ] + Returns the last element of the list. @@ -2328,6 +5128,20 @@ The input list. The last element of the list or None. + + + + [ "pear"; "banana" ] |> List.tryLast + + Evaluates to Some "banana" + + + + + [ ] |> List.tryLast + + Evaluates to None + Returns the length of the list. @@ -2335,6 +5149,17 @@ The input list. The length of the list. + + The notation array.Length is preferred. + + + + let inputs = [ "a"; "b"; "c" ] + + inputs |> List.length + + Evaluates to 3 + Returns the last element of the list. @@ -2344,6 +5169,20 @@ The last element of the list. Thrown when the input does not have any elements. + + + + [ "pear"; "banana" ] |> List.last + + Evaluates to banana + + + + + [ ] |> List.last + + Throws ArgumentException + Applies the given function to two collections simultaneously. The @@ -2353,6 +5192,22 @@ The function to apply to a pair of elements from the input lists along with their index. The first input list. The second input list. + + + + let inputs1 = [ "a"; "b"; "c" ] + let inputs2 = [ "banana"; "pear"; "apple" ] + + (inputs1, inputs2) ||> List.iteri2 (fun i s1 s2 -> printfn "Index {i}: {s1} - {s2}") + + Evaluates to unit and prints + + Index 0: a - banana + Index 1: b - pear + Index 2: c - apple + + in the console. + Applies the given function to each element of the collection. The integer passed to the @@ -2360,6 +5215,21 @@ The function to apply to the elements of the list along with their index. The input list. + + + + let inputs = [ "a"; "b"; "c" ] + + inputs |> List.iteri (fun i v -> printfn "{i}: {v}") + + Evaluates to unit and prints + + 0: a + 1: b + 2: c + + in the console. + Applies the given function to two collections simultaneously. The @@ -2368,12 +5238,43 @@ The function to apply to pairs of elements from the input lists. The first input list. The second input list. + + + + let inputs1 = [ "a"; "b"; "c" ] + let inputs2 = [ 1; 2; 3 ] + + (inputs1, inputs2) ||> List.iter2 (printfn "%s: %i") + + Evaluates to unit and prints + + a: 1 + b: 2 + c: 3 + + in the console. + Applies the given function to each element of the collection. The function to apply to elements from the input list. The input list. + + + + let inputs = [ "a"; "b"; "c" ] + + inputs |> List.iter (printfn "%s") + + Evaluates to unit and prints + + a + b + c + + in the console. + Indexes into the list. The first element has index 0. @@ -2384,6 +5285,24 @@ The value at the given index. Thrown when the index is negative or the input list does not contain enough elements. + + + + let inputs = [ "a"; "b"; "c" ] + + inputs |> List.item 1 + + Evaluates to "b" + + + + + let inputs = [ "a"; "b"; "c" ] + + inputs |> List.item 4 + + Throws ArgumentException + Returns true if the list contains no elements, false otherwise. @@ -2391,6 +5310,20 @@ The input list. True if the list is empty. + + + + [ ] |> List.isEmpty + + Evaluates to true + + + + + [ "pear"; "banana" ] |> List.isEmpty + + Evaluates to false + Creates a list by calling the given generator on each index. @@ -2398,7 +5331,23 @@ The length of the list to generate. The function to generate an element from an index. + Thrown when the input length is negative. + The list of generated elements. + + + + List.init 4 (fun v -> v + 5) + + Evaluates to [5; 6; 7; 8] + + + + + List.init -5 (fun v -> v + 5) + + Throws ArgumentException + Returns a new list whose elements are the corresponding elements @@ -2407,6 +5356,15 @@ The input list. The list of indexed elements. + + + + let inputs = ["a"; "b"; "c"] + + inputs |> List.indexed + + Evaluates to [(0, "a"); (1, "b"); (2, "c")] + Returns the first element of the list. @@ -2416,6 +5374,22 @@ Thrown when the list is empty. The first element of the list. + + + + let inputs = ["banana"; "pear"] + + inputs |> List.head + + Evaluates to banana + + + + + [] |> List.head + + Throws ArgumentException + Applies a key-generating function to each element of a list and yields a list of @@ -2426,6 +5400,15 @@ The input list. The result list. + + + + let inputs = [1; 2; 3; 4; 5] + + inputs |> List.groupBy (fun n -> n % 2) + + Evaluates to [(1, [1; 3; 5]); (0, [2; 4])] + Tests if all corresponding elements of the collection satisfy the given predicate pairwise. @@ -2442,6 +5425,36 @@ Thrown when the input lists differ in length. True if all of the pairs of elements satisfy the predicate. + + + + let inputs1 = [1; 2; 3] + let inputs2 = [1; 2; 3] + + (inputs1, inputs2) ||> List.forall2 (=) + + Evaluates to true. + + + + + let items1 = [2017; 1; 1] + let items2 = [2019; 19; 8] + + (items1, items2) ||> List.forall2 (=) + + Evaluates to false. + + + + + let items1 = [1; 2; 3] + let items2 = [1; 2] + + (items1, items2) ||> List.forall2 (=) + + Throws ArgumentException. + Tests if all elements of the collection satisfy the given predicate. @@ -2453,6 +5466,16 @@ The input list. True if all of the elements satisfy the predicate. + + + + let isEven a = a % 2 = 0 + + [2; 42] |> List.forall isEven // evaluates to true + + [1; 2] |> List.forall isEven // evaluates to false + + Applies a function to corresponding elements of two collections, threading an accumulator argument @@ -2466,6 +5489,38 @@ The initial state. The final state value. + + + Count the positives, negatives and accumulate some text from back to front: + type Count = + { Positive: int + Negative: int + Text: string } + + let inputs1 = [ -1; -2; -3 ] + let inputs2 = [ 3; 2; 1 ] + let initialState = {Positive = 0; Negative = 0; Text = ""} + + (inputs1, inputs2, initialState) |||> List.foldBack2 (fun a b acc -> + let text = acc.Text + "(" + string a + "," + string b + ") " + if a + b >= 0 then + { acc with + Positive = acc.Positive + 1 + Text = text } + else + { acc with + Negative = acc.Negative + 1 + Text = text } + ) + + Evaluates to + + { Positive = 2 + Negative = 1 + Text = "(-3,1) (-2,2) (-1,3) " } + + Note acc is a commonly used abbreviation for "accumulator". + Applies a function to each element of the collection, starting from the end, threading an accumulator argument @@ -2477,6 +5532,38 @@ The initial state. The state object after the folding function is applied to each element of the list. + + Making the sum of squares for the first 5 natural numbers + + ([1..5], 0) ||> List.foldBack (fun v acc -> acc + v * v) // evaluates 55 + + Note acc is a commonly used abbreviation for "accumulator". + + + Shopping for fruits hungry, you tend to take more of each as the hunger grows + + type Fruit = Apple | Pear | Orange + + type BagItem = { fruit: Fruit; quantity: int } + + let takeMore fruit (previous: BagItem list) = + let toTakeThisTime = + match previous with + | bagItem :: otherBagItems -> bagItem.quantity + 1 + | [] -> 1 + { fruit = fruit; quantity = toTakeThisTime } :: previous + + let input = [ Apple; Pear; Orange ] + + (input, []) ||> List.foldBack takeMore + + Evaluates to + + [{ fruit = Apple; quantity = 3 } + { fruit = Pear; quantity = 2 } + { fruit = Orange; quantity = 1 }] + + Applies a function to corresponding elements of two collections, threading an accumulator argument @@ -2490,6 +5577,22 @@ The second input list. The final state value. + + + Count the numer of times the coins match: + type CoinToss = Head | Tails + + let inputs1 = [Tails; Head; Tails] + let inputs2 = [Tails; Head; Head] + + (0, inputs1, inputs2) |||> List.fold2 (fun acc input1 input2 -> + match (input1, input2) with + | Head, Head -> acc + 1 + | Tails, Tails -> acc + 1 + | _ -> acc - 1) + + Evaluates to 1. Note acc is a commonly used abbreviation for "accumulator". + Applies a function to each element of the collection, threading an accumulator argument @@ -2499,11 +5602,42 @@ If the input function is f and the elements are i0...iN then computes f (... (f s i0) i1 ...) iN. - The function to update the state given the input elements. - The initial state. - The input list. + The function to update the state given the input elements. + The initial state. + The input list. + + The final state value. + + Making the sum of squares for the first 5 natural numbers + + (0, [1..5]) ||> List.fold (fun s v -> s + v * v) // evaluates 55 + + + + Shopping for fruits hungry, you tend to take more of each as the hunger grows + + type Fruit = Apple | Pear | Orange + + type BagItem = { fruit: Fruit; quantity: int } + + let takeMore (previous: BagItem list) fruit = + let toTakeThisTime = + match previous with + | bagItem :: otherBagItems -> bagItem.quantity + 1 + | [] -> 1 + { fruit = fruit; quantity = toTakeThisTime } :: previous - The final state value. + let inputs = [ Apple; Pear; Orange ] + + ([], inputs) ||> List.fold takeMore + + Evaluates to + + [{ fruit = Orange; quantity = 3 } + { fruit = Pear; quantity = 2 } + { fruit = Apple; quantity = 1 }] + + Returns a new collection containing only the elements of the collection @@ -2513,6 +5647,17 @@ The input list. A list containing only the elements that satisfy the predicate. + + + + let input = [1, "Luke"; 2, "Kirk"; 3, "Kenobi"; 4, "Spock"] + + let isComingFromStarTrek (x,_) = isEven x + + input |> List.filter isComingFromStarTrek + + Evaluates to [(2, "Kirk"); (4, "Spock")] + Returns the index of the last element in the list @@ -2526,6 +5671,19 @@ elements of the list. The index of the last element that satisfies the predicate. + + + + let isEven x = 0 = x % 2 + + let isGreaterThan x y = y > x + + let input = [1, "Luke"; 2, "Kirk"; 3, "Spock"; 4, "Kenobi"] + + input |> List.findIndexBack (fun (x,_) -> isEven x) // evaluates 3 + input |> List.findIndexBack (fun (x,_) -> x |> isGreaterThan 6) // raises an exception + + Returns the index of the first element in the list @@ -2539,6 +5697,19 @@ elements of the list. The index of the first element that satisfies the predicate. + + + + let isEven x = 0 = x % 2 + + let isGreaterThan x y = y > x + + let input = [1, "Luke"; 2, "Kirk"; 3, "Spock"; 4, "Kenobi"] + + input |> List.findIndex (fun (x,_) -> isEven x) // evaluates 1 + input |> List.findIndex (fun (x,_) -> x |> isGreaterThan 6) // raises an exception + + Returns the last element for which the given function returns True. @@ -2551,6 +5722,19 @@ all the elements of the list. The last element that satisfies the predicate. + + + + let isEven x = 0 = x % 2 + + let isGreaterThan x y = y > x + + let input = [1, "Luke"; 2, "Kirk"; 3, "Spock"; 4, "Kenobi"] + + input |> List.findBack (fun (x,_) -> isEven x) // evaluates (4, "Kenobi") + input |> List.findBack (fun (x,_) -> x |> isGreaterThan 6) // raises an exception + + Returns the first element for which the given function returns True. @@ -2563,6 +5747,19 @@ all the elements of the list. The first element that satisfies the predicate. + + + + let isEven x = 0 = x % 2 + + let isGreaterThan x y = y > x + + let input = [1, "Luke"; 2, "Kirk"; 3, "Spock"; 4, "Kenobi"] + + input |> List.find (fun (x,_) -> isEven x) // evaluates (2, "Kirk") + input |> List.find (fun (x,_) -> x |> isGreaterThan 6) // raises an exception + + Tests if any pair of corresponding elements of the lists satisfies the given predicate. @@ -2580,6 +5777,18 @@ Thrown when the input lists differ in length. True if any pair of elements satisfy the predicate. + + Check if the sum of pairs (from 2 different lists) have at least one even number + + let anEvenSum a b = 0 = (a + b) % 2 + + ([1..4], [2..5]) + ||> List.exists2 anEvenSum // evaluates false + + ([1..4], [2;4;5;6]) + ||> List.exists2 anEvenSum // evaluates true + + Tests if any element of the list satisfies the given predicate. @@ -2591,6 +5800,16 @@ The input list. True if any element satisfies the predicate. + + + + let input = [1, "Kirk"; 2, "Spock"; 3, "Kenobi"] + + input |> List.exists (fun x -> x = (3, "Kenobi")) // evaluates true + + input |> List.exists (fun (n, name) -> n > 5) // evaluates false + + Returns the only element of the list or None if it is empty or contains more than one element. @@ -2598,6 +5817,14 @@ The input list. The only element of the list or None. + + + + [1] |> List.tryExactlyOne // evaluates Some 1 + [1;2] |> List.tryExactlyOne // evaluates None + ([] : int list) |> List.tryExactlyOne // evaluates None + + Returns the only element of the list. @@ -2607,6 +5834,28 @@ The only element of the list. Thrown when the input does not have precisely one element. + + + + ["the chosen one"] |> List.exactlyOne // evaluates "the chosen one" + + + + + + let input : string list = [] + + input |> List.exactlyOne + + Will throw the exception: System.ArgumentException: The input sequence was empty + + + + + [1..5] |> List.exactlyOne + + Will throw the exception: System.ArgumentException: The input sequence contains more than one element + Returns a new list with the distinct elements of the input list which do not appear in the itemsToExclude sequence, @@ -2619,6 +5868,27 @@ A list that contains the distinct elements of list that do not appear in itemsToExclude. Thrown when itemsToExclude is null. + + + + let input = [1, "Kirk"; 2, "Spock"; 3, "Kenobi"] + + input |> List.except [3, "Kenobi"] + + Evaluates to [(1, "Kirk"); (2, "Spock")]. + + + + + [0..10] |> List.except [1..5] // evaluates [0; 6; 7; 8; 9; 10] + + + + + + [1..5] |> List.except [0..10] // evaluates [] + + Returns an empty list of the given type. @@ -2632,6 +5902,20 @@ The list split into chunks. Thrown when count is not positive. + + + + [1..10] |> List.splitInto 2 + + Evaluates to [[1; 2; 3; 4; 5]; [6; 7; 8; 9; 10]]. + + + + + [1..10] |> List.splitInto 4 + + Evaluates to [[1; 2; 3]; [4; 5; 6]; [7; 8]; [9; 10]]. + Applies a key-generating function to each element of a list and returns a list yielding unique @@ -2642,6 +5926,15 @@ The input list. The result list. + + Counting the number of occurrences of chars + + let input = ['H'; 'a'; 'p'; 'p'; 'y'] + + input |> List.countBy id + + Evaluates [('H', 1); ('a', 1); ('p', 2); ('y', 1)] + Returns a list that contains no duplicate entries according to the @@ -2652,6 +5945,16 @@ The input list. The result list. + + + + let isEven x = 0 = x % 2 + + let input = [6;1;2;3;1;4;5;5] + + input |> List.distinctBy isEven // evaluates [6; 1] + + Returns a list that contains no duplicate entries according to generic hash and @@ -2661,6 +5964,15 @@ The input list. The result list. + + + + let input = [6;1;2;3;1;4;5;5] + + input |> List.distinct + + Evaluates to [6; 1; 2; 3; 4; 5]. + Tests if the list contains the specified element. @@ -2669,6 +5981,38 @@ The input list. True if the input list contains the specified element; false otherwise. + + + + [1..9] |> List.contains 0 + + Evaluates to false. + + + + + [1..9] |> List.contains 3 + + Evaluates to true. + + + + + let input = [1, "SpongeBob"; 2, "Patrick"; 3, "Squidward"; 4, "Mr. Krabs"] + + input |> List.contains (2, "Patrick") + + Evaluates to true. + + + + + let input = [1, "SpongeBob"; 2, "Patrick"; 3, "Squidward"; 4, "Mr. Krabs"] + + input |> List.contains (22, "Patrick") + + Evaluates to false. + Returns a new list that contains the elements of each the lists in order. @@ -2676,6 +6020,15 @@ The input sequence of lists. The resulting concatenated list. + + + + let input = [ [1;2] + [3;4;5] + [6;7;8;9] ] + input |> List.concat // evaluates [1; 2; 3; 4; 5; 6; 7; 8; 9] + + Compares two lists using the given comparison function, element by element. @@ -2684,12 +6037,77 @@ If it evaluates to a non-zero value iteration is stopped and that value is returned. The first input list. The second input list. - + Returns the first non-zero result from the comparison function. If the first list has a larger element, the return value is always positive. If the second list has a larger element, the return value is always negative. When the elements are equal in the two lists, 1 is returned if the first list is longer, 0 is returned if they are equal in length, and -1 is returned when the second list is longer. + + + + let closerToNextDozen a b = + (a % 12).CompareTo(b % 12) + + let input1 = [1; 10] + let input2 = [1; 10] + + (input1, input2) ||> List.compareWith closerToNextDozen + + Evaluates to 0 + + + + + let closerToNextDozen a b = + (a % 12).CompareTo(b % 12) + + let input1 = [1; 5] + let input2 = [1; 8] + + (input1, input2) ||> List.compareWith closerToNextDozen + + Evaluates to -1 + + + + + let closerToNextDozen a b = + (a % 12).CompareTo(b % 12) + + let input1 = [1; 11] + let input2 = [1; 13] + + (input1, input2) ||> List.compareWith closerToNextDozen + + Evaluates to 1 + + + + + let closerToNextDozen a b = + (a % 12).CompareTo(b % 12) + + let input1 = [1; 2] + let input2 = [1] + + (input1, input2) ||> List.compareWith closerToNextDozen + + Evaluates to 1 + + + + + let closerToNextDozen a b = + (a % 12).CompareTo(b % 12) + + let input1 = [1] + let input2 = [1; 2] + + (input1, input2) ||> List.compareWith closerToNextDozen + + Evaluates to -1 + For each element of the list, applies the given function. Concatenates all the results and return the combined list. @@ -2698,6 +6116,13 @@ The input list. The concatenation of the transformed sublists. + + For each positive number in the array we are generating all the previous positive numbers + + [1..4] |> List.collect (fun x -> [1..x]) + + The sample evaluates to [1; 1; 2; 1; 2; 3; 1; 2; 3; 4] (added extra spaces for easy reading) + Divides the input list into chunks of size at most chunkSize. @@ -2708,6 +6133,25 @@ The list divided into chunks. Thrown when chunkSize is not positive. + + + + [1 .. 10 ] |> List.chunkBySize 3 // evaluates + + Evaluates to [[1; 2; 3]; [4; 5; 6]; [7; 8; 9]; [10]] . Please notice the last chunk. + + + [1 .. 5 ] |> List.chunkBySize 10 + + Evaluates to [[1; 2; 3; 4; 5]] + + + let input : string list = [] + + input |> List.chunkBySize 10 + + Evaluates to []. The result has type string list list. + Applies the given function to each element of the list. Returns @@ -2718,6 +6162,57 @@ The input list. The list comprising the values selected from the chooser function. + + + + type Happiness = + | AlwaysHappy + | MostOfTheTimeGrumpy + + type People = + { + Name: string + Happiness: Happiness + } + + let takeJustHappyPersons person = + match person.Happiness with + | AlwaysHappy -> Some person.Name + | MostOfTheTimeGrumpy -> None + + let candidatesForTheTrip = + [ { Name = "SpongeBob"; Happiness = AlwaysHappy } + { Name = "Patrick"; Happiness = AlwaysHappy } + { Name = "Squidward"; Happiness = MostOfTheTimeGrumpy } ] + + candidatesForTheTrip |> List.choose takeJustHappyPersons + + The sample evaluates to [ "SpongeBob"; "Patrick" ] + + + + Using the identity function id (is defined like fun x -> x): + + + let input1 = [ Some 1; None; Some 3; None ] + + input1 |> List.choose id // evaluates [1; 3] + + + + + let input2: int option list = [] + + input2 |> List.choose id // evaluates to the empty list + + + + + let input3: string option list = [None; None] + + input3 |> List.choose id // evaluates to the empty list + + Returns the average of the elements generated by applying the function to each element of the list. @@ -2729,6 +6224,31 @@ Thrown when the list is empty. The resulting average. + + Average the age of persons by extracting the age from records + + type People = + { + Name: string + Age: int + } + + let getAgeAsFloat person = float person.age + + let people = + [ { Name = "Kirk"; Age = 26 } + { Name = "Spock"; Age = 90 } + { Name = "McCoy"; Age = 37 } ] + + people |> List.averageBy getAgeAsFloat // evaluates 51.0 + + + + Average a list of integer numbers by converting to float + + [1 .. 9] |> List.averageBy float // evaluates 5.0 + + Returns the average of the elements in the list. @@ -2739,6 +6259,20 @@ Thrown when the list is empty. The resulting average. + + + + [1.0 .. 9.0] |> List.average // evaluates 5.0 + + + + + + [1 .. 9] |> List.average + + The sample does not compile because The type 'int' does not support the operator 'DivideByInt' + (see averageBy examples for a solution) + Returns a new list that contains the elements of the first list @@ -2748,6 +6282,14 @@ The second input list. The resulting list. + + + + List.append [1..3] [4..7] // evaluates [1; 2; 3; 4; 5; 6; 7] + + [4..7] |> List.append [1..3] // evaluates [1; 2; 3; 4; 5; 6; 7] + + Returns a new list that contains all pairings of elements from the first and second lists. @@ -2756,6 +6298,19 @@ The second input list. The resulting list of pairs. + + + + let people = ["Kirk"; "Spock"; "McCoy"] + let numbers = [1;2] + + people |> List.allPairs numbers + + The sample evaluates to + + [(1, "Kirk"); (1, "Spock"); (1, "McCoy"); (2, "Kirk"); (2, "Spock"); (2, "McCoy")] + + Contains operations for working with values of type . @@ -2764,6 +6319,105 @@ F# Collection Types in the F# Language Guide. + + Return a new array with new items inserted before the given index. + + The index where the items should be inserted. + The values to insert. + The input array. + + The result array. + + Thrown when index is below 0 or greater than source.Length. + + + + let inputs = [| 0; 1; 2 |] + + inputs |> Array.insertManyAt 1 [8; 9] + + Evaluates to [| 0; 8; 9; 1; 2 |]. + + + + Return a new array with a new item inserted before the given index. + + The index where the item should be inserted. + The value to insert. + The input array. + + The result array. + + Thrown when index is below 0 or greater than source.Length. + + + + let inputs = [| 0; 1; 2 |] + + inputs |> Array.insertAt 1 9 + + Evaluates to [| 0; 9; 1; 2 |]. + + + + Return a new array with the item at a given index set to the new value. + + The index of the item to be replaced. + The new value. + The input array. + + The result array. + + Thrown when index is outside 0..source.Length - 1 + + + + let inputs = [| 0; 1; 2 |] + + inputs |> Array.updateAt 1 9 + + Evaluates to [| 0; 9; 2 |]. + + + + Return a new array with the number of items starting at a given index removed. + + The index of the item to be removed. + The number of items to remove. + The input array. + + The result array. + + Thrown when index is outside 0..source.Length - count + + + + let inputs = [| 0; 1; 2; 3 |] + + inputs |> Array.removeManyAt 1 2 + + Evaluates to [| 0; 3 |]. + + + + Return a new array with the item at a given index removed. + + The index of the item to be removed. + The input array. + + The result array. + + Thrown when index is outside 0..source.Length - 1 + + + + let inputs = [| 0; 1; 2 |] + + inputs |> Array.removeAt 1 + + Evaluates to [| 0; 2 |]. + + Combines three arrays into an array of pairs. The three arrays must have equal lengths, otherwise an ArgumentException is raised. @@ -2776,6 +6430,17 @@ Thrown when the input arrays differ in length. The array of tupled elements. + + + + let numbers = [| 1; 2 |] + let names = [| "one"; "two" |] + let roman = [| "I"; "II" |] + + Array.zip3 numbers names roman + + Evaluates to [|(1, "one", "I"); (2, "two", "II")|]. + Combines the two arrays into an array of pairs. The two arrays must have equal lengths, otherwise an ArgumentException is @@ -2788,6 +6453,16 @@ Thrown when the input arrays differ in length. The array of tupled elements. + + + + let numbers = [|1; 2|] + let names = [|"one"; "two"|] + + Array.zip numbers names + + Evaluates to [| (1, "one"); (2, "two") |]. + Returns an array of sliding windows containing elements drawn from the input @@ -2800,6 +6475,15 @@ Thrown when the input array is null. Thrown when windowSize is not positive. + + + + let inputs = [| 1; 2; 3; 4; 5 |] + + inputs |> Array.windowed 3 + + Evaluates to [|[|1; 2; 3|]; [|2; 3; 4|]; [|3; 4; 5|]|] + Returns a new array containing only the elements of the array @@ -2811,6 +6495,17 @@ An array containing the elements for which the given predicate returns true. Thrown when the input array is null. + + This is identical to Array.filter. + + Select only the even numbers: + + let inputs = [| 1; 2; 3; 4 |] + + inputs |> Array.where (fun elm -> elm % 2 = 0) + + Evaluates to [| 2; 4 |] + Splits an array of triples into three arrays. @@ -2820,6 +6515,15 @@ The tuple of three arrays. Thrown when the input array is null. + + + + let inputs = [| (1, "one", "I"); (2, "two", "II") |] + + let numbers, names, roman = inputs |> Array.unzip3 + + Evaluates numbers to [|1; 2|], names to [|"one"; "two"|] and roman to [|"I"; "II"|]. + Splits an array of pairs into two arrays. @@ -2829,9 +6533,19 @@ The two arrays. Thrown when the input array is null. + + + + let inputs = [| (1, "one"); (2, "two") |] + + let numbers, names = inputs |> Array.unzip + + Evaluates numbers to [|1; 2|] and names to [|"one"; "two"|]. + Returns an array that contains the elements generated by the given computation. + The generator is repeatedly called to build the list until it returns `None`. The given initial state argument is passed to the element generator. A function that takes in the current state and returns an option tuple of the next @@ -2839,6 +6553,13 @@ The initial state value. The result array. + + + + 1 |> Array.unfold (fun state -> if state > 100 then None else Some (state, state * 2)) + + Evaluates to [| 1; 2; 4; 8; 16; 32; 64 |] + Returns the index of the last element in the array @@ -2850,6 +6571,24 @@ Thrown when the input array is null. The index of the last element that satisfies the predicate, or None. + + Try to find the index of the first even number from the back: + + let inputs = [| 1; 2; 3; 4; 5 |] + + inputs |> Array.tryFindIndexBack (fun elm -> elm % 2 = 0) + + Evaluates to Some 3 + + + Try to find the index of the first even number from the back: + + let inputs = [| 1; 3; 5; 7 |] + + inputs |> Array.tryFindIndexBack (fun elm -> elm % 2 = 0) + + Evaluates to None + Tries to find the nth element in the array. @@ -2861,6 +6600,24 @@ The nth element of the array or None. Thrown when the input array is null. + + + + let inputs = [| "a"; "b"; "c" |] + + inputs |> Array.tryItem 1 + + Evaluates to Some "b". + + + + + let inputs = [| "a"; "b"; "c" |] + + inputs |> Array.tryItem 4 + + Evaluates to None. + Returns the index of the first element in the array @@ -2872,6 +6629,24 @@ Thrown when the input array is null. The index of the first element that satisfies the predicate, or None. + + Try to find the index of the first even number: + + let inputs = [| 1; 2; 3; 4; 5 |] + + inputs |> Array.tryFindIndex (fun elm -> elm % 2 = 0) + + Evaluates to Some 1 + + + Try to find the index of the first even number: + + let inputs = [| 1; 3; 5; 7 |] + + inputs |> Array.tryFindIndex (fun elm -> elm % 2 = 0) + + Evaluates to None + Returns the last element for which the given function returns True. @@ -2883,6 +6658,24 @@ Thrown when the input array is null. The last element that satisfies the predicate, or None. + + Try to find the first even number from the back: + + let inputs = [| 1; 2; 3; 4; 5 |] + + inputs |> Array.tryFindBack (fun elm -> elm % 2 = 0) + + Evaluates to Some 4 + + + Try to find the first even number from the back: + + let inputs = [| 1; 5; 3 |] + + inputs |> Array.tryFindBack (fun elm -> elm % 2 = 0) + + Evaluates to None + Returns the first element for which the given function returns True. @@ -2894,6 +6687,24 @@ The first element that satisfies the predicate, or None. Thrown when the input array is null. + + Try to find the first even number: + + let inputs = [| 1; 2; 3 |] + + inputs |> Array.tryFind (fun elm -> elm % 2 = 0) + + Evaluates to Some 2 + + + Try to find the first even number: + + let inputs = [| 1; 5; 3 |] + + inputs |> Array.tryFind (fun elm -> elm % 2 = 0) + + Evaluates to None + Returns at most N elements in a new array. @@ -2904,6 +6715,33 @@ The result array. Thrown when the input array is null. + + + + let inputs = [| "a"; "b"; "c"; "d" |] + + inputs |> Array.truncate 2 + + Evaluates to [| "a"; "b" |] + + + + + let inputs = [| "a"; "b"; "c"; "d" |] + + inputs |> Array.truncate 6 + + Evaluates to [| "a"; "b"; "c"; "d" |] + + + + + let inputs = [| "a"; "b"; "c"; "d" |] + + inputs |> Array.truncate 0 + + Evaluates to [| |]. + Returns the transpose of the given sequence of arrays. @@ -2914,6 +6752,17 @@ Thrown when the input sequence is null. Thrown when the input arrays differ in length. + + + + let inputs = + [| [| 10; 20; 30 |] + [| 11; 21; 31 |] |] + + inputs |> Array.transpose + + Evaluates to [|[|10; 11|]; [|20; 21|]; [|30; 31|]|]. + Views the given array as a sequence. @@ -2923,6 +6772,15 @@ The sequence of array elements. Thrown when the input array is null. + + + + let inputs = [| 1; 2; 5 |] + + inputs |> Array.toSeq + + Evaluates to seq { 1; 2; 5 }. + Builds a list from the given array. @@ -2932,6 +6790,15 @@ The list of array elements. Thrown when the input array is null. + + + + let inputs = [| 1; 2; 5 |] + + inputs |> Array.toList + + Evaluates to [ 1; 2; 5 ]. + Returns a new array containing the elements of the original except the first element. @@ -2942,6 +6809,16 @@ Thrown when the input array is null. A new array containing the elements of the original except the first element. + + + + let inputs = [| "a"; "bb"; "ccc" |] + + inputs |> Array.tail + + Evaluates to [| "bb"; "ccc" |] + + Returns an array that contains all elements of the original array while the @@ -2953,6 +6830,16 @@ The result array. Thrown when the input array is null. + + + + let inputs = [| "a"; "bb"; "ccc"; "d" |] + + inputs |> Array.takeWhile (fun x -> x.Length < 3) + + Evaluates to [| "a"; "bb" |] + + Returns the first N elements of the array. @@ -2969,6 +6856,33 @@ Thrown when the input array is empty. Thrown when count exceeds the number of elements in the list. + + + + let inputs = [| "a"; "b"; "c"; "d" |] + + inputs |> Array.take 2 + + Evaluates to [| "a"; "b" |] + + + + + let inputs = [| "a"; "b"; "c"; "d" |] + + inputs |> Array.take 6 + + Throws InvalidOperationException. + + + + + let inputs = [| "a"; "b"; "c"; "d" |] + + inputs |> Array.take 0 + + Evaluates to [| |]. + Returns the sum of the results generated by applying the function to each element of the array. @@ -2979,6 +6893,15 @@ The resulting sum. Thrown when the input array is null. + + + + let input = [| "aa"; "bbb"; "cc" |] + + input |> Array.sumBy (fun s -> s.Length) + + Evaluates to 7. + Returns the sum of the elements in the array. @@ -2988,6 +6911,15 @@ The resulting sum. Thrown when the input array is null. + + + + let input = [| 1; 5; 3; 2 |] + + input |> Array.sum + + Evaluates to 11. + Sorts the elements of an array, in descending order, using the given projection for the keys and returning a new array. @@ -3000,6 +6932,15 @@ The input array. The sorted array. + + + + let input = [| "a"; "bbb"; "cccc"; "dd" |] + + input |> Array.sortByDescending (fun s -> s.Length) + + Evaluates to [|"cccc"; "bbb"; "dd"; "a"|]. + Sorts the elements of an array, in descending order, returning a new array. Elements are compared using . @@ -3010,6 +6951,15 @@ The input array. The sorted array. + + + + let input = [| 8; 4; 3; 1; 6; 1 |] + + input |> Array.sortDescending + + Evaluates to [| 8; 6; 4; 3; 1; 1 |]. + Splits an array into two arrays, at the given index. @@ -3022,6 +6972,15 @@ Thrown when the input array is null. Thrown when split index exceeds the number of elements in the array. + + + + let input = [| 8; 4; 3; 1; 6; 1 |] + + let front, back = input |> Array.splitAt 3 + + Evaluates front to [|8; 4; 3|] and back to [|1; 6; 1|]. + Sorts the elements of an array by mutating the array in-place, using the given comparison function. @@ -3030,6 +6989,15 @@ The input array. Thrown when the input array is null. + + + + let array = [| 8; 4; 3; 1; 6; 1 |] + + Array.sortInPlace array + + After evaluation array contains [| 1; 1; 3; 4; 6; 8 |]. + Sorts the elements of an array by mutating the array in-place, using the given comparison function as the order. @@ -3038,6 +7006,20 @@ The input array. Thrown when the input array is null. + + The following sorts entries using a comparison function that compares string lengths then index numbers: + + let compareEntries (n1: int, s1: string) (n2: int, s2: string) = + let c = compare s1.Length s2.Length + if c <> 0 then c else + compare n1 n2 + + let array = [| (0,"aa"); (1,"bbb"); (2,"cc"); (3,"dd") |] + + array |> Array.sortInPlaceWith compareEntries + + After evaluation array contains [|(0, "aa"); (2, "cc"); (3, "dd"); (1, "bbb")|]. + Sorts the elements of an array by mutating the array in-place, using the given projection for the keys. @@ -3050,6 +7032,15 @@ The input array. Thrown when the input array is null. + + + + let array = [| "a"; "bbb"; "cccc"; "dd" |] + + array |> Array.sortInPlaceBy (fun s -> s.Length) + + After evaluation array contains [|"a"; "dd"; "bbb"; "cccc"|]. + Sorts the elements of an array, using the given comparison function as the order, returning a new array. @@ -3063,6 +7054,20 @@ The sorted array. Thrown when the input array is null. + + Sort an array of pairs using a comparison function that compares string lengths then index numbers: + + let compareEntries (n1: int, s1: string) (n2: int, s2: string) = + let c = compare s1.Length s2.Length + if c <> 0 then c else + compare n1 n2 + + let input = [| (0,"aa"); (1,"bbb"); (2,"cc"); (3,"dd") |] + + input |> Array.sortWith compareEntries + + Evaluates to [|(0, "aa"); (2, "cc"); (3, "dd"); (1, "bbb")|]. + Sorts the elements of an array, using the given projection for the keys and returning a new array. @@ -3077,6 +7082,15 @@ The sorted array. Thrown when the input array is null. + + + + let input = [| "a"; "bbb"; "cccc"; "dd" |] + + input |> Array.sortBy (fun s -> s.Length) + + Evaluates to [|"a"; "dd"; "bbb"; "cccc"|]. + Sorts the elements of an array, returning a new array. Elements are compared using . @@ -3089,6 +7103,15 @@ The sorted array. Thrown when the input array is null. + + + + let input = [| 8; 4; 3; 1; 6; 1 |] + + Array.sort input + + Evaluates to [| 1; 1 3; 4; 6; 8 |]. + Builds a new array that contains the given subrange specified by @@ -3103,6 +7126,24 @@ Thrown when the input array is null. Thrown when either startIndex or count is negative, or when there aren't enough elements in the input array. + + + Slicing syntax is generally preferred, e.g. + + let input = [| 0; 1; 2; 3; 4; 5 |] + + input.[2..4] + + + + + + let input = [| 0; 1; 2; 3; 4; 5 |] + + Array.sub input 2 3 + + Evaluates to [| 2; 3; 4 |]. + Bypasses elements in an array while the given predicate returns True, and then returns @@ -3114,18 +7155,55 @@ The created sub array. Thrown when the input array is null. + + + + let inputs = [| "a"; "bbb"; "cc"; "d" |] + + inputs |> Array.skipWhile (fun x -> x.Length < 3) + + Evaluates to [|"bbb"; "cc"; "d"|] + + Builds a new array that contains the elements of the given array, excluding the first N elements. - The number of elements to skip. + The number of elements to skip. If negative the full array will be returned as a copy. The input array. A copy of the input array, after removing the first N elements. Thrown when the input array is null. - Thrown when count is negative or exceeds the number of + Thrown when count exceeds the number of elements in the array. + + + + let inputs = [| "a"; "b"; "c"; "d" |] + + inputs |> Array.skip 2 + + Evaluates to [| "c"; "d" |] + + + + + let inputs = [| "a"; "b"; "c"; "d" |] + + inputs |> Array.skip 5 + + Throws ArgumentException. + + + + + let inputs = [| "a"; "b"; "c"; "d" |] + + inputs |> Array.skip -1 + + Evaluates to [| "a"; "b"; "c"; "d" |]. + Sets an element of an array. @@ -3136,6 +7214,24 @@ Thrown when the input array is null. Thrown when the index is negative or the input array does not contain enough elements. + + + + let inputs = [| "a"; "b"; "c" |] + + Array.set inputs 1 "B" + + After evaluation inputs contains [| "a"; "B"; "c" |] + + + + + let inputs = [| "a"; "b"; "c" |] + + Array.set inputs 4 "d" + + Throws IndexOutOfRangeException + Returns an array that contains one item only. @@ -3143,6 +7239,13 @@ The input item. The result array of one item. + + + + Array.singleton 7 + + Evaluates to [| 7 |]. + Like foldBack, but return both the intermediary and final results. @@ -3154,6 +7257,23 @@ The array of state values. Thrown when the input array is null. + + Apply a list charges from back to front, and collect the running balances as each is applied: + + type Charge = + | In of int + | Out of int + + let inputs = [| In 1; Out 2; In 3 |] + + (inputs, 0) ||> Array.scanBack (fun charge acc -> + match charge with + | In i -> acc + i + | Out o -> acc - o) + + Evaluates to [|2; 1; 3; 0|] by processing each input from back to front. Note 0 is the intial + state, 3 the next state, 1 the next state, and 2 the final state. + Like fold, but return the intermediary and final results. @@ -3165,6 +7285,23 @@ The array of state values. Thrown when the input array is null. + + Apply a list charges and collect the running balances as each is applied: + + type Charge = + | In of int + | Out of int + + let inputs = [| In 1; Out 2; In 3 |] + + (0, inputs) ||> Array.scan (fun acc charge -> + match charge with + | In i -> acc + i + | Out o -> acc - o) + + Evaluates to [|0; 1; -1; 2|]. Note 0 is the intial + state, 1 the next state, -1 the next state, and 2 the final state. + Returns a new array with the elements in reverse order. @@ -3174,6 +7311,13 @@ The reversed array. Thrown when the input array is null. + + + + Array.rev [| 0; 1; 2 |] + + Evaluates to [| 2; 1; 0 |]. + Creates an array by replicating the given initial value. @@ -3184,6 +7328,13 @@ The generated array. Thrown when count is negative. + + + + Array.replicate 3 "a" + + Evaluates to [| "a"; "a"; "a" |]. + Applies a function to each element of the array, starting from the end, threading an accumulator argument @@ -3198,6 +7349,15 @@ Thrown when the input array is empty. The final result of the reductions. + + + + let inputs = [| 1; 3; 4; 2 |] + + inputs |> Array.reduceBack (fun a b -> a + b * 10) + + Evaluates to 2431, by computing 1 + (3 + (4 + 2 * 10) * 10) * 10 + Applies a function to each element of the array, threading an accumulator argument @@ -3212,6 +7372,15 @@ Thrown when the input array is empty. The final result of the reductions. + + + + let inputs = [| 1; 3; 4; 2 |] + + inputs |> Array.reduce (fun a b -> a * 10 + b) + + Evaluates to 1342, by computing ((1 * 10 + 3) * 10 + 4) * 10 + 2 + Returns an array with all elements permuted according to the @@ -3224,6 +7393,15 @@ Thrown when the input array is null. Thrown when indexMap does not produce a valid permutation. + + + + let inputs = [| 1; 2; 3; 4 |] + + inputs |> Array.permute (fun x -> (x + 1) % 4) + + Evaluates to [|4; 1; 2; 3|]. + Splits the collection into two collections, containing the @@ -3237,6 +7415,15 @@ and the second containing those evaluated to false. Thrown when the input array is null. + + + + let inputs = [| 1; 2; 3; 4 |] + + inputs |> Array.partition (fun x -> x % 2 = 0) + + Evaluates to ([|2; 4|], [|1; 3|]). + Returns an array of each element in the input array and its predecessor, with the @@ -3247,6 +7434,15 @@ The result array. Thrown when the input sequence is null. + + + + let inputs = [| 1; 2; 3; 4 |] + + inputs |> Array.pairwise + + Evaluates to [|(1, 2); (2, 3); (3, 4)|]. + Builds a new array from the given enumerable object. @@ -3256,6 +7452,15 @@ The array of elements from the sequence. Thrown when the input sequence is null. + + + + let inputs = seq { 1; 2; 5 } + + inputs |> Array.ofSeq + + Evaluates to [| 1; 2; 5 |]. + Builds an array from the given list. @@ -3263,6 +7468,15 @@ The input list. The array of elements from the list. + + + + let inputs = [ 1; 2; 5 ] + + inputs |> Array.ofList + + Evaluates to [| 1; 2; 5 |]. + Returns the lowest of all elements of the array, compared via Operators.min on the function result. @@ -3276,6 +7490,24 @@ Thrown when the input array is empty. The minimum element. + + + + let inputs = [| "aaa"; "b"; "cccc" |] + + inputs |> Array.minBy (fun s -> s.Length) + + Evaluates to "b" + + + + + let inputs: string[]= [| |] + + inputs |> Array.minBy (fun s -> s.Length) + + Throws System.ArgumentException. + Returns the lowest of all elements of the array, compared via Operators.min. @@ -3288,6 +7520,24 @@ Thrown when the input array is empty. The minimum element. + + + + let inputs = [| 10; 12; 11 |] + + inputs |> Array.min + + Evaluates to 10 + + + + + let inputs: int[]= [| |] + + inputs |> Array.min + + Throws System.ArgumentException. + Returns the greatest of all elements of the array, compared via Operators.max on the function result. @@ -3301,6 +7551,24 @@ Thrown when the input array is empty. The maximum element. + + + + let inputs = [| "aaa"; "b"; "cccc" |] + + inputs |> Array.maxBy (fun s -> s.Length) + + Evaluates to "cccc" + + + + + let inputs: string[]= [| |] + + inputs |> Array.maxBy (fun s -> s.Length) + + Throws System.ArgumentException. + Returns the greatest of all elements of the array, compared via Operators.max on the function result. @@ -3313,11 +7581,29 @@ Thrown when the input array is empty. The maximum element. + + + + let inputs = [| 10; 12; 11 |] + + inputs |> Array.max + + Evaluates to 12 + + + + + let inputs: int[]= [| |] + + inputs |> Array.max + + Throws System.ArgumentException. + Builds 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. + function indicates the index of element being transformed, starting at zero. The function to transform elements and their indices. The input array. @@ -3325,6 +7611,15 @@ The array of transformed elements. Thrown when the input array is null. + + + + let inputs = [| 10; 10; 10 |] + + inputs |> Array.mapi (fun i x -> i + x) + + Evaluates to [| 10; 11; 12 |] + Builds a new collection whose elements are the results of applying the given function @@ -3340,6 +7635,16 @@ Thrown when the input arrays differ in length. The array of transformed elements. + + + + let inputs1 = [| "a"; "bad"; "good" |] + let inputs2 = [| 0; 2; 1 |] + + (inputs1, inputs2) ||> Array.mapi2 (fun i x y -> i, x[y]) + + Evaluates to [|(0, 'a'); (1, 'd'); (2, 'o')|] + Builds a new collection whose elements are the results of applying the given function @@ -3356,6 +7661,18 @@ Thrown when any of the input arrays is null. The array of transformed elements. + + + + let inputs1 = [| "a"; "t"; "ti" |] + let inputs2 = [| "l"; "h"; "m" |] + let inputs3 = [| "l"; "e"; "e" |] + + (inputs1, inputs2, inputs3) |||> Array.map3 (fun x y z -> x + y + z) + + Evaluates to [| "all"; "the"; "time" |] + + Combines map and foldBack. Builds a new array whose elements are the results of applying the given function @@ -3368,6 +7685,23 @@ Thrown when the input array is null. The array of transformed elements, and the final accumulated value. + + Accumulate the charges from back to front, and double them as well + + type Charge = + | In of int + | Out of int + + let inputs = [| In 1; Out 2; In 3 |] + + let newCharges, balance = + (inputs, 0) ||> Array.mapFoldBack (fun charge acc -> + match charge with + | In i -> In (i*2), acc + i + | Out o -> Out (o*2), acc - o) + + Evaluates newCharges to [|In 2; Out 4; In 6|] and balance to 2. + Combines map and fold. Builds a new array whose elements are the results of applying the given function @@ -3380,6 +7714,23 @@ Thrown when the input array is null. The array of transformed elements, and the final accumulated value. + + + Accumulate the charges, and double them as well + type Charge = + | In of int + | Out of int + + let inputs = [| In 1; Out 2; In 3 |] + + let newCharges, balance = + (0, inputs) ||> Array.mapFold (fun acc charge -> + match charge with + | In i -> In (i*2), acc + i + | Out o -> Out (o*2), acc - o) + + Evaluates newCharges to [|In 2; Out 4; In 6|] and balance to 2. + Builds a new collection whose elements are the results of applying the given function @@ -3395,6 +7746,16 @@ Thrown when either of the input arrays is null. The array of transformed elements. + + + + let inputs1 = [| "a"; "bad"; "good" |] + let inputs2 = [| 0; 2; 1 |] + + (inputs1, inputs2) ||> Array.map2 (fun x y -> x[y]) + + Evaluates to [| 'a'; 'd'; 'o' |] + Builds a new array whose elements are the results of applying the given function @@ -3406,6 +7767,15 @@ The array of transformed elements. Thrown when the input array is null. + + + + let inputs = [| "a"; "bbb"; "cc" |] + + inputs |> Array.map (fun x -> x.Length) + + Evaluates to [| 1; 3; 2 |] + Returns the last element of the array. @@ -3416,6 +7786,20 @@ The last element of the array or None. Thrown when the input sequence is null. + + + + [| "pear"; "banana" |] |> Array.tryLast + + Evaluates to Some "banana" + + + + + [| |] |> Array.tryLast + + Evaluates to None + Returns the length of an array. You can also use property arr.Length. @@ -3424,7 +7808,18 @@ The length of the array. + The notation array.Length is preferred. + Thrown when the input array is null. + + + + let inputs = [| "a"; "b"; "c" |] + + inputs |> Array.length + + Evaluates to 3 + Gets an element from an array. @@ -3434,8 +7829,28 @@ The value of the array at the given index. + Normally the syntax array[index] is preferred. + Thrown when the input array is null. Thrown when the index is negative or the input array does not contain enough elements. + + + + let inputs = [| "a"; "b"; "c" |] + + inputs |> Array.item 1 + + Evaluates to "b" + + + + + let inputs = [| "a"; "b"; "c" |] + + inputs |> Array.item 4 + + Throws ArgumentException + Returns the last element of the array. @@ -3446,6 +7861,20 @@ Thrown when the input array is null. Thrown when the input does not have any elements. + + + + [| "pear"; "banana" |] |> Array.last + + Evaluates to banana + + + + + [| |] |> Array.last + + Throws ArgumentException + Applies the given function to pair of elements drawn from matching indices in two arrays, @@ -3458,6 +7887,22 @@ Thrown when either of the input arrays is null. Thrown when the input arrays differ in length. + + + + let inputs1 = [| "a"; "b"; "c" |] + let inputs2 = [| "banana"; "pear"; "apple" |] + + (inputs1, inputs2) ||> Array.iteri2 (fun i s1 s2 -> printfn "Index {i}: {s1} - {s2}") + + Evaluates to unit and prints + + Index 0: a - banana + Index 1: b - pear + Index 2: c - apple + + in the console. + Applies the given function to each element of the array. The integer passed to the @@ -3467,6 +7912,21 @@ The input array. Thrown when the input array is null. + + + + let inputs = [| "a"; "b"; "c" |] + + inputs |> Array.iteri (fun i v -> printfn "{i}: {v}") + + Evaluates to unit and prints + + 0: a + 1: b + 2: c + + in the console. + Applies the given function to pair of elements drawn from matching indices in two arrays. The @@ -3479,6 +7939,22 @@ Thrown when either of the input arrays is null. Thrown when the input arrays differ in length. + + + + let inputs1 = [| "a"; "b"; "c" |] + let inputs2 = [| 1; 2; 3 |] + + (inputs1, inputs2) ||> Array.iter2 (printfn "%s: %i") + + Evaluates to unit and prints + + a: 1 + b: 2 + c: 3 + + in the console. + Applies the given function to each element of the array. @@ -3487,6 +7963,21 @@ The input array. Thrown when the input array is null. + + + + let inputs = [| "a"; "b"; "c" |] + + inputs |> Array.iter (printfn "%s") + + Evaluates to unit and prints + + a + b + c + + in the console. + Returns true if the given array is empty, otherwise false. @@ -3496,6 +7987,20 @@ True if the array is empty. Thrown when the input array is null. + + + + [| |] |> Array.isEmpty + + Evaluates to true + + + + + [| "pear"; "banana" |] |> Array.isEmpty + + Evaluates to false + Creates an array where the entries are initially the default value Unchecked.defaultof<'T>. @@ -3505,6 +8010,13 @@ The created array. Thrown when count is negative. + + + + let arr : int[] = Array.zeroCreate 4 + + Evaluates to [| 0; 0; 0; 0 |] + Creates an array given the dimension and a generator function to compute the elements. @@ -3515,6 +8027,20 @@ The created array. Thrown when count is negative. + + + + Array.init 4 (fun v -> v + 5) + + Evaluates to [| 5; 6; 7; 8 |] + + + + + Array.init -5 (fun v -> v + 5) + + Throws ArgumentException + Builds a new array whose elements are the corresponding elements of the input array @@ -3525,6 +8051,15 @@ The array of indexed elements. Thrown when the input array is null. + + + + let inputs = [| "a"; "b"; "c" |] + + inputs |> Array.indexed + + Evaluates to [| (0, "a"); (1, "b"); (2, "c") |] + Applies a key-generating function to each element of an array and yields an array of @@ -3537,6 +8072,15 @@ The result array. Thrown when the input array is null. + + + + let inputs = [| 1; 2; 3; 4; 5 |] + + inputs |> Array.groupBy (fun n -> n % 2) + + Evaluates to [| (1, [| 1; 3; 5 |]); (0, [| 2; 4 |]) |] + Returns the first element of the array. @@ -3547,6 +8091,22 @@ Thrown when the input array is null. Thrown when the input array is empty. + + + + let inputs = [| "banana"; "pear" |] + + inputs |> Array.head + + Evaluates to banana + + + + + [| |] |> Array.head + + Throws ArgumentException + Gets an element from an array. @@ -3554,10 +8114,30 @@ The input array. The input index. + Normally the syntax array[index] is preferred. + The value of the array at the given index. Thrown when the input array is null. Thrown when the index is negative or the input array does not contain enough elements. + + + + let inputs = [| "a"; "b"; "c" |] + + Array.get inputs 1 + + Evaluates to "b" + + + + + let inputs = [| "a"; "b"; "c" |] + + Array.get inputs 4 + + Throws IndexOutOfRangeException + Apply a function to pairs of elements drawn from the two collections, right-to-left, @@ -3574,6 +8154,37 @@ Thrown when the input arrays differ in length. The final state. + + + Count the positives, negatives and accumulate some text from back to front: + type Count = + { Positive: int + Negative: int + Text: string } + + let inputs1 = [| -1; -2; -3 |] + let inputs2 = [| 3; 2; 1 |] + let initialState = {Positive = 0; Negative = 0; Text = ""} + + (inputs1, inputs2, initialState) |||> Array.foldBack2 (fun a b acc -> + let text = acc.Text + "(" + string a + "," + string b + ") " + if a + b >= 0 then + { acc with + Positive = acc.Positive + 1 + Text = text } + else + { acc with + Negative = acc.Negative + 1 + Text = text } + ) + + Evaluates to + + { Positive = 2 + Negative = 1 + Text = "(-3,1) (-2,2) (-1,3) " } + + Applies a function to pairs of elements drawn from the two collections, @@ -3591,6 +8202,22 @@ Thrown when the input arrays differ in length. The final state. + + + + type CoinToss = Head | Tails + + let data1 = [| Tails; Head; Tails |] + let data2 = [| Tails; Head; Head |] + + (0, data1, data2) |||> Array.fold2 (fun acc a b -> + match (a, b) with + | Head, Head -> acc + 1 + | Tails, Tails -> acc + 1 + | _ -> acc - 1) + + Evaluates to 1 + Applies a function to each element of the array, starting from the end, threading an accumulator argument @@ -3604,6 +8231,35 @@ The state object after the folding function is applied to each element of the array. Thrown when the input array is null. + + + + type Count = + { Positive: int + Negative: int + Text: string } + + let sequence = [| 1; 0; -1; -2; 3 |] + let initialState = {Positive = 0; Negative = 0; Text = "" } + + (sequence, initialState) ||> Array.foldBack (fun a acc -> + let text = acc.Text + " " + string a + if a >= 0 then + { acc with + Positive = acc.Positive + 1 + Text = text } + else + { acc with + Negative = acc.Negative + 1 + Text = text }) + + Evaluates to + + { Positive = 2 + Negative = 3 + Text = " 3 -2 -1 0 1" } + + Applies a function to each element of the collection, threading an accumulator argument @@ -3617,6 +8273,22 @@ The final state. Thrown when the input array is null. + + + + type Charge = + | In of int + | Out of int + + let inputs = [| In 1; Out 2; In 3 |] + + (0, inputs) ||> Array.fold (fun acc charge -> + match charge with + | In i -> acc + i + | Out o -> acc - o) + + Evaluates to 2 + Tests if all corresponding elements of the array satisfy the given predicate pairwise. @@ -3635,6 +8307,36 @@ Thrown when the input arrays differ in length. True if all of the array elements satisfy the predicate. + + + + let inputs1 = [| 1; 2; 3 |] + let inputs2 = [| 1; 2; 3 |] + + (inputs1, inputs2) ||> Array.forall2 (=) + + Evaluates to true. + + + + + let items1 = [| 2017; 1; 1 |] + let items2 = [| 2019; 19; 8 |] + + (items1, items2) ||> Array.forall2 (=) + + Evaluates to false. + + + + + let items1 = [| 1; 2; 3 |] + let items2 = [| 1; 2 |] + + (items1, items2) ||> Array.forall2 (=) + + Throws ArgumentException. + Tests if all elements of the array satisfy the given predicate. @@ -3649,6 +8351,16 @@ True if all of the array elements satisfy the predicate. Thrown when the input array is null. + + + + let isEven a = a % 2 = 0 + + [2; 42] |> Array.forall isEven // evaluates to true + + [1; 2] |> Array.forall isEven // evaluates to false + + Returns the index of the last element in the array @@ -3663,6 +8375,24 @@ Thrown when the input array is null. The index of the last element in the array that satisfies the given predicate. + + + + let inputs = [| 1; 2; 3; 4; 5 |] + + inputs |> Array.findIndex (fun elm -> elm % 2 = 0) + + Evaluates to 3 + + + + + let inputs = [| 1; 2; 3; 4; 5 |] + + inputs |> Array.findIndex (fun elm -> elm % 6 = 0) + + Throws KeyNotFoundException + Returns the index of the first element in the array @@ -3677,6 +8407,23 @@ Thrown when the input array is null. The index of the first element in the array that satisfies the given predicate. + + + + let inputs = [| 1; 2; 3; 4; 5 |] + + inputs |> Array.findIndex (fun elm -> elm % 2 = 0) + + Evaluates to 1 + + + + + let inputs = [| 1; 2; 3; 4; 5 |] + inputs |> Array.findIndex (fun elm -> elm % 6 = 0) + + Throws KeyNotFoundException + Returns the last element for which the given function returns 'true'. @@ -3690,6 +8437,24 @@ Thrown when the input array is null. The last element for which predicate returns true. + + + + let inputs = [| 2; 3; 4 |] + + inputs |> Array.findBack (fun elm -> elm % 2 = 0) + + Evaluates to 4 + + + + + let inputs = [| 2; 3; 4 |] + + inputs |> Array.findBack (fun elm -> elm % 6 = 0) + + Throws KeyNotFoundException + Returns the first element for which the given function returns 'true'. @@ -3703,6 +8468,24 @@ never returns true. The first element for which predicate returns true. + + + + let inputs = [| 1; 2; 3 |] + + inputs |> Array.find (fun elm -> elm % 2 = 0) + + Evaluates to 2 + + + + + let inputs = [| 1; 2; 3 |] + + inputs |> Array.find (fun elm -> elm % 6 = 0) + + Throws KeyNotFoundException + Returns a new collection containing only the elements of the collection @@ -3714,6 +8497,15 @@ An array containing the elements for which the given predicate returns true. Thrown when the input array is null. + + + + let inputs = [| 1; 2; 3; 4 |] + + inputs |> Array.filter (fun elm -> elm % 2 = 0) + + Evaluates to [| 2; 4 |] + Tests if any pair of corresponding elements of the arrays satisfies the given predicate. @@ -3732,6 +8524,26 @@ Thrown when either of the input arrays is null. Thrown when the input arrays differ in length. + + + + let inputs1 = [| 1; 2 |] + let inputs2 = [| 1; 2; 0 |] + + (inputs1, inputs2) ||> Array.exists2 (fun a b -> a > b) + + Evaluates to false + + + + + let inputs1 = [| 1; 4 |] + let inputs2 = [| 1; 3; 5 |] + + (inputs1, inputs2) ||> Array.exists2 (fun a b -> a > b) + + Evaluates to true + Tests if any element of the array satisfies the given predicate. @@ -3746,6 +8558,24 @@ True if any result from predicate is true. Thrown when the input array is null. + + + + let input = [| 1; 2; 3; 4; 5 |] + + input |> Array.exists (fun elm -> elm % 4 = 0) + + Evaluates to true + + + + + let input = [| 1; 2; 3; 4; 5 |] + + input |> Array.exists (fun elm -> elm % 6 = 0) + + Evaluates to false + Returns a new list with the distinct elements of the input array which do not appear in the itemsToExclude sequence, @@ -3758,6 +8588,16 @@ An array that contains the distinct elements of array that do not appear in itemsToExclude. Thrown when either itemsToExclude or array is null. + + + + let original = [| 1; 2; 3; 4; 5 |] + let itemsToExclude = [| 1; 3; 5 |] + + original |> Array.except itemsToExclude + + Evaluates to [| 2; 4 |] + Returns the only element of the array or None if array is empty or contains more than one element. @@ -3767,6 +8607,33 @@ The only element of the array or None. Thrown when the input array is null. + + + + let inputs = [| "banana" |] + + inputs |> Array.tryExactlyOne + + Evaluates to Some banana + + + + + let inputs = [| "pear"; "banana" |] + + inputs |> Array.tryExactlyOne + + Evaluates to None + + + + + let inputs: int[] = [| |] + + inputs |> Array.tryExactlyOne + + Evaluates to None + Returns the only element of the array. @@ -3777,10 +8644,43 @@ Thrown when the input array is null. Thrown when the input does not have precisely one element. + + + + let inputs = [| "banana" |] + + inputs |> Array.exactlyOne + + Evaluates to banana + + + + + let inputs = [| "pear"; "banana" |] + + inputs |> Array.exactlyOne + + Throws ArgumentException + + + + + let inputs: int[] = [| |] + + inputs |> Array.exactlyOne + + Throws ArgumentException + Returns an empty array of the given type. The empty array. + + + + Array.empty // Evaluates to [| |] + + Splits the input array into at most count chunks. @@ -3792,6 +8692,24 @@ Thrown when the input array is null. Thrown when count is not positive. + + + + let inputs = [| 1; 2; 3; 4; 5 |] + + inputs |> Array.splitInto 3 + + Evaluates to seq [| [|1; 2|]; [|3; 4|]; [|5|] |] + + + + + let inputs = [| 1; 2; 3; 4; 5 |] + + inputs |> Array.splitInto -1 + + Throws ArgumentException + Returns an array that contains no duplicate entries according to the @@ -3804,6 +8722,15 @@ The result array. Thrown when the input array is null. + + + + let inputs = [| {Bar = 1 };{Bar = 1}; {Bar = 2}; {Bar = 3} |] + + inputs |> Array.distinctBy (fun foo -> foo.Bar) + + Evaluates to [| { Bar = 1 }; { Bar = 2 }; { Bar = 3 } |] + Returns an array that contains no duplicate entries according to generic hash and @@ -3815,6 +8742,15 @@ The result array. Thrown when the input array is null. + + + + let input = [| 1; 1; 2; 3 |] + + input |> Array.distinct + + Evaluates to [| 1; 2; 3 |] + Divides the input array into chunks of size at most chunkSize. @@ -3826,11 +8762,29 @@ Thrown when the input array is null. Thrown when chunkSize is not positive. + + + + let input = [| 1; 2; 3 |] + + input |> Array.chunkBySize 2 + + Evaluates to [| [|1; 2|]; [|3|] |] + + + + + let input = [| 1; 2; 3 |] + + input |> Array.chunkBySize -2 + + Throws ArgumentException + Applies the given function to each element of the array. Returns - the array comprised of the results "x" for each element where - the function returns Some(x) + the array comprised of the results x for each element where + the function returns Some(x) The function to generate options from the elements. The input array. @@ -3838,10 +8792,28 @@ The array of results. Thrown when the input array is null. + + + + let input = [| Some 1; None; Some 2 |] + + input |> Array.choose id + + Evaluates to [| 1; 2 |] + + + + + let input = [| 1; 2; 3 |] + + input |> Array.choose (fun n -> if n % 2 = 0 then Some n else None) + + Evaluates to [| 2 |] + Applies the given function to successive elements, returning the first - result where function returns Some(x) for some x. If the function + result where the function returns Some(x) for some x. If the function never returns Some(x) then is raised. The function to generate options from the elements. @@ -3852,6 +8824,25 @@ chooser is None. The first result. + + + + let input = [| 1; 2; 3 |] + + input |> Array.pick (fun n -> if n % 2 = 0 then Some (string n) else None) + + Evaluates to "2". + + + + + let input = [| 1; 2; 3 |] + + input |> Array.pick (fun n -> if n > 3 = 0 then Some (string n) else None) + + Throws KeyNotFoundException. + + Fills a range of elements of the array with the given value. @@ -3863,10 +8854,19 @@ Thrown when the input array is null. Thrown when either targetIndex or count is negative. + + + + let target = [| 0; 1; 2; 3; 4; 5 |] + + Array.fill target 3 2 100 + + After evaluation target contains [| 0; 1; 2; 100; 100; 5 |]. + Applies the given function to successive elements, returning the first - result where function returns Some(x) for some x. If the function + result where the function returns Some(x) for some x. If the function never returns Some(x) then None is returned. The function to transform the array elements into options. @@ -3875,6 +8875,25 @@ The first transformed element that is Some(x). Thrown when the input array is null. + + + + let input = [| 1; 2; 3 |] + + input |> Array.tryPick (fun n -> if n % 2 = 0 then Some (string n) else None) + + Evaluates to Some "2". + + + + + let input = [| 1; 2; 3 |] + + input |> Array.tryPick (fun n -> if n > 3 = 0 then Some (string n) else None) + + Evaluates to None. + + Returns the first element of the array, or @@ -3885,6 +8904,24 @@ Thrown when the input array is null. The first element of the array or None. + + + + let inputs = [| "banana"; "pear" |] + + inputs |> Array.tryHead + + Evaluates to Some "banana" + + + + + let inputs : int[] = [| |] + + inputs |> Array.tryHead + + Evaluates to None + Creates an array whose elements are all initially the given value. @@ -3895,6 +8932,25 @@ The created array. Thrown when count is negative. + + + + Array.create 4 "a" + + Evaluates to a new array containing[| "a"; "a"; "a"; "a" |]. + + + + + let cell = ref "a" + let array = Array.create 2 cell + cell.Value <- "b" + + + Before evaluation of the last line, array contains[| { contents = "a"}; { contents = "a"} |]. + After evaluation of the last line array contains[| { contents = "b"}; { contents = "b"} |]. + Note each entry in the array is the same mutable cell object. + Applies a key-generating function to each element of an array and returns an array yielding unique @@ -3907,6 +8963,17 @@ The result array. Thrown when the input array is null. + + + + type Foo = { Bar: string } + + let inputs = [| {Bar = "a"}; {Bar = "b"}; {Bar = "a"} |] + + inputs |> Array.countBy (fun foo -> foo.Bar) + + Evaluates to [| ("a", 2); ("b", 1) |] + Builds a new array that contains the elements of the given array. @@ -3916,6 +8983,15 @@ A copy of the input array. Thrown when the input array is null. + + + + let source = [| 12; 13; 14 |] + + Array.copy source + + Evaluates to a new array containing[| 12; 13; 14 |]. + Tests if the array contains the specified element. @@ -3926,6 +9002,13 @@ True if the input array contains the specified element; false otherwise. Thrown when the input array is null. + + + + [| 1; 2 |] |> Array.contains 2 // evaluates to true + [| 1; 2 |] |> Array.contains 5 // evaluates to false + + Builds a new array that contains the elements of each of the given sequence of arrays. @@ -3935,6 +9018,15 @@ The concatenation of the sequence of input arrays. Thrown when the input sequence is null. + + + + let inputs = [ [| 1; 2 |]; [| 3 |]; [| 4; 5 |] ] + + inputs |> Array.concat + + Evaluates to [| 1; 2; 3; 4; 5 |] + Compares two arrays using the given comparison function, element by element. @@ -3952,6 +9044,71 @@ Thrown when either of the input arrays is null. + + + + let closerToNextDozen a b = + (a % 12).CompareTo(b % 12) + + let input1 = [| 1; 10 |] + let input2 = [| 1; 10 |] + + (input1, input2) ||> Array.compareWith closerToNextDozen + + Evaluates to 0 + + + + + let closerToNextDozen a b = + (a % 12).CompareTo(b % 12) + + let input1 = [| 1; 5 |] + let input2 = [| 1; 8 |] + + (input1, input2) ||> Array.compareWith closerToNextDozen + + Evaluates to -1 + + + + + let closerToNextDozen a b = + (a % 12).CompareTo(b % 12) + + let input1 = [| 1; 11 |] + let input2 = [| 1; 13 |] + + (input1, input2) ||> Array.compareWith closerToNextDozen + + Evaluates to 1 + + + + + let closerToNextDozen a b = + (a % 12).CompareTo(b % 12) + + let input1 = [| 1; 2 |] + let input2 = [| 1 |] + + (input1, input2) ||> Array.compareWith closerToNextDozen + + Evaluates to 1 + + + + + let closerToNextDozen a b = + (a % 12).CompareTo(b % 12) + + let input1 = [| 1 |] + let input2 = [| 1; 2 |] + + (input1, input2) ||> Array.compareWith closerToNextDozen + + Evaluates to -1 + For each element of the array, applies the given function. Concatenates all the results and return the combined array. @@ -3962,6 +9119,26 @@ The concatenation of the sub-arrays. Thrown when the input array is null. + + + + type Foo = { Bar: int[] } + + let input = [| {Bar = [| 1; 2 |]}; {Bar = [| 3; 4 |]} |] + + input |> Array.collect (fun foo -> foo.Bar) + + Evaluates to [| 1; 2; 3; 4 |] + + + + + let input = [[1; 2]; [3; 4]] + + input |> Array.collect id + + Evaluates to [| 1; 2; 3; 4 |] + Reads a range of elements from the first array and write them into the second. @@ -3972,9 +9149,28 @@ The starting index of the target array. The number of elements to copy. + + Slicing syntax is generally preferred, e.g. + + let source = [| 12; 13; 14 |] + let target = [| 0; 1; 2; 3; 4; 5 |] + target[3..4] <- source[1..2] + + + Thrown when either of the input arrays is null. Thrown when any of sourceIndex, targetIndex or count are negative, or when there aren't enough elements in source or target. + + + + let source = [| 12; 13; 14 |] + let target = [| 0; 1; 2; 3; 4; 5 |] + + Array.blit source 1 target 3 2 + + After evaluation target contains [| 0; 1; 2; 12; 13; 5 |]. + Returns the average of the elements generated by applying the function to each element of the array. @@ -3987,6 +9183,28 @@ The computed average. Thrown when the input array is null. + + + + type Foo = { Bar: float } + + let input = [| {Bar = 2.0}; {Bar = 4.0} |] + + input |> Array.averageBy (fun foo -> foo.Bar) + + Evaluates to 3.0 + + + + + type Foo = { Bar: float } + + let input : Foo[] = [| |] + + input |> Array.averageBy (fun foo -> foo.Bar) + + Throws ArgumentException + Returns the average of the elements in the array. @@ -3997,6 +9215,20 @@ Thrown when the input array is null. The average of the elements in the array. + + + + [| 1.0; 2.0; 6.0 |] |> Array.average + + Evaluates to 3.0 + + + + + [| |] |> Array.average + + Throws ArgumentException + Builds a new array that contains the elements of the first array followed by the elements of the second array. @@ -4007,6 +9239,13 @@ The resulting array. Thrown when either of the input arrays is null. + + + + Array.append [| 1; 2 |] [| 3; 4 |] + + Evaluates to [| 1; 2; 3; 4 |]. + Returns a new array that contains all pairings of elements from the first and second arrays. @@ -4017,6 +9256,16 @@ Thrown when either of the input arrays is null. The resulting array of pairs. + + + + ([| 1; 2 |], [| 3; 4 |]) ||> Array.allPairs + + Evaluates to + + [| (1, 3); (1, 4); (2, 3); (2, 4) |] + + Split the collection into two collections, containing the @@ -4032,6 +9281,15 @@ The two arrays of results. Thrown when the input array is null. + + + + let inputs = [| 1; 2; 3; 4 |] + + inputs |> Array.Parallel.partition (fun x -> x % 2 = 0) + + Evaluates to ([|2; 4|], [|1; 3|]). + Create an array given the dimension and a generator function to compute the elements. @@ -4043,6 +9301,13 @@ The array of results. + + + + Array.Parallel.init 4 (fun v -> v + 5) + + Evaluates to [| 5; 6; 7; 8 |] + Apply the given function to each element of the array. The integer passed to the @@ -4055,6 +9320,20 @@ The input array. Thrown when the input array is null. + + + + let inputs = [| "a"; "b"; "c" |] + + inputs |> Array.Parallel.iteri (fun i v -> printfn "{i}: {v}") + + Evaluates to unit and prints the following to the console in an unspecified order: + + 0: a + 2: c + 1: b + + Apply the given function to each element of the array. @@ -4066,6 +9345,20 @@ The input array. Thrown when the input array is null. + + + + let inputs = [| "a"; "b"; "c" |] + + inputs |> Array.Parallel.iter (printfn "%s") + + Evaluates to unit and prints the following to the console in an unspecified order: + + a + c + b + + Build a new array whose elements are the results of applying the given function @@ -4081,6 +9374,15 @@ The array of results. Thrown when the input array is null. + + + + let inputs = [| 10; 10; 10 |] + + inputs |> Array.Parallel.mapi (fun i x -> i + x) + + Evaluates to [| 10; 11; 12 |] + Build a new array whose elements are the results of applying the given function @@ -4095,6 +9397,15 @@ The array of results. Thrown when the input array is null. + + + + let inputs = [| "a"; "bbb"; "cc" |] + + inputs |> Array.Parallel.map (fun x -> x.Length) + + Evaluates to [| 1; 3; 2 |] + For each element of the array, apply the given function. Concatenate all the results and return the combined array. @@ -4108,11 +9419,31 @@ 'U[] Thrown when the input array is null. + + + + type Foo = { Bar: int[] } + + let input = [| {Bar = [| 1; 2 |]}; {Bar = [| 3; 4 |]} |] + + input |> Array.Parallel.collect (fun foo -> foo.Bar) + + Evaluates to [| 1; 2; 3; 4 |] + + + + + let input = [| [| 1; 2 |]; [| 3; 4 |] |] + + input |> Array.Parallel.collect id + + Evaluates to [| 1; 2; 3; 4 |] + Apply the given function to each element of the array. Return - the array comprised of the results "x" for each element where - the function returns Some(x). + the array comprised of the results x for each element where + the function returns Some(x). Performs the operation in parallel using . The order in which the given function is applied to elements of the input array is not specified. @@ -4123,6 +9454,24 @@ The array of results. Thrown when the input array is null. + + + + let input = [| Some 1; None; Some 2 |] + + input |> Array.Parallel.choose id + + Evaluates to [| 1; 2 |] + + + + + let input = [| 1; 2; 3 |] + + input |> Array.Parallel.choose (fun n -> if n % 2 = 0 then Some n else None) + + Evaluates to [| 2 |] + Provides parallel operations on arrays @@ -4134,7 +9483,7 @@ See also F# Language Guide - Arrays. - + Sets the value of an element in an array. You can also use the syntax 'array.[index1,index2,index3,index4] <- value'. @@ -4144,8 +9493,25 @@ The index along the third dimension. The index along the fourth dimension. The value to set. + + + Indexer syntax is generally preferred, e.g. + + let array: float[,,,] = Array4D.zeroCreate 2 3 4 5 + + array[0,2,1,3] <- 5.0 + + + + + + let array = Array4D.zeroCreate 2 3 4 5 + + Array4D.2et array 0 2 1 3 5.0 + + - + Fetches an element from a 4D array. You can also use the syntax 'array.[index1,index2,index3,index4]' The input array. @@ -4155,6 +9521,23 @@ The index along the fourth dimension. The value at the given index. + + + Indexer syntax is generally preferred, e.g. + + let array: float[,,,] = Array4D.zeroCreate 2 3 4 5 + + array[0,2,1,3] + + + + + + let array = Array4D.zeroCreate 2 3 4 5 + + Array4D.get array 0 2 1 3 + + Creates an array where the entries are initially the "default" value. @@ -4165,34 +9548,77 @@ The length of the fourth dimension. The created array. + + + + let array : float[,,,] = Array4D.zeroCreate 2 3 3 5 + + After evaluation array is a 2x3x3x5 array with contents all zero. + - + Returns the length of an array in the fourth dimension. The input array. The length of the array in the fourth dimension. + + + + let array = Array4D.init 2 3 4 5 (fun i j k -> 100*i + 10*j + k) + + array |> Array4D.length4 + + Evaluates to 5. + - + Returns the length of an array in the third dimension. The input array. The length of the array in the third dimension. + + + + let array = Array4D.init 2 3 4 5 (fun i j k -> 100*i + 10*j + k) + + array |> Array4D.length3 + + Evaluates to 4. + - + Returns the length of an array in the second dimension. The input array. The length of the array in the second dimension. + + + + let array = Array4D.init 2 3 4 5 (fun i j k -> 100*i + 10*j + k) + + array |> Array4D.length2 + + Evaluates to 3. + - + Returns the length of an array in the first dimension The input array. The length of the array in the first dimension. + + + + let array = Array4D.init 2 3 4 5 (fun i j k -> 100*i + 10*j + k) + + array |> Array4D.length1 + + Evaluates to 2. + Creates an array given the dimensions and a generator function to compute the elements. @@ -4204,6 +9630,14 @@ The function to create an initial value at each index in the array. The created array. + + + + Array4D.init 2 2 2 2 (fun i j k l -> i*1000+j*100+k*10+l) + + Evaluates to a 2x2x2x2 array with contents [[[[0; 1]; [10; 11]]; [[100; 101]; [110; 111]]];[[[1000; 1]; [1010; 1011]]; [[1100; 1101]; [1110; 1111]]]] + + Creates an array whose elements are all initially the given value @@ -4215,6 +9649,14 @@ The initial value for each element of the array. The created array. + + + + Array4D.create 2 2 2 2 1 + + Evaluates to a 2x2x2x2 array with all entries 1 + + Contains operations for working with rank 4 arrays. @@ -4227,8 +9669,15 @@ The length of the third dimension. The created array. + + + + let array : float[,,] = Array3D.zeroCreate 2 3 3 + + After evaluation array is a 2x3x3 array with contents all zero. + - + Sets the value of an element in an array. You can also use the syntax 'array.[index1,index2,index3] <- value'. @@ -4237,8 +9686,27 @@ The index along the second dimension. The index along the third dimension. The value to set at the given index. + + + Indexer syntax is generally preferred, e.g. + + let array = Array3D.zeroCreate 2 3 3 + + array[0,2,1] < 4.0 + + Evaluates to 11. + + + + + let array = Array3D.zeroCreate 2 3 3 + + Array3D.set array 0 2 1 4.0 + + After evaluation array is a 2x3x3 array with contents [[[0.0; 0.0; 0.0]; [0.0; 4.0; 0.0]]; [[0.0; 0.0; 0.0]; [0.0; 0.0; 0.0]]] + - + Builds a new array whose elements are the results of applying the given function to each of the elements of the array. The integer indices passed to the function indicates the element being transformed. @@ -4249,8 +9717,17 @@ The input array. The array created from the transformed elements. + + + + let inputs = Array3D.zeroCreate 2 3 3 + + inputs |> Array3D.mapi (fun i j k v -> 100*i + 10*j + k) + + Evaluates to a 2x3x3 array with contents [[[0; 2; 4]; [20; 22; 24]]; [[200; 202; 204]; [220; 222; 224]]] + - + Builds a new array whose elements are the results of applying the given function to each of the elements of the array. @@ -4260,42 +9737,126 @@ The input array. The array created from the transformed elements. + + + + let inputs = Array3D.init 2 3 3 (fun i j k -> 100*i + 10*j + k) + + inputs |> Array3D.map (fun v -> 2 * v) + + Evaluates to a 2x3x3 array with contents [[[0; 2; 4]; [20; 22; 24]]; [[200; 202; 204]; [220; 222; 224]]] + - + Returns the length of an array in the third dimension. The input array. The length of the array in the third dimension. + + + + let array = Array3D.init 2 3 4 (fun i j k -> 100*i + 10*j + k) + + array |> Array3D.length3 + + Evaluates to 4. + - + Returns the length of an array in the second dimension. The input array. The length of the array in the second dimension. + + + + let array = Array3D.init 2 3 4 (fun i j k -> 100*i + 10*j + k) + + array |> Array3D.length2 + + Evaluates to 3. + - + Returns the length of an array in the first dimension The input array. - The length of the array in the first dimension. + The length of the array in the first dimension. + + + + let array = Array3D.init 2 3 4 (fun i j k -> 100*i + 10*j + k) + + array |> Array3D.length1 + + Evaluates to 2. + - + Applies the given function to each element of the array. The integer indices passed to the function indicates the index of element. The function to apply to each element of the array. The input array. + + + + let inputs = Array3D.init 2 2 3 (fun i j k -> 100*i + 10*j + k) + + inputs |> Array3D.iteri (fun i j k v -> printfn $"value at ({i},{j},{k}) = {v}") + + Evaluates to unit and prints + + value at (0,0,0) = 0 + value at (0,0,1) = 1 + value at (0,0,2) = 2 + value at (0,1,0) = 10 + value at (0,1,1) = 11 + value at (0,1,2) = 12 + value at (1,0,0) = 100 + value at (1,0,1) = 101 + value at (1,0,2) = 102 + value at (1,1,0) = 110 + value at (1,1,1) = 111 + value at (1,1,2) = 112 + + in the console. + - + Applies the given function to each element of the array. The function to apply to each element of the array. The input array. + + + + let inputs = Array3D.init 2 2 3 (fun i j k -> 100*i + 10*j + k) + + inputs |> Array3D.iter (fun v -> printfn $"value = {v}") + + Evaluates to unit and prints + + value = 0 + value = 1 + value = 2 + value = 10 + value = 11 + value = 12 + value = 100 + value = 101 + value = 102 + value = 110 + value = 111 + value = 112 + + in the console. + - + Fetches an element from a 3D array. You can also use the syntax 'array.[index1,index2,index3]' The input array. @@ -4304,6 +9865,25 @@ The index along the third dimension. The value at the given index. + + + Indexer syntax is generally preferred, e.g. + + let array = Array3D.init 2 3 3 (fun i j k -> 100*i + 10*j + k) + + array[0,2,1] + + Evaluates to 11. + + + + + let array = Array3D.init 2 3 3 (fun i j k -> 100*i + 10*j + k) + + Array3D.get array 0 2 1 + + Evaluates to 21. + Creates an array given the dimensions and a generator function to compute the elements. @@ -4314,6 +9894,13 @@ The function to create an initial value at each index into the array. The created array. + + + + Array3D.init 2 2 3 (fun i j k -> 100*i + 10*j + k) + + Evaluates to a 2x2x3 array with contents [[[0; 1; 2]; [10; 11; 12]]; [[100; 101; 102]; [110; 111; 112]]] + Creates an array whose elements are all initially the given value. @@ -4323,6 +9910,14 @@ The value of the array elements. The created array. + + + + Array3D.create 2 2 3 1 + + Evaluates to a 2x3 array with contents [[[1; 1; 1]; [1; 1; 1]]; [[1; 1; 1]; [1; 1; 1]]] + + Contains operations for working with rank 3 arrays. @@ -4331,8 +9926,40 @@ See also F# Language Guide - Arrays. + + The values in the map, including the duplicates. + The sequence will be ordered by the keys of the map. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + sample |> Map.values // evaluates to seq ["a"; "b"] + + + + + The keys in the map. + The sequence will be ordered by the keys of the map. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + sample |> Map.keys // evaluates to seq [1; 2] + + + The number of bindings in the map. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + sample |> Map.count // evaluates to 2 + + Returns the key of the first mapping in the collection that satisfies the given predicate. @@ -4342,6 +9969,15 @@ The input map. The first key for which the predicate returns true or None if the predicate evaluates to false for each key/value pair. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + sample |> Map.tryFindKey (fun n s -> n = s.Length) // evaluates to Some 1 + sample |> Map.tryFindKey (fun n s -> n < s.Length) // evaluates to None + + Evaluates the function on each mapping in the collection. Returns the key for the first mapping @@ -4352,6 +9988,15 @@ Thrown if the key does not exist in the map. The first key for which the predicate evaluates true. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + sample |> Map.findKey (fun n s -> n = s.Length) // evaluates to 1 + sample |> Map.findKey (fun n s -> n < s.Length) // throws KeyNotFoundException + + Lookup an element in the map, returning a Some value if the element is in the domain @@ -4361,6 +10006,15 @@ The input map. The found Some value or None. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + sample |> Map.tryFind 1 // evaluates to Some "a" + sample |> Map.tryFind 3 // evaluates to None + + Removes an element from the domain of the map. No exception is raised if the element is not present. @@ -4369,6 +10023,15 @@ The input map. The resulting map. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + sample |> Map.remove 1 // evaluates to map [(2, "b")] + sample |> Map.remove 3 // equal to sample + + Builds two new maps, one containing the bindings for which the given predicate returns 'true', @@ -4379,6 +10042,14 @@ A pair of maps in which the first contains the elements for which the predicate returned true and the second containing the elements for which the predicated returned false. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + sample |> Map.partition (fun n s -> n = s.Length) // evaluates to (map [(1, "a")], map [(2, "b")]) + + Tests if an element is in the domain of the map. @@ -4387,6 +10058,15 @@ The input map. True if the map contains the key. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + sample |> Map.containsKey 1 // evaluates to true + sample |> Map.containsKey 3 // evaluates to false + + Builds a new collection whose elements are the results of applying the given function @@ -4397,6 +10077,14 @@ The input map. The resulting map of keys and transformed values. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + sample |> Map.map (fun n s -> sprintf "%i %s" n s) // evaluates to map [(1, "1 a"); (2, "2 b")] + + Returns true if the given predicate returns true for all of the @@ -4406,6 +10094,15 @@ The input map. True if the predicate evaluates to true for all of the bindings in the map. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + sample |> Map.forall (fun n s -> n >= s.Length) // evaluates to true + sample |> Map.forall (fun n s -> n = s.Length) // evaluates to false + + Builds a new map containing only the bindings for which the given predicate returns 'true'. @@ -4414,6 +10111,14 @@ The input map. The filtered map. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + sample |> Map.filter (fun n s -> n = s.Length) // evaluates to map [(1, "a")] + + Returns true if the given predicate returns true for one of the @@ -4423,12 +10128,30 @@ The input map. True if the predicate returns true for one of the key/value pairs. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + sample |> Map.exists (fun n s -> n = s.Length) // evaluates to true + sample |> Map.exists (fun n s -> n < s.Length) // evaluates to false + + Applies the given function to each binding in the dictionary The function to apply to each key/value pair. The input map. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + sample |> Map.iter (fun n s -> printf "%i %s " n s) + + Prints "1 a 2 b ". + Folds over the bindings in the map @@ -4438,6 +10161,15 @@ The input map. The final state value. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + ("initial", sample) ||> Map.fold (fun state n s -> sprintf "%s %i %s" state n s) + + Evaluates to "initial 1 a 2 b". + Folds over the bindings in the map. @@ -4447,14 +10179,43 @@ The initial state. The final state value. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + (sample, "initial") ||> Map.foldBack (fun n s state -> sprintf "%i %s %s" n s state) + + Evaluates to "1 a 2 b initial" + - Searches the map looking for the first element where the given function returns a Some value + Searches the map looking for the first element where the given function returns a Some value. + Raise KeyNotFoundException if no such element exists. The function to generate options from the key/value pairs. The input map. + Thrown if no element returns a Some + value when evaluated by the chooser function The first result. + + + + let sample = Map [ (1, "a"); (2, "b"); (10, "ccc"); (20, "ddd") ] + + sample |> Map.pick (fun n s -> if n > 5 && s.Length > 2 then Some s else None) + + Evaluates to "ccc" + + + + let sample = Map [ (1, "a"); (2, "b"); (10, "ccc"); (20, "ddd") ] + + sample |> Map.pick (fun n s -> if n > 5 && s.Length > 4 then Some s else None) + + Raises KeyNotFoundException + Searches the map looking for the first element where the given function returns a Some value. @@ -4463,6 +10224,24 @@ The input map. The first result. + + + + let sample = Map [ (1, "a"); (2, "b"); (10, "ccc"); (20, "ddd") ] + + sample |> Map.tryPick (fun n s -> if n > 5 && s.Length > 2 then Some s else None) + + Evaluates to Some "ccc". + + + + + let sample = Map [ (1, "a"); (2, "b"); (10, "ccc"); (20, "ddd") ] + + sample |> Map.tryPick (fun n s -> if n > 5 && s.Length > 4 then Some s else None) + + Evaluates to None. + Lookup an element in the map, raising KeyNotFoundException if no binding @@ -4473,9 +10252,24 @@ Thrown when the key does not exist in the map. The value mapped to the given key. + + + + let sample = Map [ (1, "a"); (2, "b") ] + + sample |> Map.find 1 // evaluates to "a" + sample |> Map.find 3 // throws KeyNotFoundException + + The empty map. + + + + let emptyMap = Map.empty<int, string> + + Is the map empty? @@ -4483,6 +10277,16 @@ The input map. True if the map is empty. + + + + let emptyMap = Map.empty<int, string> + emptyMap |> Map.isEmpty // evaluates to true + + let notEmptyMap = Map [ (1, "a"); (2, "b") ] + emptyMap |> Map.isEmpty // evaluates to false + + Returns an array of all key-value pairs in the mapping. @@ -4491,6 +10295,14 @@ The input map. The array of key/value pairs. + + + + let input = Map [ (1, "a"); (2, "b") ] + + input |> Map.toArray // evaluates to [|(1, "a"); (2, "b")|] + + Returns a list of all key-value pairs in the mapping. @@ -4499,6 +10311,14 @@ The input map. The list of key/value pairs. + + + + let input = Map [ (1, "a"); (2, "b") ] + + input |> Map.toList // evaluates to [(1, "a"); (2, "b")] + + Views the collection as an enumerable sequence of pairs. @@ -4507,6 +10327,14 @@ The input map. The sequence of key/value pairs. + + + + let input = Map [ (1, "a"); (2, "b") ] + + input |> Map.toSeq // evaluates to seq [(1, "a"); (2, "b")] + + Returns a new map made from the given bindings. @@ -4514,6 +10342,14 @@ The input sequence of key/value pairs. The resulting map. + + + + let input = seq { (1, "a"); (2, "b") } + + input |> Map.ofSeq // evaluates to map [(1, "a"); (2, "b")] + + Returns a new map made from the given bindings. @@ -4521,6 +10357,14 @@ The input array of key/value pairs. The resulting map. + + + + let input = [| (1, "a"); (2, "b") |] + + input |> Map.ofArray // evaluates to map [(1, "a"); (2, "b")] + + Returns a new map made from the given bindings. @@ -4528,6 +10372,14 @@ The input list of key/value pairs. The resulting map. + + + + let input = [ (1, "a"); (2, "b") ] + + input |> Map.ofList // evaluates to map [(1, "a"); (2, "b")] + + Returns a new map with the value stored under key changed according to f. @@ -4537,6 +10389,19 @@ The input map. The resulting map. + + + + let input = Map [ (1, "a"); (2, "b") ] + + input |> Map.change 1 (fun x -> + match x with + | Some s -> Some (s + "z") + | None -> None + ) + evaluates to map [(1, "az"); (2, "b")] + + Returns a new map with the binding added to the given map. @@ -4547,6 +10412,15 @@ The input map. The resulting map. + + + + let input = Map [ (1, "a"); (2, "b") ] + + input |> Map.add 3 "c" // evaluates to map [(1, "a"); (2, "b"); (3, "c")] + input |> Map.add 2 "aa" // evaluates to map [(1, "a"); (2, "aa")] + + Contains operations for working with values of type . @@ -4558,6 +10432,8 @@ The set whose elements will be removed from set1. The set with the elements of set2 removed from set1. + + Builds a new collection from the given enumerable object. @@ -4565,6 +10441,8 @@ The input sequence. The set containing elements. + + Returns an ordered view of the collection as an enumerable object. @@ -4572,6 +10450,8 @@ The input set. An ordered sequence of the elements of set. + + Builds an array that contains the elements of the set in order. @@ -4579,6 +10459,8 @@ The input set. An ordered array of the elements of set. + + Builds a set that contains the same elements as the given array. @@ -4586,6 +10468,8 @@ The input array. A set containing the elements of array. + + Builds a list that contains the elements of the set in order. @@ -4593,6 +10477,8 @@ The input set. An ordered list of the elements of set. + + Builds a set that contains the same elements as the given list. @@ -4600,6 +10486,8 @@ The input list. A set containing the elements form the input list. + + Returns the highest element in the set according to the ordering being used for the set. @@ -4607,6 +10495,8 @@ The input set. The max value from the set. + + Returns the lowest element in the set according to the ordering being used for the set. @@ -4614,6 +10504,8 @@ The input set. The min value from the set. + + Returns a new set with the given element removed. No exception is raised if @@ -4623,6 +10515,8 @@ The input set. The input set with value removed. + + Splits the set into two sets containing the elements for which the given predicate @@ -4633,6 +10527,8 @@ A pair of sets with the first containing the elements for which predicate returns true and the second containing the elements for which predicate returns false. + + Applies the given function to each element of the set, in order according @@ -4640,6 +10536,8 @@ The function to apply to each element. The input set. + + Returns "true" if the set is empty. @@ -4647,6 +10545,8 @@ The input set. True if set is empty. + + Computes the union of a sequence of sets. @@ -4654,6 +10554,8 @@ The sequence of sets to union. The union of the input sets. + + Computes the union of the two sets. @@ -4662,6 +10564,8 @@ The second input set. The union of set1 and set2. + + Computes the intersection of a sequence of sets. The sequence must be non-empty. @@ -4669,6 +10573,8 @@ The sequence of sets to intersect. The intersection of the input sets. + + Computes the intersection of the two sets. @@ -4677,6 +10583,8 @@ The second input set. The intersection of set1 and set2. + + Tests if all elements of the collection satisfy the given predicate. @@ -4687,6 +10595,8 @@ The input set. True if all elements of set satisfy predicate. + + Applies the given accumulating function to all the elements of the set. @@ -4696,6 +10606,8 @@ The initial state. The final state. + + Applies the given accumulating function to all the elements of the set @@ -4705,6 +10617,8 @@ The input set. The final state. + + Returns a new collection containing the results of applying the @@ -4714,6 +10628,8 @@ The input set. A set containing the transformed elements. + + Returns a new collection containing only the elements of the collection @@ -4723,6 +10639,8 @@ The input set. The set containing only the elements for which predicate returns true. + + Tests if any element of the collection satisfies the given predicate. @@ -4733,6 +10651,8 @@ The input set. True if any element of set satisfies predicate. + + Returns the number of elements in the set. Same as size. @@ -4740,6 +10660,8 @@ The input set. The number of elements in the set. + + Evaluates to "true" if all elements of the second set are in the first, and at least @@ -4749,6 +10671,8 @@ The set to test against. True if set1 is a proper superset of set2. + + Evaluates to "true" if all elements of the second set are in the first. @@ -4757,6 +10681,8 @@ The set to test against. True if set1 is a superset of set2. + + Evaluates to "true" if all elements of the first set are in the second, and at least @@ -4766,6 +10692,8 @@ The set to test against. True if set1 is a proper subset of set2. + + Evaluates to "true" if all elements of the first set are in the second @@ -4774,6 +10702,8 @@ The set to test against. True if set1 is a subset of set2. + + Evaluates to "true" if the given element is in the given set. @@ -4782,6 +10712,8 @@ The input set. True if element is in set. + + Returns a new set with an element added to the set. No exception is raised if @@ -4791,6 +10723,8 @@ The input set. A new set containing value. + + The set containing the given element. @@ -4798,9 +10732,23 @@ The value for the set to contain. The set containing value. + + + + Set.singleton 7 + + Evaluates to set [ 7 ]. + The empty set for the type 'T. + + + + Set.empty<int> + + Evaluates to set [ ]. + Contains operations for working with values of type . @@ -4812,6 +10760,8 @@ An array of types for the tuple elements. The type representing the tuple containing the input elements. + + Returns a representing an F# tuple type with the given element types @@ -4819,6 +10769,8 @@ An array of types for the tuple elements. The type representing the tuple containing the input elements. + + Returns a representing an F# struct tuple type with the given element types @@ -4827,6 +10779,8 @@ An array of types for the tuple elements. The type representing the struct tuple containing the input elements. + + Returns a representing the F# function type with the given domain and range @@ -4835,6 +10789,8 @@ The output type of the function. The function type with the given domain and range. + + Returns true if the typ is a representation of an F# union type or the runtime type of a value of that type @@ -4843,6 +10799,8 @@ Optional binding flags. True if the type check succeeds. + + Return true if the typ is a representation of an F# tuple type @@ -4850,6 +10808,8 @@ The type to check. True if the type check succeeds. + + Return true if the typ is a representation of an F# record type @@ -4858,6 +10818,8 @@ Optional binding flags. True if the type check succeeds. + + Return true if the typ is a value corresponding to the compiled form of an F# module @@ -4865,6 +10827,8 @@ The type to check. True if the type check succeeds. + + Return true if the typ is a representation of an F# function type or the runtime type of a closure implementing an F# function type @@ -4872,6 +10836,8 @@ The type to check. True if the type check succeeds. + + Returns true if the typ is a representation of an F# exception declaration @@ -4880,6 +10846,8 @@ Optional binding flags. True if the type check is an F# exception. + + Gets the cases of a union type. @@ -4892,6 +10860,8 @@ Thrown when the input type is not a union type. An array of descriptions of the cases of the given union type. + + Gets the tuple elements from the representation of an F# tuple type. @@ -4899,6 +10869,8 @@ The input tuple type. An array of the types contained in the given tuple type. + + Reads all the fields from a record value, in declaration order @@ -4909,6 +10881,8 @@ Optional binding flags. An array of descriptions of the properties of the record type. + + Gets the domain and range types from an F# function type or from the runtime type of a closure implementing an F# type @@ -4916,6 +10890,8 @@ The input function type. A tuple of the domain and range types of the input function. + + Reads all the fields from an F# exception declaration, in declaration order @@ -4928,6 +10904,8 @@ Thrown if the given type is not an exception. An array containing the PropertyInfo of each field in the exception. + + Contains operations associated with constructing and analyzing F# types such as records, unions and tuples @@ -4944,6 +10922,8 @@ Optional binding flags. An optimized function to read the tags of the given union type. + + Precompute a property or static method for reading an integer representing the case tag of a union type. @@ -4952,6 +10932,8 @@ Optional binding flags. The description of the union case reader. + + Precompute a function for reading all the fields for a particular discriminator case of a union type @@ -4962,6 +10944,8 @@ Optional binding flags. A function to for reading the fields of the given union case. + + A method that constructs objects of the given case @@ -4970,6 +10954,8 @@ Optional binding flags. The description of the constructor of the given union case. + + Precompute a function for constructing a discriminated union value for a particular union case. @@ -4978,6 +10964,8 @@ Optional binding flags. A function for constructing values of the given union case. + + Precompute a function for reading the values of a particular tuple type @@ -4990,6 +10978,8 @@ Thrown when the given type is not a tuple type. A function to read values of the given tuple type. + + Gets information that indicates how to read a field of a tuple @@ -4998,6 +10988,8 @@ The index of the tuple element to describe. The description of the tuple element and an optional type and index if the tuple is big. + + Gets a method that constructs objects of the given tuple type. @@ -5014,6 +11006,8 @@ The description of the tuple type constructor and an optional extra type for large tuples. + + Precompute a function for reading the values of a particular tuple type @@ -5026,6 +11020,8 @@ Thrown when the given type is not a tuple type. A function to read a particular tuple type. + + Precompute a function for reading all the fields from a record. The fields are returned in the @@ -5045,6 +11041,8 @@ Thrown when the input type is not a record type. An optimized reader for the given record type. + + Precompute a function for reading a particular field from a record. @@ -5060,6 +11058,8 @@ Thrown when the input type is not a record type. A function to read the specified field from the record. + + Get a ConstructorInfo for a record type @@ -5068,6 +11068,8 @@ Optional binding flags. A ConstructorInfo for the given record type. + + Precompute a function for constructing a record value. @@ -5081,6 +11083,8 @@ Thrown when the input type is not a record type. A function to construct records of the given type. + + Create a union case value. @@ -5090,6 +11094,8 @@ Optional binding flags. The constructed union case. + + Creates an instance of a tuple type @@ -5102,6 +11108,8 @@ Thrown if no elements are given. An instance of the tuple type with the given elements. + + Creates an instance of a record type. @@ -5115,6 +11123,8 @@ Thrown when the input type is not a record type. The created record. + + Builds a typed function from object from a dynamic function implementation @@ -5123,6 +11133,8 @@ The untyped lambda of the function implementation. A typed function from the given dynamic implementation. + + Identify the union case and its fields for an object @@ -5139,6 +11151,8 @@ Thrown when the input type is not a union case value. The description of the union case and its fields. + + Reads all fields from a tuple. @@ -5150,6 +11164,8 @@ Thrown when the input is not a tuple value. An array of the fields from the given tuple. + + Reads a field from a tuple value. @@ -5160,6 +11176,8 @@ The index of the field to read. The value of the field. + + Reads all the fields from a record value. @@ -5171,6 +11189,8 @@ Thrown when the input type is not a record type. The array of fields from the record. + + Reads a field from a record value. @@ -5181,7 +11201,10 @@ The PropertyInfo describing the field to read. Thrown when the input is not a record value. + The field from the record. + + Reads all the fields from a value built using an instance of an F# exception declaration @@ -5194,6 +11217,8 @@ Thrown when the input type is not an F# exception. The fields from the given exception. + + Contains operations associated with constructing and analyzing values associated with F# types @@ -5201,30 +11226,176 @@ The integer tag for the case. + + + + type CoinToss = Heads | Tails + + typeof<CoinToss> + |> FSharpType.GetUnionCases + |> Array.map (fun x -> $"{x.Name} has tag {x.Tag}") + + Evaluates to [|"Heads has tag 0"; "Tails has tag 1"|] + The name of the case. + + + + type Weather = Rainy | Sunny + + typeof<Weather> + |> FSharpType.GetUnionCases + |> Array.map (fun x -> x.Name) + + Evaluates to [|"Rainy", "Sunny"|] + The type in which the case occurs. + + + + type Weather = Rainy | Sunny + + let rainy = + typeof<Weather> + |> FSharpType.GetUnionCases + |> Array.head + + rainy.DeclaringType + + Evaluates to a value of type System.Type + that holds type information for Weather. + The fields associated with the case, represented by a PropertyInfo. The fields associated with the case. + + + + type Shape = + | Rectangle of width : float * length : float + | Circle of radius : float + | Prism of width : float * float * height : float + + typeof<Shape> + |> FSharpType.GetUnionCases + |> Array.map (fun unionCase -> + unionCase.GetFields() + |> Array.map (fun fieldInfo -> + fieldInfo.Name, + fieldInfo.PropertyType.Name)) + + Evaluates to + + [|[|("width", "Double"); ("length", "Double")|]; + [|("radius", "Double")|]; + [|("width", "Double"); ("Item2", "Double"); ("height", "Double")|]|] + + Returns the custom attributes data associated with the case. An list of custom attribute data items. + + + + type Signal(signal: string) = + inherit System.Attribute() + member this.Signal = signal + + type Answer = + | [<Signal("Thumbs up")>] Yes + | [<Signal("Thumbs down")>] No + + let answerYes = + typeof<Answer> + |> FSharpType.GetUnionCases + |> Array.find (fun x -> x.Name = "Yes") + + answerYes.GetCustomAttributesData() + + Evaluates to + + [|[FSI_0150+Signal("Thumbs up")] + {AttributeType = FSI_0150+Signal; + Constructor = Void .ctor(System.String); + ConstructorArguments = seq ["Thumbs up"]; + NamedArguments = seq [];}; + [Microsoft.FSharp.Core.CompilationMappingAttribute((Microsoft.FSharp.Core.SourceConstructFlags)8, (Int32)0)] + {AttributeType = Microsoft.FSharp.Core.CompilationMappingAttribute; + Constructor = Void .ctor(Microsoft.FSharp.Core.SourceConstructFlags, Int32); + ConstructorArguments = seq + [(Microsoft.FSharp.Core.SourceConstructFlags)8; + (Int32)0]; + NamedArguments = seq [];}|] + + Returns the custom attributes associated with the case matching the given attribute type. The type of attributes to return. An array of custom attributes. + + + + type Signal(signal: string) = + inherit System.Attribute() + member this.Signal = signal + + type Answer = + | [<Signal("Thumbs up")>] Yes + | [<Signal("Thumbs down")>] No + + typeof<Answer> + |> FSharpType.GetUnionCases + |> Array.map (fun x -> x.GetCustomAttributes(typeof<Signal>)) + + Evaluates to + + [|[|FSI_0147+Signal {Signal = "Thumbs up"; + TypeId = FSI_0147+Signal;}|]; + [|FSI_0147+Signal {Signal = "Thumbs down"; + TypeId = FSI_0147+Signal;}|]|] + + Returns the custom attributes associated with the case. An array of custom attributes. + + + + type Weather = + | Rainy + | Sunny + + typeof<Weather> + |> FSharpType.GetUnionCases + |> Array.map (fun x -> x.GetCustomAttributes()) + + Evaluates to + + [|[|Microsoft.FSharp.Core.CompilationMappingAttribute + {ResourceName = null; + SequenceNumber = 0; + SourceConstructFlags = UnionCase; + TypeDefinitions = null; + TypeId = Microsoft.FSharp.Core.CompilationMappingAttribute; + VariantNumber = 0;}|]; + [|Microsoft.FSharp.Core.CompilationMappingAttribute + {ResourceName = null; + SequenceNumber = 1; + SourceConstructFlags = UnionCase; + TypeDefinitions = null; + TypeId = Microsoft.FSharp.Core.CompilationMappingAttribute; + VariantNumber = 0;}|]|] + + Represents a case of a discriminated union type @@ -5241,6 +11412,8 @@ Optional flag that denotes accessibility of the private representation. True if the type check is an F# exception. + + Reads all the fields from an F# exception declaration, in declaration order @@ -5253,6 +11426,8 @@ Thrown if the given type is not an exception. An array containing the PropertyInfo of each field in the exception. + + Returns true if the typ is a representation of an F# union type or the runtime type of a value of that type @@ -5261,6 +11436,8 @@ Optional flag that denotes accessibility of the private representation. True if the type check succeeds. + + Return true if the typ is a representation of an F# record type @@ -5269,6 +11446,8 @@ Optional flag that denotes accessibility of the private representation. True if the type check succeeds. + + Gets the cases of a union type. @@ -5281,6 +11460,8 @@ Thrown when the input type is not a union type. An array of descriptions of the cases of the given union type. + + Reads all the fields from a record value, in declaration order @@ -5291,6 +11472,8 @@ Optional flag that denotes accessibility of the private representation. An array of descriptions of the properties of the record type. + + Reads all the fields from a value built using an instance of an F# exception declaration @@ -5303,6 +11486,8 @@ Thrown when the input type is not an F# exception. The fields from the given exception. + + A method that constructs objects of the given case @@ -5311,6 +11496,8 @@ Optional flag that denotes accessibility of the private representation. The description of the constructor of the given union case. + + Precompute a function for constructing a discriminated union value for a particular union case. @@ -5319,6 +11506,8 @@ Optional flag that denotes accessibility of the private representation. A function for constructing values of the given union case. + + Precompute a function for reading all the fields for a particular discriminator case of a union type @@ -5329,6 +11518,8 @@ Optional flag that denotes accessibility of the private representation. A function to for reading the fields of the given union case. + + Precompute a property or static method for reading an integer representing the case tag of a union type. @@ -5337,6 +11528,8 @@ Optional flag that denotes accessibility of the private representation. The description of the union case reader. + + Assumes the given type is a union type. @@ -5350,6 +11543,8 @@ Optional flag that denotes accessibility of the private representation. An optimized function to read the tags of the given union type. + + Identify the union case and its fields for an object @@ -5367,6 +11562,8 @@ Thrown when the input type is not a union case value. The description of the union case and its fields. + + Create a union case value. @@ -5376,6 +11573,8 @@ Optional flag that denotes accessibility of the private representation. The constructed union case. + + Get a ConstructorInfo for a record type @@ -5384,6 +11583,8 @@ Optional flag that denotes accessibility of the private representation. A ConstructorInfo for the given record type. + + Precompute a function for constructing a record value. @@ -5397,6 +11598,8 @@ Thrown when the input type is not a record type. A function to construct records of the given type. + + Precompute a function for reading all the fields from a record. The fields are returned in the @@ -5416,6 +11619,8 @@ Thrown when the input type is not a record type. An optimized reader for the given record type. + + Reads all the fields from a record value. @@ -5428,6 +11633,8 @@ Thrown when the input type is not a record type. The array of fields from the record. + + Creates an instance of a record type. @@ -5441,6 +11648,8 @@ Thrown when the input type is not a record type. The created record. + + Defines further accessing additional information about F# types and F# values at runtime. @@ -5460,14 +11669,6 @@ The ShowIEnumerable is set the printing process will force the evaluation of IEnumerable objects to a small, finite depth, as determined by the printing parameters. This may lead to additional computation being performed during printing. - - <example> - From F# Interactive the default settings can be adjusted using, for example, - <pre> - open FSharp.Compiler.Interactive.Settings;; - setPrintWidth 120;; - </pre> - </example> @@ -5659,6 +11860,17 @@ Gets the raw expression associated with this type-carrying expression + + + + open FSharp.Quotations + + let expr1 = <@ 1 + 1 @> + + expr1.Raw + + Evaluates to the same quotation as <@ expr1 @> except with the weaker type Expr instead of Expr<int>. + Type-carrying quoted expressions. Expressions are generated either @@ -5666,9 +11878,33 @@ Returns type of an expression. + + + + open FSharp.Quotations + open FSharp.Quotations.Patterns + + let sampleQuotation = <@ 1 + 1 @> + + sampleQuotation.Type + + Evaluates to typeof<int>. + - Returns the custom attributes of an expression. + Returns the custom attributes of an expression. For quotations deriving from quotation literals this may include the source location of the literal. + + + + open FSharp.Quotations + open FSharp.Quotations.Patterns + + let sampleQuotation = <@ 1 + 1 @> + + sampleQuotation.CustomAttributes + + Evaluates to a list of expressions containing one custom attribute for the source location of the quotation literal. + Builds an expression that represents a value and its associated reflected definition as a quotation @@ -5678,6 +11914,15 @@ The definition of the value being quoted. The resulting expression. + + + + open FSharp.Quotations + + Expr.WithValue(box 1, typeof<int>, <@ 2 - 1 @>) + + Evaluates to a quotation that displays as WithValue (1, Call (None, op_Subtraction, [Value (2), Value (1)])). + Builds an expression that represents a value and its associated reflected definition as a quotation @@ -5686,6 +11931,15 @@ The definition of the value being quoted. The resulting expression. + + + + open FSharp.Quotations + + Expr.WithValue(1, <@ 2 - 1 @>) + + Evaluates to a quotation that displays as WithValue (1, Call (None, op_Subtraction, [Value (2), Value (1)])). + Builds an expression that represents a while loop @@ -5694,6 +11948,18 @@ The body of the while loop. The resulting expression. + + + + open FSharp.Quotations + + let guardExpr = <@ true @> + let bodyExpr = <@ () @> + + Expr.WhileLoop(guardExpr, bodyExpr) + + Evaluates to a quotation with the same structure as <@ while true do () @>. + Builds an expression that represents setting a mutable variable @@ -5702,6 +11968,17 @@ The value to set. The resulting expression. + + + + open FSharp.Quotations + + let vVar = Var("v", typeof<int>, isMutable=true) + + Expr.VarSet(vVar, <@ 5 @>) + + Evaluates to a quotation displayed as VarSet (v, Value (5)). + Builds an expression that represents a variable @@ -5709,6 +11986,17 @@ The input variable. The resulting expression. + + + + open FSharp.Quotations + + let vVar = Var("v", typeof<int>) + + Expr.Var(vVar) + + Evaluates to a quotation displayed as v. + Builds an expression that represents a constant value of a particular type, arising from a variable of the given name @@ -5718,6 +12006,15 @@ The name of the variable. The resulting expression. + + + + open FSharp.Quotations + + Expr.ValueWithName(box 1, typeof<int>, "name") + + Evaluates to a quotation with the same structure as <@ 1 @> and associated information that the name of the value is "name". + Builds an expression that represents a constant value, arising from a variable of the given name @@ -5726,13 +12023,29 @@ The name of the variable. The resulting expression. + + + + open FSharp.Quotations + + Expr.ValueWithName(1, "name") + + Evaluates to a quotation with the same structure as <@ 1 @> and associated information that the name of the value is "name". + Builds an expression that represents a constant value The typed value. - The resulting expression. + + + open FSharp.Quotations + + Expr.Value(1) + + Evaluates to a quotation with the same structure as <@ 1 @>. + Builds an expression that represents a constant value of a particular type @@ -5741,6 +12054,15 @@ The type of the object. The resulting expression. + + + + open FSharp.Quotations + + Expr.Value(box 1, typeof<int>) + + Evaluates to a quotation with the same structure as <@ 1 @>. + Builds an expression that represents a test of a value is of a particular union case @@ -5749,6 +12071,19 @@ The description of the union case. The resulting expression. + + + + open System + open FSharp.Quotations + open FSharp.Reflection + + let ucCons = FSharpType.GetUnionCases(typeof<int list>)[1] + + Expr.UnionCaseTest(<@ [11] @>, ucCons) + + Evaluates to a quotation that displays as UnionCaseTest (NewUnionCase (Cons, Value (11), NewUnionCase (Empty)), Cons). + Builds an expression that represents a type test. @@ -5757,6 +12092,17 @@ The target type. The resulting expression. + + + + open FSharp.Quotations + + let obj = box 1 + + Expr.TypeTest( <@ obj @>, typeof<int>) + + Evaluates to quotation that displays as TypeTest (Int32, PropertyGet (None, obj, [])). + Builds an expression that represents getting a field of a tuple @@ -5765,6 +12111,17 @@ The index of the tuple element to get. The resulting expression. + + + + open FSharp.Quotations + + let tupExpr = <@ (1, 2, 3) @> + + Expr.TupleGet(tupExpr, 1) + + Evaluates to quotation that displays as TupleGet (NewTuple (Value (1), Value (2), Value (3)), 1). + Builds an expression that represents a try/with construct for exception filtering and catching. @@ -5776,6 +12133,18 @@ The expression evaluated when an exception is caught. The resulting expression. + + + + open System + open FSharp.Quotations + + let exnVar = Var("exn", typeof<exn>) + + Expr.TryWith(<@ 1+1 @>, exnVar, <@ 1 @>, exnVar, <@ 2+2 @>) + + Evaluates to a quotation with the same structure as <@ try 1+1 with exn -> 2+2 @>. + Try and find a stored reflection definition for the given method. Stored reflection @@ -5784,6 +12153,47 @@ The description of the method to find. The reflection definition or None if a match could not be found. + + + + open FSharp.Quotations + open FSharp.Quotations.Patterns + + [<ReflectedDefinition>] + let f x = x + 1 + + let methInfo = + match <@ f 1 @> with + | Call(_, mi, _) -> mi + | _ -> failwith "call expected" + + Expr.TryGetReflectedDefinition(methInfo) + + Evaluates to a quotation with the same structure as <@ fun x -> x + 1 @>, which is the implementation of the + method f. + + + + + open FSharp.Quotations + open FSharp.Quotations.Patterns + + [<ReflectedDefinition>] + module Methods = + let f x = (x, x) + + let methInfoGeneric = + match <@ Methods.f (1, 2) @> with + | Call(_, mi, _) -> mi.GetGenericMethodDefinition() + | _ -> failwith "call expected" + + let methInfoAtString = methInfoGeneric.MakeGenericMethod(typeof<string>) + + Expr.TryGetReflectedDefinition(methInfoAtString) + + Evaluates to a quotation with the same structure as <@ fun (x: string) -> (x, x) @>, which is the implementation of the + generic method f instanatiated at type string. + Builds an expression that represents a try/finally construct @@ -5792,6 +12202,16 @@ The final part of the expression to be evaluated. The resulting expression. + + + + open System + open FSharp.Quotations + + Expr.TryFinally(<@ 1+1 @>, <@ Console.WriteLine("finally") @>) + + Evaluates to a quotation with the same structure as <@ try 1+1 finally Console.WriteLine("finally") @>. + Format the expression as a string @@ -5799,6 +12219,17 @@ Indicates if method, property, constructor and type objects should be printed in detail. If false, these are abbreviated to their name. The formatted string. + + + + open FSharp.Quotations + + let expr1 = <@ 1 + 1 @> + + expr1.ToString(true) + + Evaluates "Call (None, Int32 op_Addition[Int32,Int32,Int32](Int32, Int32),[Value (1), Value (1)])". + Substitutes through the given expression using the given functions @@ -5809,6 +12240,23 @@ The function to map variables into expressions. The expression with the given substitutions. + + + + open FSharp.Quotations + open FSharp.Quotations.Patterns + + let sampleQuotation = <@ fun v -> v * v @> + + let v, body = + match sampleQuotation with + | Lambda(v, body) -> (v, body) + | _ -> failwith "unreachable" + + body.Substitute(function v2 when v = v2 -> Some <@ 1 + 1 @> | _ -> None) + + Evaluates to <@ (1 + 1) * (1 + 1)>. + Builds an expression that represents the sequential execution of one expression followed by another @@ -5817,6 +12265,16 @@ The second expression. The resulting expression. + + + + open System + open FSharp.Quotations + + Expr.Sequential(<@ Console.WriteLine("a") @>, <@ Console.WriteLine("b") @>) + + Evaluates to a quotation with the same structure as <@ Console.WriteLine("a"); Console.WriteLine("b") @>. + Permits interactive environments such as F# Interactive @@ -5827,6 +12285,7 @@ The unique name for the resources being added. The type definitions referenced. The serialized resource to register with the environment. + Permits interactive environments such as F# Interactive @@ -5836,6 +12295,7 @@ The assembly associated with the resource. The unique name for the resources being added. The serialized resource to register with the environment. + Builds an expression that represents a nested typed quotation literal @@ -5843,6 +12303,15 @@ The expression being quoted. The resulting expression. + + + + open FSharp.Quotations + + Expr.QuoteTyped(<@ 1 @>) + + Evaluates to a quotation with the same structure as <@ <@ 1 @> @>. + Builds an expression that represents a nested raw quotation literal @@ -5850,6 +12319,15 @@ The expression being quoted. The resulting expression. + + + + open FSharp.Quotations + + Expr.QuoteRaw(<@ 1 @>) + + Evaluates to a quotation with the same structure as <@ <@ 1 @> @>. + Builds an expression that represents a nested typed or raw quotation literal @@ -5866,6 +12344,23 @@ List of indices for the property if it is an indexed property. The resulting expression. + + + + open System + open System.Collections.Generic + open FSharp.Quotations + open FSharp.Quotations.Patterns + + let propInfo = + match <@ Console.BackgroundColor <- ConsoleColor.Red @> with + | PropertySet(None, pi, _, _) -> pi + | _ -> failwith "property get expected" + + Expr.PropertySet(propInfo, <@ ConsoleColor.Blue @>) + + Evaluates to a quotation with the same structure as <@ Console.BackgroundColor <- ConsoleColor.Blue @>. + Builds an expression that represents writing to a property of an object @@ -5876,6 +12371,25 @@ List of indices for the property if it is an indexed property. The resulting expression. + + + + open System + open System.Collections.Generic + open FSharp.Quotations + open FSharp.Quotations.Patterns + + let propInfo = + match <@ (new List<int>()).Capacity @> with + | PropertyGet(Some _, pi, _) -> pi + | _ -> failwith "property get expected" + + let objExpr = <@ (new List<int>()) @> + + Expr.PropertySet(objExpr, propInfo, <@ 6 @>) + + Evaluates to a quotation with the same structure as <@ (new List<int>()).Capacity <- 6 @>. + Builds an expression that represents reading a static property @@ -5884,6 +12398,22 @@ List of indices for the property if it is an indexed property. The resulting expression. + + + + open System + open FSharp.Quotations + open FSharp.Quotations.Patterns + + let propInfo = + match <@ Console.Out @> with + | PropertyGet(None, pi, _) -> pi + | _ -> failwith "property get expected" + + Expr.PropertyGet(propInfo) + + Evaluates to a quotation with the same structure as <@ Console.Out @>. + Builds an expression that represents reading a property of an object @@ -5893,6 +12423,24 @@ List of indices for the property if it is an indexed property. The resulting expression. + + + + open System + open FSharp.Quotations + open FSharp.Quotations.Patterns + + let propInfo = + match <@ "a".Length @> with + | PropertyGet(Some _, pi, _) -> pi + | _ -> failwith "property get expected" + + let objExpr = <@ "bb" @> + + Expr.PropertyGet(objExpr, propInfo) + + Evaluates to a quotation with the same structure as <@ "bb".Length @>. + Builds an expression that represents the creation of a union case value @@ -5901,6 +12449,19 @@ The list of arguments for the case. The resulting expression. + + + + open System + open FSharp.Quotations + open FSharp.Reflection + + let ucCons = FSharpType.GetUnionCases(typeof<int list>)[1] + + Expr.NewUnionCase(ucCons, [ <@ 10 @>; <@ [11] @> ]) + + Evaluates to a quotation with the same structure as <@ 10 :: [11] @>. + Builds an expression that represents the creation of an F# tuple value @@ -5908,6 +12469,15 @@ The list of elements of the tuple. The resulting expression. + + + + open FSharp.Quotations + + Expr.NewTuple([ <@ 1 @>; <@ "a" @> ]) + + Evaluates to a quotation with the same structure as <@ (1, "a") @>. + Builds an expression that represents the creation of an F# tuple value @@ -5916,6 +12486,15 @@ The list of elements of the tuple. The resulting expression. + + + + open FSharp.Quotations + + Expr.NewStructTuple(typeof<struct (int * int)>.Assembly, [ <@ 1 @>; <@ "a" @> ]) + + Evaluates to a quotation with the same structure as <@ struct (1, "a") @>. + Builds record-construction expressions @@ -5924,6 +12503,17 @@ The list of elements of the record. The resulting expression. + + + + open FSharp.Quotations + + type R = { Y: int; X: string } + + Expr.NewRecord(typeof<R>, [ <@ 1 @>; <@ "a" @> ]) + + Evaluates to a quotation with the same structure as <@ { Y = 1; X = "a" } @>. + Builds an expression that represents the invocation of an object constructor @@ -5932,6 +12522,24 @@ The list of arguments to the constructor. The resulting expression. + + + + open System + open FSharp.Quotations + open FSharp.Quotations.Patterns + + let ctorInfo = + match <@ new System.DateTime(100L) @> with + | NewObject(ci, _) -> ci + | _ -> failwith "call expected" + + let argExpr = <@ 100000L @> + + Expr.NewObject(ctorInfo, [argExpr]) + + Evaluates to a quotation with the same structure as <@ NewObject (DateTime, Value (100000L)) @>. + Builds an expression that represents the creation of a delegate value for the given type @@ -5941,6 +12549,19 @@ The body of the function. The resulting expression. + + + + open System + open FSharp.Quotations + + let vVar = Var("v", typeof<int>) + let vExpr = Expr.Var(vVar) + + Expr.NewDelegate(typeof<Func<int,int>>, [vVar], vExpr) + + Evaluates to a quotation with the same structure as <@ new System.Func<int, int>(fun v -> v) @>. + Builds an expression that represents the creation of an array value initialized with the given elements @@ -5949,6 +12570,15 @@ The list of elements of the array. The resulting expression. + + + + open FSharp.Quotations + + Expr.NewArray(typeof<int>, [ <@ 1 @>; <@ 2 @> ]) + + Evaluates to a quotation with the same structure as <@ [| 1; 2 |] @>. + Builds recursive expressions associated with 'let rec' constructs @@ -5957,6 +12587,25 @@ The sub-expression where the bindings are in scope. The resulting expression. + + + + + open FSharp.Quotations + open FSharp.Quotations.Patterns + + let fVar = Var("f", typeof<int -> int>) + let gVar = Var("v", typeof<int -> int>) + let fExpr = Expr.Var(fVar) + let gExpr = Expr.Var(gVar) + let fImplExpr = <@ fun x -> (%%gExpr : int -> int) (x - 1) + 1 @> + let gImplExpr = <@ fun x -> if x > 0 then (%%fExpr : int -> int) (x - 1) else 0 @> + let bodyExpr = <@ (%%gExpr : int -> int) 10 @> + + Expr.LetRecursive([(fVar, fImplExpr); (gVar, gImplExpr)], bodyExpr) + + Evaluates to a quotation with the same structure as <@ let rec f x = g (x-1) + 1 and g x = if x > 0 then f (x - 1) else 0 in g 10 @>. + Builds expressions associated with 'let' constructs @@ -5966,6 +12615,19 @@ The sub-expression where the binding is in scope. The resulting expression. + + + + open FSharp.Quotations + + let vVar = Var("v", typeof<int>) + let rhsExpr = <@ 6 @> + let vExpr = Expr.Var(vVar) + + Expr.Let(vVar, rhsExpr, vExpr) + + Evaluates to a quotation with the same structure as <@ let v = 6 in v @>. + Builds an expression that represents the construction of an F# function value @@ -5974,6 +12636,19 @@ The body of the function. The resulting expression. + + + + open FSharp.Quotations + open FSharp.Quotations.Patterns + + let vVar = Var("v", typeof<int>) + let vExpr = Expr.Var(vVar) + + Expr.Lambda(vVar, vExpr) + + Evaluates to Lambda (v, v). + Builds 'if ... then ... else' expressions. @@ -5983,6 +12658,19 @@ The else sub-expression. The resulting expression. + + + + open FSharp.Quotations + + let guardExpr = <@ 1 > 3 @> + let thenExpr = <@ 6 @> + let elseExpr = <@ 7 @> + + Expr.IfThenElse(guardExpr, thenExpr, elseExpr) + + Evaluates to a quotation with the same structure as <@ if 1 > 3 then 6 else 7 @>. + Fetches or creates a new variable with the given name and type from a global pool of shared variables @@ -5991,10 +12679,37 @@ The variable name. The created of fetched typed global variable. + + + + open FSharp.Quotations + + let expr1 = Expr.GlobalVar<int>("x") + let expr2 = Expr.GlobalVar<int>("x") + + Evaluates expr1 and expr2 to identical quotations. + Gets the free expression variables of an expression as a list. A sequence of the free variables in the expression. + + + + open FSharp.Quotations + open FSharp.Quotations.Patterns + + let sampleQuotation = <@ fun v -> v * v @> + + let v, body = + match sampleQuotation with + | Lambda(v, body) -> (v, body) + | _ -> failwith "unreachable" + + body.GetFreeVars() + + Evaluates to a set containing the single variable for v + Builds a 'for i = ... to ... do ...' expression that represent loops over integer ranges @@ -6005,6 +12720,20 @@ The sub-expression representing the body of the loop. The resulting expression. + + + + open FSharp.Quotations + + let loopVariable = Var("x", typeof<int>) + let startExpr = <@ 6 @> + let endExpr = <@ 7 @> + let body = <@ System.Console.WriteLine("hello") @> + + Expr.ForIntegerRangeLoop(loopVariable, startExpr, endExpr, body) + + Evaluates to a quotation with the same structure as <@ if 1 > 3 then 6 else 7 @>. + Builds an expression that represents writing to a field of an object @@ -6014,6 +12743,23 @@ The value to set to the field. The resulting expression. + + Create an expression setting a reference cell via the public backing field: + + open FSharp.Quotations + open FSharp.Quotations.Patterns + + let fieldInfo = typeof<int ref>.GetField("contents@") + let refValue = ref 3 + let refExpr = <@ refValue @> + let valueExpr = <@ 6 @> + + Expr.FieldSet(refExpr, fieldInfo, valueExpr) + + Evaluates to FieldSet (Some (PropertyGet (None, refValue, [])), contents@, Value (6)). + Note that for technical reasons the quotation <@ refValue.contents <- 6 @> evaluates to a slightly different quotation + accessing the contents field via a property. + Builds an expression that represents writing to a static field @@ -6022,6 +12768,8 @@ The value to the set to the field. The resulting expression. + + Settable public static fields are rare in F# and .NET libraries, so examples of using this method are uncommon. Builds an expression that represents the access of a field of an object @@ -6030,6 +12778,22 @@ The description of the field to access. The resulting expression. + + + + open FSharp.Quotations + open FSharp.Quotations.Patterns + + let fieldInfo = typeof<int ref>.GetField("contents@") + let refValue = ref 3 + let refExpr = <@ refValue @> + + Expr.FieldGet(refExpr, fieldInfo) + + Evaluates to FieldGet (Some (PropertyGet (None, refValue, [])), contents@). + Note that for technical reasons the quotation <@ refValue.contents @> evaluates to a different quotation + accessing the contents field via a property. + Builds an expression that represents the access of a static field @@ -6037,6 +12801,18 @@ The description of the field to access. The resulting expression. + + + + open FSharp.Quotations + open FSharp.Quotations.Patterns + + let fieldInfo = typeof<System.DayOfWeek>.GetField("Monday") + + Expr.FieldGet(fieldInfo) + + Evaluates to FieldGet (None, Monday). Note that for technical reasons the quotation <@ System.DayOfWeek.Monday @> evaluates to a different quotation containing a constant enum value Value (Monday). + This function is called automatically when quotation syntax (<@ @>) and other sources of @@ -6067,6 +12843,15 @@ The type on which the constructor is invoked. The resulting expression. + + + + open FSharp.Quotations + + Expr.DefaultValue(typeof<int>) + + Evaluates to the quotation DefaultValue (Int32). + Builds an expression that represents the coercion of an expression to a type @@ -6075,6 +12860,17 @@ The target type. The resulting expression. + + + + open FSharp.Quotations + + let expr = <@ box "3" @> + + Expr.Coerce(expr, typeof<string>) + + Evaluates to a quotation with the same structure as <@ (fun x -> x + 1) 3 @>. + Returns a new typed expression given an underlying runtime-typed expression. @@ -6084,9 +12880,20 @@ The expression to cast. The resulting typed expression. + + + + open FSharp.Quotations + + let rawExpr = <@ 1 @> + + Expr.Cast<int>(rawExpr) + + Evaluates with type Expr<int>. + - Builds an expression that represents a call to an instance method associated with an object + Builds an expression that represents a call to an instance method associated with an object, potentially passing additional witness arguments The input object. The description of the method to call. @@ -6095,9 +12902,11 @@ The list of arguments to the method. The resulting expression. + + See examples for Call and CallWithWitnesses - Builds an expression that represents a call to an static method or module-bound function + Builds an expression that represents a call to an static method or module-bound function, potentially passing additional witness arguments The MethodInfo describing the method to call. The additional MethodInfo describing the method to call, accepting witnesses. @@ -6105,6 +12914,38 @@ The list of arguments to the method. The resulting expression. + + In this example, we show how to use a witness to cosntruct an `op_Addition` call for a type that doesn't support addition directly: + + open FSharp.Quotations + open FSharp.Quotations.Patterns + + // Get the entrypoint for inline addition that takes an explicit witness + let addMethInfoG, addMethInfoGW = + match <@ 1+1 @> with + | CallWithWitnesses(None, mi, miW, _, _) -> + mi.GetGenericMethodDefinition(), miW.GetGenericMethodDefinition() + | _ -> + failwith "call expected" + + // Make a non-standard witness for addition for a type C + + type C(value: int) = + member x.Value = value + + let witnessExpr = <@ (fun (x: C) (y: C) -> C(x.Value + y.Value)) @> + let argExpr1 = <@ C(4) @> + let argExpr2 = <@ C(5) @> + + // Instantiate the generic method at the right type + + let addMethInfo = addMethInfoG.MakeGenericMethod(typeof<C>, typeof<C>, typeof<C>) + let addMethInfoW = addMethInfoGW.MakeGenericMethod(typeof<C>, typeof<C>, typeof<C>) + + Expr.CallWithWitnesses(addMethInfo, addMethInfoW, [witnessExpr], [argExpr1; argExpr2]) + + Evaluates to a quotation with the same structure as <@ Call (None, op_Addition, [NewObject (C, Value (4)), NewObject (C, Value (5))]) @>. + Builds an expression that represents a call to an instance method associated with an object @@ -6114,6 +12955,24 @@ The list of arguments to the method. The resulting expression. + + + + open System + open FSharp.Quotations + open FSharp.Quotations.Patterns + + let objExpr, methInfo = + match <@ Console.Out.WriteLine("1") @> with + | Call(Some obj, mi, _) -> obj, mi + | _ -> failwith "call expected" + + let argExpr = <@ "Hello World" @> + + Expr.Call(objExpr, methInfo, [argExpr]) + + Evaluates to a quotation with the same structure as <@ Console.Out.WriteLine("Hello World") @>. + Builds an expression that represents a call to an static method or module-bound function @@ -6122,6 +12981,24 @@ The list of arguments to the method. The resulting expression. + + + + open System + open FSharp.Quotations + open FSharp.Quotations.Patterns + + let methInfo = + match <@ Console.WriteLine("1") @> with + | Call(_, mi, _) -> mi + | _ -> failwith "call expected" + + let argExpr = <@ "Hello World" @> + + Expr.Call(methInfo, [argExpr]) + + Evaluates to a quotation with the same structure as <@ Console.WriteLine("Hello World") @>. + Builds an expression that represents the application of a first class function value to multiple arguments @@ -6130,6 +13007,18 @@ The list of lists of arguments to the function. The resulting expression. + + + + open FSharp.Quotations + + let funcExpr = <@ (fun (x, y) z -> x + y + z) @> + let curriedArgExprs = [[ <@ 1 @>; <@ 2 @> ]; [ <@ 3 @> ]] + + Expr.Applications(funcExpr, curriedArgExprs) + + Evaluates to a quotation with the same structure as <@ (fun (x, y) z -> x + y + z) (1,2) 3 @>. + Builds an expression that represents the application of a first class function value to a single argument. @@ -6138,6 +13027,18 @@ The argument to the function. The resulting expression. + + + + open FSharp.Quotations + + let funcExpr = <@ (fun x -> x + 1) @> + let argExpr = <@ 3 @> + + Expr.Application(funcExpr, argExpr) + + Evaluates to a quotation with the same structure as <@ (fun x -> x + 1) 3 @>. + Builds an expression that represents setting the value held at a particular address. @@ -6146,6 +13047,19 @@ The value to set at the address. The resulting expression. + + + + open FSharp.Quotations + + let array = [| 1; 2; 3 |] + + let addrExpr = Expr.AddressOf(<@ array.[1] @>) + + Expr.AddressSet(addrExpr, <@ 4 @>) + + Evaluates to AddressSet (AddressOf (Call (None, GetArray, [PropertyGet (None, array, []), Value (1)])), Value (4)). + Builds an expression that represents getting the address of a value. @@ -6153,18 +13067,65 @@ The target expression. The resulting expression. + + + + open FSharp.Quotations + + let array = [| 1; 2; 3 |] + + Expr.AddressOf(<@ array.[1] @>) + + Evaluates to AddressOf (Call (None, GetArray, [PropertyGet (None, array, []), Value (1)])). + Quoted expressions annotated with System.Type values. The type associated with the variable + + + + open FSharp.Quotations + open FSharp.Quotations.Patterns + + match <@ fun v -> v @> with + | Lambda(v, body) -> v.Type + | _ -> failwith "unreachable" + + Evaluates to typeof<int> + The declared name of the variable + + + + open FSharp.Quotations + open FSharp.Quotations.Patterns + + match <@ fun v -> v @> with + | Lambda(v, body) -> v.Name + | _ -> failwith "unreachable" + + Evaluates to "v" + Indicates if the variable represents a mutable storage location + + + + open FSharp.Quotations + open FSharp.Quotations.Patterns + + match <@ fun v -> v @> with + | Lambda(v, body) -> v.IsMutable + | _ -> failwith "unreachable" + + Evaluates to false. + Fetches or create a new variable with the given name and type from a global pool of shared variables @@ -6174,6 +13135,17 @@ The type associated with the variable. The retrieved or created variable. + + + + open FSharp.Quotations + open FSharp.Quotations.Patterns + + let valueVar1 = Var.Global("value", typeof<int>) + let valueVar2 = Var.Global("value", typeof<int>) + + Evaluates both to valueVar1 and valueVar2 to the same variable from a global pool of shared variables. + Creates a new variable with the given name, type and mutability @@ -6183,13 +13155,23 @@ Indicates if the variable represents a mutable storage location. Default is false. The created variable. + + + + open FSharp.Quotations + open FSharp.Quotations.Patterns + + let valueVar = Var("value"), typeof<int>) + + Evaluates to a new quotation variable with the given name and type. + Information at the binding site of a variable Library functionality for F# quotations. - See also F# Code Quotations in the F# Language Guide. + See also F# Code Quotations in the F# Language Guide. @@ -6200,6 +13182,8 @@ The list of arguments. The rebuilt expression. + + An active pattern that performs a complete decomposition viewing the expression tree as a binding structure @@ -6207,6 +13191,8 @@ The input expression. The decomposed Var, Lambda, or ConstApp. + + Active patterns for traversing, visiting, rebuilding and transforming expressions in a generic way @@ -6217,6 +13203,29 @@ The description of the property. The expression of the method definition if found, or None. + + + + open FSharp.Quotations + open FSharp.Quotations.Patterns + open FSharp.Quotations.DerivedPatterns + + [<ReflectedDefinition>] + type C<'T>() = + member x.Count with set (v: int) = () + + let inpExpr = <@ C<int>().Count <- 3 @> + + let implExpr = + match inpExpr with + | PropertySet(Some _, PropertySetterWithReflectedDefinition implExpr, [], _valueExpr) -> implExpr + | _ -> failwith "unexpected" + + Evaluates implExpr to a quotation with the same structure as <@ fun (x: C<int>) (v: int) -> () @>, which is the implementation of the + setter for the property Count. Note that the correct generic instantaition has been applied to the implementation to reflect + the the type at the callsite. + + An active pattern to recognize property getters or values in modules that have an associated ReflectedDefinition @@ -6224,6 +13233,29 @@ The description of the property. The expression of the method definition if found, or None. + + + + open FSharp.Quotations + open FSharp.Quotations.Patterns + open FSharp.Quotations.DerivedPatterns + + [<ReflectedDefinition>] + type C<'T>() = + member x.Identity = x + + let inpExpr = <@ C<int>().Identity @> + + let implExpr = + match inpExpr with + | PropertyGet(Some _, PropertyGetterWithReflectedDefinition implExpr, [ ]) -> implExpr + | _ -> failwith "unexpected" + + Evaluates implExpr to a quotation with the same structure as <@ fun (x: C<int>) () -> x @>, which is the implementation of the + property Identity. Note that the correct generic instantaition has been applied to the implementation to reflect + the the type at the callsite. + + An active pattern to recognize methods that have an associated ReflectedDefinition @@ -6231,6 +13263,28 @@ The description of the method. The expression of the method definition if found, or None. + + + + open FSharp.Quotations + open FSharp.Quotations.Patterns + open FSharp.Quotations.DerivedPatterns + + [<ReflectedDefinition>] + let f x = (x, x) + + let inpExpr = <@ f 4 @> + + let implExpr = + match inpExpr with + | Call(None, MethodWithReflectedDefinition implExpr, [ _argExpr ]) -> implExpr + | _ -> failwith "unexpected" + + Evaluates implExpr to a quotation with the same structure as <@ fun (x: int) -> (x, x) @>, which is the implementation of the + method f. Note that the correct generic instantaition has been applied to the implementation to reflect + the the type at the callsite. + + A parameterized active pattern to recognize calls to a specified function or method. @@ -6243,6 +13297,38 @@ The optional target object (present if the target is an instance method), the generic type instantiation (non-empty if the target is a generic instantiation), and the arguments to the function or method. + + Match a specific call to Console.WriteLine taking one string argument: + + open FSharp.Quotations + open FSharp.Quotations.Patterns + open FSharp.Quotations.DerivedPatterns + + let inpExpr = <@ Console.WriteLine("hello") @> + + match inpExpr with + | SpecificCall <@ Console.WriteLine("1") @> (None, [], [ argExpr ]) -> argExpr + | _ -> failwith "unexpected" + + Evaluates to a quotation with the same structure as <@ "hello" @>. + + + Calls to this active pattern can be partially applied to pre-evaluate some aspects of the matching. For example: + + open FSharp.Quotations + open FSharp.Quotations.Patterns + open FSharp.Quotations.DerivedPatterns + + let (|ConsoleWriteLineOneArg|_|) = (|SpecificCall|_|) <@ Console.WriteLine("1") @> + + let inpExpr = <@ Console.WriteLine("hello") @> + + match inpExpr with + | ConsoleWriteLineOneArg (None, [], [ argExpr ]) -> argExpr + | _ -> failwith "unexpected" + + Evaluates to a quotation with the same structure as <@ "hello" @>. + An active pattern to recognize constant decimal expressions @@ -6250,6 +13336,17 @@ The input expression to match against. When successful, the pattern binds the constant value from the input expression + + + + open FSharp.Quotations.DerivedPatterns + + match <@ 8.0M @> with + | Decimal v -> v + | _ -> failwith "unexpected" + + Evaluates to 8.0M. + An active pattern to recognize constant unsigned int64 expressions @@ -6257,6 +13354,17 @@ The input expression to match against. When successful, the pattern binds the constant value from the input expression + + + + open FSharp.Quotations.DerivedPatterns + + match <@ 8UL @> with + | UInt64 v -> v + | _ -> failwith "unexpected" + + Evaluates to 8UL. + An active pattern to recognize constant int64 expressions @@ -6264,6 +13372,17 @@ The input expression to match against. When successful, the pattern binds the constant value from the input expression + + + + open FSharp.Quotations.DerivedPatterns + + match <@ 8L @> with + | Int64 v -> v + | _ -> failwith "unexpected" + + Evaluates to 8L. + An active pattern to recognize constant unsigned int32 expressions @@ -6271,6 +13390,17 @@ The input expression to match against. When successful, the pattern binds the constant value from the input expression + + + + open FSharp.Quotations.DerivedPatterns + + match <@ 8u @> with + | UInt32 v -> v + | _ -> failwith "unexpected" + + Evaluates to 8u. + An active pattern to recognize constant int32 expressions @@ -6278,6 +13408,17 @@ The input expression to match against. When successful, the pattern binds the constant value from the input expression + + + + open FSharp.Quotations.DerivedPatterns + + match <@ 8 @> with + | Int32 v -> v + | _ -> failwith "unexpected" + + Evaluates to 8. + An active pattern to recognize constant unsigned int16 expressions @@ -6285,6 +13426,17 @@ The input expression to match against. When successful, the pattern binds the constant value from the input expression + + + + open FSharp.Quotations.DerivedPatterns + + match <@ 8us @> with + | UInt16 v -> v + | _ -> failwith "unexpected" + + Evaluates to 8us. + An active pattern to recognize constant int16 expressions @@ -6292,6 +13444,17 @@ The input expression to match against. When successful, the pattern binds the constant value from the input expression + + + + open FSharp.Quotations.DerivedPatterns + + match <@ 8s @> with + | Int16 v -> v + | _ -> failwith "unexpected" + + Evaluates to 8s. + An active pattern to recognize constant byte expressions @@ -6299,6 +13462,17 @@ The input expression to match against. When successful, the pattern binds the constant value from the input expression + + + + open FSharp.Quotations.DerivedPatterns + + match <@ 8uy @> with + | Byte v -> v + | _ -> failwith "unexpected" + + Evaluates to 8uy. + An active pattern to recognize constant signed byte expressions @@ -6306,6 +13480,17 @@ The input expression to match against. When successful, the pattern binds the constant value from the input expression + + + + open FSharp.Quotations.DerivedPatterns + + match <@ 8y @> with + | SByte v -> v + | _ -> failwith "unexpected" + + Evaluates to 8y. + An active pattern to recognize constant unicode character expressions @@ -6313,6 +13498,17 @@ The input expression to match against. When successful, the pattern binds the constant value from the input expression + + + + open FSharp.Quotations.DerivedPatterns + + match <@ 'a' @> with + | Char v -> v + | _ -> failwith "unexpected" + + Evaluates to 'a'. + An active pattern to recognize constant 64-bit floating point number expressions @@ -6320,6 +13516,17 @@ The input expression to match against. When successful, the pattern binds the constant value from the input expression + + + + open FSharp.Quotations.DerivedPatterns + + match <@ 1.0 @> with + | Double v -> v + | _ -> failwith "unexpected" + + Evaluates to 1.0. + An active pattern to recognize constant 32-bit floating point number expressions @@ -6327,6 +13534,17 @@ The input expression to match against. When successful, the pattern binds the constant value from the input expression + + + + open FSharp.Quotations.DerivedPatterns + + match <@ 1.0f @> with + | Single v -> v + | _ -> failwith "unexpected" + + Evaluates to 1.0f. + An active pattern to recognize constant string expressions @@ -6334,6 +13552,17 @@ The input expression to match against. When successful, the pattern binds the constant value from the input expression + + + + open FSharp.Quotations.DerivedPatterns + + match <@ "a" @> with + | String v -> v + | _ -> failwith "unexpected" + + Evaluates to "a". + An active pattern to recognize constant boolean expressions @@ -6341,6 +13570,17 @@ The input expression to match against. When successful, the pattern binds the constant value from the input expression + + + + open FSharp.Quotations.DerivedPatterns + + match <@ true @> with + | Bool v -> v + | _ -> failwith "unexpected" + + Evaluates to true. + An active pattern to recognize () constant expressions @@ -6348,6 +13588,17 @@ The input expression to match against. When successful, the pattern does not bind any results + + + + open FSharp.Quotations.DerivedPatterns + + match <@ () @> with + | Unit v -> v + | _ -> failwith "unexpected" + + Evaluates to true. + An active pattern to recognize expressions of the form a || b @@ -6355,6 +13606,17 @@ The input expression to match against. When successful, the pattern binds the left and right parts of the input expression + + + + open FSharp.Quotations.DerivedPatterns + + match <@ true || false @> with + | OrElse (a, b) -> (a, b) + | _ -> failwith "unexpected" + + Evaluates to <@ true @>, <@ false @>. + An active pattern to recognize expressions of the form a && b @@ -6362,6 +13624,17 @@ The input expression to match against. When successful, the pattern binds the left and right parts of the input expression + + + + open FSharp.Quotations.DerivedPatterns + + match <@ true && false @> with + | AndAlso (a, b) -> (a, b) + | _ -> failwith "unexpected" + + Evaluates to <@ true @>, <@ false @>. + An active pattern to recognize expressions that represent the application of a (possibly curried or tupled) first class function value @@ -6369,6 +13642,19 @@ The input expression to match against. When successful, the pattern binds the function and curried arguments of the input expression + + + + open FSharp.Quotations.Patterns + open FSharp.Quotations.DerivedPatterns + + match <@ (fun f -> f (1, 2) 3) @> with + | Lambda(_, Applications (f, curriedArgs)) -> + curriedArgs |> List.map (fun args -> args.Length) + | _ -> failwith "unexpected" + + Evaluates to [2; 1]. + An active pattern to recognize expressions that represent a (possibly curried or tupled) first class function value @@ -6376,6 +13662,19 @@ The input expression to match against. When successful, the pattern binds the curried variables and body of the input expression + + + + open FSharp.Quotations.Patterns + open FSharp.Quotations.DerivedPatterns + + match <@ (fun (a1, a2) b -> ()) @> with + | Lambdas(curriedVars, _) -> + curriedVars |> List.map (List.map (fun arg -> arg.Name)) + | _ -> failwith "unexpected" + + Evaluates to [["a1"; "a2"]; ["b"]]. + Contains a set of derived F# active patterns to analyze F# expression objects @@ -6386,6 +13685,8 @@ The input expression to match against. When successful, the pattern binds the variable and value expression of the input expression + + An active pattern to recognize expressions that represent a variable @@ -6393,6 +13694,8 @@ The input expression to match against. When successful, the pattern binds the variable of the input expression + + An active pattern to recognize expressions that are a value with an associated definition @@ -6400,6 +13703,8 @@ The input expression to match against. When successful, the pattern binds the boxed value, its static type and its definition + + An active pattern to recognize expressions that represent a constant value @@ -6407,6 +13712,8 @@ The input expression to match against. When successful, the pattern binds the boxed value, its static type and its name + + An active pattern to recognize expressions that represent a constant value. This also matches expressions matched by ValueWithName. @@ -6414,6 +13721,8 @@ The input expression to match against. When successful, the pattern binds the boxed value and its static type + + An active pattern to recognize expressions that represent a test if a value is of a particular union case @@ -6421,6 +13730,8 @@ The input expression to match against. When successful, the pattern binds the expression and union case being tested + + An active pattern to recognize expressions that represent a dynamic type test @@ -6428,6 +13739,8 @@ The input expression to match against. When successful, the pattern binds the expression and type being tested + + An active pattern to recognize expressions that represent getting a tuple field @@ -6435,6 +13748,8 @@ The input expression to match against. When successful, the pattern binds the expression and tuple field being accessed + + An active pattern to recognize expressions that represent a try/finally construct @@ -6442,6 +13757,8 @@ The input expression to match against. When successful, the pattern binds the body and handler parts of the try/finally expression + + An active pattern to recognize expressions that represent a try/with construct for exception filtering and catching @@ -6449,6 +13766,8 @@ The input expression to match against. When successful, the pattern binds the body, exception variable, filter expression and catch expression of the input expression + + An active pattern to recognize expressions that represent sequential execution of one expression followed by another @@ -6456,6 +13775,8 @@ The input expression to match against. When successful, the pattern binds the two sub-expressions of the input expression + + An active pattern to recognize expressions that represent a nested typed quotation literal @@ -6463,6 +13784,8 @@ The input expression to match against. When successful, the pattern binds the nested quotation expression of the input expression + + An active pattern to recognize expressions that represent a nested raw quotation literal @@ -6470,6 +13793,8 @@ The input expression to match against. When successful, the pattern binds the nested quotation expression of the input expression + + An active pattern to recognize expressions that represent a nested quotation literal @@ -6477,6 +13802,8 @@ The input expression to match against. When successful, the pattern binds the nested quotation expression of the input expression + + An active pattern to recognize expressions that represent setting a static or instance property, or a non-function value declared in a module @@ -6484,6 +13811,8 @@ The input expression to match against. When successful, the pattern binds the object, property, indexer arguments and setter value of the input expression + + An active pattern to recognize expressions that represent the read of a static or instance property, or a non-function value declared in a module @@ -6491,6 +13820,8 @@ The input expression to match against. When successful, the pattern binds the object, property and indexer arguments of the input expression + + An active pattern to recognize expressions that represent construction of struct tuple values @@ -6498,6 +13829,8 @@ The input expression to match against. When successful, the pattern binds the element expressions of the input expression + + An active pattern to recognize expressions that represent construction of tuple values @@ -6505,6 +13838,8 @@ The input expression to match against. When successful, the pattern binds the element expressions of the input expression + + An active pattern to recognize expressions that represent construction of particular union case values @@ -6512,6 +13847,8 @@ The input expression to match against. When successful, the pattern binds the union case and field values of the input expression + + An active pattern to recognize expressions that represent construction of record values @@ -6519,6 +13856,8 @@ The input expression to match against. When successful, the pattern binds the record type and field values of the input expression + + An active pattern to recognize expressions that represent invocation of object constructors @@ -6526,6 +13865,8 @@ The input expression to match against. When successful, the pattern binds the constructor and arguments of the input expression + + An active pattern to recognize expressions that represent construction of delegate values @@ -6533,6 +13874,8 @@ The input expression to match against. When successful, the pattern binds the delegate type, argument parameters and body of the input expression + + An active pattern to recognize expressions that represent invocations of a default constructor of a struct @@ -6540,6 +13883,8 @@ The input expression to match against. When successful, the pattern binds the relevant type of the input expression + + An active pattern to recognize expressions that represent the construction of arrays @@ -6547,6 +13892,8 @@ The input expression to match against. When successful, the pattern binds the element type and values of the input expression + + An active pattern to recognize expressions that represent recursive let bindings of one or more variables @@ -6554,6 +13901,8 @@ The input expression to match against. When successful, the pattern binds the bindings and body of the input expression + + An active pattern to recognize expressions that represent let bindings @@ -6561,6 +13910,8 @@ The input expression to match against. When successful, the pattern binds the variable, binding expression and body of the input expression + + An active pattern to recognize expressions that represent first class function values @@ -6568,6 +13919,8 @@ The input expression to match against. When successful, the pattern binds the variable and body of the input expression + + An active pattern to recognize expressions that represent conditionals @@ -6575,6 +13928,8 @@ The input expression to match against. When successful, the pattern binds the condition, then-branch and else-branch of the input expression + + An active pattern to recognize expressions that represent while loops @@ -6582,6 +13937,8 @@ The input expression to match against. When successful, the pattern binds the guard and body of the input expression + + An active pattern to recognize expressions that represent loops over integer ranges @@ -6589,6 +13946,8 @@ The input expression to match against. When successful, the pattern binds the value, start, finish and body of the input expression + + An active pattern to recognize expressions that represent setting a static or instance field @@ -6596,6 +13955,8 @@ The input expression to match against. When successful, the pattern binds the object, field and value of the input expression + + An active pattern to recognize expressions that represent getting a static or instance field @@ -6603,6 +13964,8 @@ The input expression to match against. When successful, the pattern binds the object and field of the input expression + + An active pattern to recognize expressions that represent coercions from one type to another @@ -6610,6 +13973,8 @@ The input expression to match against. When successful, the pattern binds the source expression and target type of the input expression + + An active pattern to recognize expressions that represent calls to static and instance methods, and functions defined in modules, including witness arguments @@ -6617,6 +13982,8 @@ The input expression to match against. When successful, the pattern binds the object, method, witness-argument and argument sub-expressions of the input expression + + An active pattern to recognize expressions that represent calls to static and instance methods, and functions defined in modules @@ -6624,6 +13991,8 @@ The input expression to match against. When successful, the pattern binds the object, method and argument sub-expressions of the input expression + + An active pattern to recognize expressions that represent applications of first class function values @@ -6631,6 +14000,8 @@ The input expression to match against. When successful, the pattern binds the function and argument of the input expression + + An active pattern to recognize expressions that represent setting the value held at an address @@ -6638,6 +14009,8 @@ The input expression to match against. When successful, the pattern binds the target and value expressions of the input expression + + An active pattern to recognize expressions that represent getting the address of a value @@ -6645,16 +14018,60 @@ The input expression to match against. When successful, the pattern binds the sub-expression of the input AddressOf expression + + Contains a set of primitive F# active patterns to analyze F# expression objects - - Converts a given typed native pointer to a managed pointer. + + Copies a block of memory to a specified destination address starting from a specified source address until a specified byte count of (count * sizeof<'T>). + + The destination pointer. + The source pointer. + The source pointer. + + + + + Copies a value to a specified destination address from a specified source address. + + The destination pointer. + The source pointer. + + + + + Initializes a specified block of memory starting at a specific address to a given byte count and initial byte value. + + The input pointer. + The initial byte value. + The total repeat count of the byte value. + + + + + Clears the value stored at the location of a given native pointer. + + The input pointer. + + + + + Tests whether the given native pointer is null. The input pointer. - The managed pointer. + Whether the given native pointer is null. + + + + + Gets the null native pointer. + + The null native pointer. + + Allocates a region of memory on the stack. @@ -6662,6 +14079,8 @@ The number of objects of type T to allocate. A typed pointer to the allocated memory. + + Assigns the value into the memory location referenced by the typed native @@ -6670,12 +14089,16 @@ The input pointer. The index by which to offset the pointer. The value to assign. + + Assigns the value into the memory location referenced by the given typed native pointer. The input pointer. The value to assign. + + Dereferences the given typed native pointer. @@ -6683,6 +14106,8 @@ The input pointer. The value at the pointer address. + + Dereferences the typed native pointer computed by adding index * sizeof<'T> to the @@ -6692,42 +14117,82 @@ The index by which to offset the pointer. The value at the pointer address. + + Returns a typed native pointer by adding index * sizeof<'T> to the given input pointer. - The input pointer. - The index by which to offset the pointer. + The input pointer. + The index by which to offset the pointer. + + A typed pointer. + + + + + Converts a given typed native pointer to a managed pointer. + + The typed native pointer. + + The managed pointer. + + + + + Returns a Common IL (Intermediate Language) signature pointer for a given typed native pointer. + + The typed native pointer. + + A Common IL signature pointer. + + + + + Returns a typed native pointer for a Common IL (Intermediate Language) signature pointer. + + The Common IL signature pointer. - A typed pointer. + A typed native pointer. + + - - Returns a machine address for a given typed native pointer. + + Returns an untyped native pointer for a given typed native pointer. - The input pointer. + The typed native pointer. - The machine address. + An untyped native pointer. + + Returns a typed native pointer for a untyped native pointer. - The untyped pointer. + The untyped native pointer. - A typed pointer. + A typed native pointer. + + - - Returns an untyped native pointer for a given typed pointer. + + Returns a machine address for a given typed native pointer. - The pointer address. + The typed native pointer. - A typed pointer. + The machine address. + + Returns a typed native pointer for a given machine address. - The pointer address. - A typed pointer. + The machine address. + + A typed native pointer. + + Contains operations on native pointers. Use of these operators may @@ -6762,6 +14227,8 @@ Remove a listener delegate from an event listener store. The delegate to be removed from the event listener store. + + Connect a handler delegate object to the event. A handler can @@ -6769,6 +14236,8 @@ be invoked when the event is fired. A delegate to be invoked when the event is fired. + + First class event values for arbitrary delegate types. @@ -6789,16 +14258,22 @@ Lazy Computation - Publishes an observation as a first class value. + Publishes the event as a first class value. + + - Triggers an observation using the given parameters. + Triggers the event using the given parameters. The event parameters. + + Creates an observable object. The created event. + + Event implementations for the IEvent<_> type. @@ -6807,16 +14282,22 @@ Publishes the event as a first class event value. + + Triggers the event using the given sender object and parameters. The sender object may be null. The object triggering the event. The parameters for the event. + + Creates an event object suitable for delegate types following the standard .NET Framework convention of a first 'sender' argument. The created event. + + Event implementations for a delegate types following the standard .NET Framework convention of a first 'sender' argument. @@ -6825,14 +14306,20 @@ Publishes the event as a first class event value. + + Triggers the event using the given parameters. The parameters for the event. + + Creates an event object suitable for implementing an arbitrary type of delegate. The event object. + + Event implementations for an arbitrary type of delegate. @@ -6847,6 +14334,8 @@ The existence of this method permits the use of empty else branches in the async { ... } computation expression syntax. An asynchronous computation that returns (). + + Creates an asynchronous computation that runs computation repeatedly @@ -6862,6 +14351,8 @@ of a while expression. An asynchronous computation that behaves similarly to a while loop when run. + + Creates an asynchronous computation that runs binder(resource). @@ -6878,6 +14369,8 @@ computation. An asynchronous computation that binds and eventually disposes resource. + + Creates an asynchronous computation that runs computation and returns its result. @@ -6893,6 +14386,8 @@ An asynchronous computation that executes computation and calls catchHandler if an exception is thrown. + + Creates an asynchronous computation that runs computation. The action compensation is executed @@ -6910,6 +14405,8 @@ An asynchronous computation that executes computation and compensation afterwards or when an exception is raised. + + Delegates to the input computation. @@ -6920,6 +14417,8 @@ The input computation. The input computation. + + Creates an asynchronous computation that returns the result v. @@ -6932,6 +14431,8 @@ The value to return from the computation. An asynchronous computation that returns value when executed. + + Creates an asynchronous computation that enumerates the sequence seq @@ -6948,6 +14449,8 @@ An asynchronous computation that will enumerate the sequence and run body for each element. + + Creates an asynchronous computation that runs generator. @@ -6957,6 +14460,8 @@ The function to run. An asynchronous computation that runs generator. + + Creates an asynchronous computation that first runs computation1 @@ -6971,6 +14476,8 @@ The second part of the sequenced computation. An asynchronous computation that runs both of the computations sequentially. + + Creates an asynchronous computation that runs computation, and when @@ -6986,6 +14493,8 @@ An asynchronous computation that performs a monadic bind on the result of computation. + + @@ -7004,6 +14513,15 @@ The F# compiler emits calls to this function to implement F# async expressions. A value indicating asynchronous execution. + + + + + The F# compiler emits calls to this function to implement F# async expressions. + + A value indicating asynchronous execution. + + @@ -7014,14 +14532,20 @@ The F# compiler emits calls to this function to implement F# async expressions. A value indicating asynchronous execution. + + The F# compiler emits calls to this function to implement F# async expressions. + + The F# compiler emits calls to this function to implement F# async expressions. A value indicating asynchronous execution. + + @@ -7044,6 +14568,8 @@ The default CancellationToken. Cancellation and Exceptions + + Creates an asynchronous computation that returns the CancellationToken governing the execution @@ -7056,6 +14582,8 @@ expression. Cancellation and Exceptions + + Creates an asynchronous computation that executes computation. @@ -7069,6 +14597,8 @@ is cancelled. Cancellation and Exceptions + + Creates an asynchronous computation that queues a work item that runs @@ -7077,6 +14607,8 @@ A computation that generates a new work item in the thread pool. Threads and Contexts + + Creates an asynchronous computation that creates a new thread and runs @@ -7085,6 +14617,8 @@ A computation that will execute on a new thread. Threads and Contexts + + Creates an asynchronous computation that runs @@ -7096,6 +14630,11 @@ An asynchronous computation that uses the syncContext context to execute. Threads and Contexts + + + + + Runs an asynchronous computation, starting immediately on the current operating system @@ -7112,6 +14651,8 @@ The default is used if this parameter is not provided. Starting Async Computations + + Runs an asynchronous computation, starting immediately on the current operating system @@ -7131,6 +14672,8 @@ in the corresponding state once the computation terminates (produces the result, throws exception or gets canceled) Starting Async Computations + + Runs an asynchronous computation, starting immediately on the current operating system @@ -7143,11 +14686,15 @@ The default is used if this parameter is not provided. Starting Async Computations + + Creates an asynchronous computation which starts the given computation as a Starting Async Computations + + Starts a child computation within an asynchronous workflow. @@ -7155,7 +14702,7 @@ This method should normally be used as the immediate right-hand-side of a let! binding in an F# asynchronous workflow, that is, - + async { ... let! completor1 = childComputation1 |> Async.StartChild let! completor2 = childComputation2 |> Async.StartChild @@ -7176,6 +14723,8 @@ A new computation that waits for the input computation to finish. Cancellation and Exceptions + + Executes a computation in the thread pool. @@ -7186,6 +14735,8 @@ in the corresponding state once the computation terminates (produces the result, throws exception or gets canceled) Starting Async Computations + + Starts the asynchronous computation in the thread pool. Do not await its result. @@ -7197,6 +14748,8 @@ If one is not supplied, the default cancellation token is used. Starting Async Computations + + @@ -7212,6 +14765,8 @@ Thrown when the due time is negative. Awaiting Results + + @@ -7228,6 +14783,8 @@ and not infinite. Awaiting Results + + Creates an asynchronous computation that executes all the given asynchronous computations sequentially. @@ -7246,6 +14803,8 @@ A computation that returns an array of values from the sequence of input computations. Composing Async Computations + + Runs the asynchronous computation and await its result. @@ -7269,6 +14828,8 @@ The result of the computation. Starting Async Computations + + Creates an asynchronous computation that executes all the given asynchronous computations, @@ -7289,6 +14850,8 @@ A computation that returns an array of values from the sequence of input computations. Composing Async Computations + + Creates an asynchronous computation that executes all the given asynchronous computations, @@ -7308,6 +14871,8 @@ A computation that returns an array of values from the sequence of input computations. Composing Async Computations + + Generates a scoped, cooperative cancellation handler for use within an asynchronous workflow. @@ -7327,6 +14892,8 @@ before being disposed. Cancellation and Exceptions + + Creates an asynchronous computation that runs the given computation and ignores @@ -7337,6 +14904,8 @@ A computation that is equivalent to the input computation, but disregards the result. Composing Async Computations + + Creates an asynchronous computation that captures the current @@ -7349,6 +14918,8 @@ An asynchronous computation that provides the callback with the current continuations. Composing Async Computations + + Creates an asynchronous computation in terms of a Begin/End pair of actions in @@ -7371,6 +14942,8 @@ An asynchronous computation wrapping the given Begin/End functions. Legacy .NET Async Interoperability + + @@ -7393,6 +14966,8 @@ An asynchronous computation wrapping the given Begin/End functions. Legacy .NET Async Interoperability + + @@ -7416,6 +14991,8 @@ An asynchronous computation wrapping the given Begin/End functions. Legacy .NET Async Interoperability + + @@ -7438,6 +15015,8 @@ An asynchronous computation wrapping the given Begin/End functions. Legacy .NET Async Interoperability + + Creates an asynchronous computation that executes all given asynchronous computations in parallel, @@ -7457,6 +15036,8 @@ A computation that returns the first succeeding computation. Composing Async Computations + + Creates an asynchronous computation that executes computation. @@ -7469,6 +15050,8 @@ A computation that returns a choice of type T or exception. Cancellation and Exceptions + + Raises the cancellation condition for the most recent set of asynchronous computations started @@ -7477,6 +15060,8 @@ specific CancellationToken. Cancellation and Exceptions + + Creates an asynchronous computation that will wait on the given WaitHandle. @@ -7490,6 +15075,8 @@ An asynchronous computation that waits on the given WaitHandle. Awaiting Results + + Return an asynchronous computation that will wait for the given task to complete and return @@ -7509,6 +15096,8 @@ Awaiting Results + + Return an asynchronous computation that will wait for the given task to complete and return @@ -7528,6 +15117,8 @@ Awaiting Results + + Creates an asynchronous computation that will wait on the IAsyncResult. @@ -7541,6 +15132,8 @@ An asynchronous computation that waits on the given IAsyncResult. Awaiting Results + + Creates an asynchronous computation that waits for a single invocation of a CLI @@ -7561,6 +15154,8 @@ An asynchronous computation that waits for the event to be invoked. Awaiting Results + + Creates three functions that can be used to implement the .NET 1.0 Asynchronous @@ -7572,6 +15167,8 @@ A tuple of the begin, end, and cancel members. Legacy .NET Async Interoperability + + Holds static members for creating and manipulating asynchronous computations. @@ -7604,25 +15201,143 @@ Async Programming + + + The entry point for the dynamic implementation of the corresponding operation. Do not use directly, only used when executing quotations that involve tasks or other reflective execution of F# code. + + + + + Hosts the task code in a state machine and starts the task, executing in the threadpool using Task.Run + + + + + Contains methods to build tasks using the F# computation expression syntax + + + + + The entry point for the dynamic implementation of the corresponding operation. Do not use directly, only used when executing quotations that involve tasks or other reflective execution of F# code. + + + + + Hosts the task code in a state machine and starts the task. + + + + + Contains methods to build tasks using the F# computation expression syntax + + + + + Specifies a unit of task code which produces no result + + + + + Specifies the iterative execution of a unit of task code. + + + + + Specifies a unit of task code which excuted using try/with semantics + + + + + Specifies a unit of task code which excuted using try/finally semantics + + + + + Specifies a unit of task code which returns a value + + + + + Specifies the iterative execution of a unit of task code. + + + + + Specifies the delayed execution of a unit of task code. + + + + + Specifies the sequential composition of two units of task code. + + + + + Contains methods to build tasks using the F# computation expression syntax + + + + + A special compiler-recognised delegate type for specifying blocks of task code + with access to the state machine. + + + + + Represents the runtime continuation of a task state machine created dynamically + + + + + This is used by the compiler as a template for creating state machine structs + + + + + Holds the MethodBuilder for the state machine + + + + + Holds the final result of the state machine + + + + + The extra data stored in ResumableStateMachine for tasks + + Raises a timeout exception if a message not received in this amount of time. By default no timeout is used. + + Occurs when the execution of the agent results in an exception. + + Occurs when the execution of the agent results in an exception. + + Raises a timeout exception if a message not received in this amount of time. By default no timeout is used. + + Returns the number of unprocessed messages in the message queue of the agent. + + Occurs when the execution of the agent results in an exception. + + Scans for a message by looking through messages in arrival order until scanner @@ -7631,12 +15346,15 @@ This method is for use within the body of the agent. For each agent, at most one concurrent reader may be active, so no more than one concurrent call to Receive, TryReceive, Scan and/or TryScan may be active. + The function to return None if the message is to be skipped or Some if the message is to be processed and removed from the queue. An optional timeout in milliseconds. Defaults to -1 which corresponds to . An asynchronous computation that scanner built off the read message. + + Waits for a message. This will consume the first message in arrival order. @@ -7653,6 +15371,8 @@ An asynchronous computation that returns the received message or None if the timeout is exceeded. + + Like PostAndReply, but returns None if no reply within the timeout period. @@ -7663,9 +15383,13 @@ Defaults to -1 which corresponds to . The reply from the agent or None if the timeout expires. + + Starts the agent. + + Creates and starts an agent. The body function is used to generate the asynchronous @@ -7677,6 +15401,8 @@ Defaults to Async.DefaultCancellationToken. The created MailboxProcessor. + + Scans for a message by looking through messages in arrival order until scanner @@ -7687,13 +15413,17 @@ This method is for use within the body of the agent. For each agent, at most one concurrent reader may be active, so no more than one concurrent call to Receive, TryReceive, Scan and/or TryScan may be active. + The function to return None if the message is to be skipped or Some if the message is to be processed and removed from the queue. An optional timeout in milliseconds. Defaults to -1 which corresponds to . An asynchronous computation that scanner built off the read message. + Thrown when the timeout is exceeded. + + Waits for a message. This will consume the first message in arrival order. @@ -7708,6 +15438,8 @@ An asynchronous computation that returns the received message. Thrown when the timeout is exceeded. + + Like AsyncPostAndReply, but returns None if no reply within the timeout period. @@ -7718,6 +15450,8 @@ Defaults to -1 which corresponds to . An asynchronous computation that will return the reply or None if the timeout expires. + + Posts a message to an agent and await a reply on the channel, synchronously. @@ -7731,6 +15465,8 @@ Defaults to -1 which corresponds to . The reply from the agent. + + Posts a message to an agent and await a reply on the channel, asynchronously. @@ -7744,11 +15480,15 @@ Defaults to -1 which corresponds to . An asynchronous computation that will wait for the reply from the agent. + + Posts a message to the message queue of the MailboxProcessor, asynchronously. The message to post. + + Creates an agent. The body function is used to generate the asynchronous @@ -7761,6 +15501,8 @@ Defaults to Async.DefaultCancellationToken. The created MailboxProcessor. + + A message-processing agent which executes an asynchronous computation. @@ -7814,6 +15556,8 @@ The filename to save download to. An asynchronous computation that will wait for the download of the URI to specified file. + + Returns an asynchronous computation that, when run, will wait for the download of the given URI. @@ -7821,6 +15565,8 @@ The URI to retrieve. An asynchronous computation that will wait for the download of the URI. + + Returns an asynchronous computation that, when run, will wait for the download of the given URI. @@ -7828,10 +15574,14 @@ The URI to retrieve. An asynchronous computation that will wait for the download of the URI. + + Returns an asynchronous computation that, when run, will wait for a response to the given WebRequest. An asynchronous computation that waits for response to the WebRequest. + + A module of extension members providing asynchronous operations for some basic Web operations. @@ -7846,12 +15596,16 @@ The function to be called for each observation. An object that will remove the listener if disposed. + + Permanently connects a listener function to the observable. The listener will be invoked for each observation. The function to be called for each observation. + + Returns an asynchronous computation that will write the given bytes to the stream. @@ -7861,9 +15615,12 @@ An optional number of bytes to write to the stream. An asynchronous computation that will write the given bytes to the stream. + Thrown when the sum of offset and count is longer than the buffer length. Thrown when offset or count is negative. + + Returns an asynchronous computation that will read the given number of bytes from the stream. @@ -7871,6 +15628,8 @@ The number of bytes to read. An asynchronous computation that returns the read byte[] when run. + + Returns an asynchronous computation that will read from the stream into the given buffer. @@ -7879,9 +15638,12 @@ An optional number of bytes to read from the stream. An asynchronous computation that will read from the stream into the given buffer. + Thrown when the sum of offset and count is longer than the buffer length. Thrown when offset or count is negative. + + A module of extension members providing asynchronous operations for some basic CLI types related to concurrency and I/O. @@ -7944,6 +15706,90 @@ Async Internals + + + The entry point for the dynamic implementation of the corresponding operation. Do not use directly, only used when executing quotations that involve tasks or other reflective execution of F# code. + + + + + Specifies a unit of task code which draws a result from a task. + + + + + Specifies a unit of task code which draws a result from a task then calls a continuation. + + + + + Contains high-priority overloads for the `task` computation expression builder. + + + + + Specifies a unit of task code which draws a result from an F# async value. + + + + + Specifies a unit of task code which draws a result from an F# async value then calls a continuation. + + + + + Contains medium-priority overloads for the `task` computation expression builder. + + + + + Specifies a unit of task code which binds to the resource implementing IDisposable and disposes it synchronously + + + + + The entry point for the dynamic implementation of the corresponding operation. Do not use directly, only used when executing quotations that involve tasks or other reflective execution of F# code. + + + + + Specifies a unit of task code which draws its result from a task-like value + satisfying the GetAwaiter pattern. + + + + + Specifies a unit of task code which draws a result from a task-like value + satisfying the GetAwaiter pattern and calls a continuation. + + + + + Contains low-priority overloads for the `task` computation expression builder. + + + + + Builds a task using computation expression syntax which switches to execute on a background thread if not + already doing so. + + + If the task is created on a foreground thread (where is non-null) + its body is executed on a background thread using . + If created on a background thread (where is null) it is executed immeidately + immediately on that thread. + + + + + Builds a task using computation expression syntax. + + + + + Contains the `task` computation expression builder. + + Returns 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 @@ -7964,7 +15810,7 @@ Returns 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 + execution of the accumulation function, so care should be taken that the input IEvent not triggered by multiple threads simultaneously. The function to update the state with each event value. @@ -8045,6 +15891,8 @@ The input Observable. An Observable that triggers on successive pairs of observations from the input Observable. + + Creates an observer which subscribes to the given observable and which calls @@ -8054,6 +15902,8 @@ The input Observable. An object that will remove the callback if disposed. + + Creates an observer which permanently subscribes to the given observable and which calls @@ -8061,6 +15911,8 @@ The function to be called on each observation. The input Observable. + + Returns an observable which, for each observer, allocates an item of state @@ -8077,6 +15929,8 @@ The input Observable. An Observable that triggers on the updated state values. + + Returns an observable which chooses a projection of observations from the source @@ -8089,6 +15943,8 @@ The input Observable. An Observable that only propagates some of the observations from the source. + + Returns two observables which split the observations of the source by the @@ -8105,6 +15961,8 @@ A tuple of Observables. The first triggers when splitter returns Choice1of2 and the second triggers when splitter returns Choice2of2. + + Returns two observables which partition the observations of the source by @@ -8121,6 +15979,8 @@ A tuple of Observables. The first triggers when the predicate returns true, and the second triggers when the predicate returns false. + + Returns an observable which filters the observations of the source @@ -8134,6 +15994,8 @@ The input Observable. An Observable that filters observations based on filter. + + Returns an observable which transforms the observations of the source by the @@ -8144,6 +16006,8 @@ The input Observable. An Observable of the type specified by mapping. + + Returns an observable for the merged observations from the sources. @@ -8153,10 +16017,13 @@ For each observer, the registered intermediate observing object is not thread safe. That is, observations arising from the sources must not be triggered concurrently on different threads. + The first Observable. The second Observable. An Observable that propagates information from both sources. + + Contains operations for working with first class event and other observable objects. @@ -8167,220 +16034,316 @@ A method used to support the F# query syntax. Returns an empty sequence that has the specified type argument. + + A method used to support the F# query syntax. Returns a sequence that contains the specified values. + + A method used to support the F# query syntax. Returns a sequence of length one that contains the specified value. + + A query operator that selects those elements based on a specified predicate. + + A query operator that performs a subsequent ordering of the elements selected so far in descending order by the given nullable sorting key. This operator may only be used immediately after a 'sortBy', 'sortByDescending', 'thenBy' or 'thenByDescending', or their nullable variants. + + A query operator that performs a subsequent ordering of the elements selected so far in ascending order by the given nullable sorting key. This operator may only be used immediately after a 'sortBy', 'sortByDescending', 'thenBy' or 'thenByDescending', or their nullable variants. + + A query operator that performs a subsequent ordering of the elements selected so far in descending order by the given sorting key. This operator may only be used immediately after a 'sortBy', 'sortByDescending', 'thenBy' or 'thenByDescending', or their nullable variants. + + A query operator that performs a subsequent ordering of the elements selected so far in ascending order by the given sorting key. This operator may only be used immediately after a 'sortBy', 'sortByDescending', 'thenBy' or 'thenByDescending', or their nullable variants. + + A query operator that selects elements from a sequence as long as a specified condition is true, and then skips the remaining elements. + + A query operator that selects a specified number of contiguous elements from those selected so far. + + A query operator that selects a nullable value for each element selected so far and returns the sum of these values. If any nullable does not have a value, it is ignored. + + A query operator that selects a value for each element selected so far and returns the sum of these values. + + A method used to support the F# query syntax. Inputs to queries are implicitly wrapped by a call to one of the overloads of this method. + + A method used to support the F# query syntax. Inputs to queries are implicitly wrapped by a call to one of the overloads of this method. + + A query operator that sorts the elements selected so far in descending order by the given nullable sorting key. + + A query operator that sorts the elements selected so far in ascending order by the given nullable sorting key. + + A query operator that sorts the elements selected so far in descending order by the given sorting key. + + A query operator that sorts the elements selected so far in ascending order by the given sorting key. + + A query operator that bypasses elements in a sequence as long as a specified condition is true and then selects the remaining elements. + + A query operator that bypasses a specified number of the elements selected so far and selects the remaining elements. + + A query operator that projects each of the elements selected so far. + + A method used to support the F# query syntax. Runs the given quotation as a query using LINQ IQueryable rules. + + A method used to support the F# query syntax. Indicates that the query should be passed as a quotation to the Run method. + + A query operator that selects the element at a specified index amongst those selected so far. + + A query operator that selects a nullable value for each element selected so far and returns the minimum of these values. If any nullable does not have a value, it is ignored. + + A query operator that selects a value for each element selected so far and returns the minimum resulting value. + + A query operator that selects a nullable value for each element selected so far and returns the maximum of these values. If any nullable does not have a value, it is ignored. + + A query operator that selects a value for each element selected so far and returns the maximum resulting value. + + A query operator that correlates two sets of selected values based on matching keys and groups the results. If any group is empty, a group with a single default value is used instead. Normal usage is 'leftOuterJoin y in elements2 on (key1 = key2) into group'. + + A query operator that selects the last element of those selected so far, or a default value if no element is found. + + A query operator that selects the last element of those selected so far. + + A query operator that correlates two sets of selected values based on matching keys. Normal usage is 'join y in elements2 on (key1 = key2)'. + + A query operator that selects the first element of those selected so far, or a default value if the sequence contains no elements. + + A query operator that selects the first element from those selected so far. + + A query operator that selects a value for each element selected so far and groups the elements by the given key. + + A query operator that correlates two sets of selected values based on matching keys and groups the results. Normal usage is 'groupJoin y in elements2 on (key1 = key2) into group'. + + A query operator that groups the elements selected so far according to a specified key selector. + + A method used to support the F# query syntax. Projects each element of a sequence to another sequence and combines the resulting sequences into one sequence. + + A query operator that selects the first element selected so far that satisfies a specified condition. + + A query operator that determines whether any element selected so far satisfies a condition. + + A query operator that selects the single, specific element of those selected so far, or a default value if that element is not found. + + A query operator that selects the single, specific element selected so far + + A query operator that selects distinct elements from the elements selected so far. + + A query operator that returns the number of selected elements. + + A query operator that determines whether the selected elements contains a specified element. + + A query operator that selects a nullable value for each element selected so far and returns the average of these values. If any nullable does not have a value, it is ignored. + + A query operator that selects a value for each element selected so far and returns the average of these values. + + A query operator that determines whether all elements selected so far satisfies a condition. + + Create an instance of this builder. Use 'query { ... }' to use the query syntax. - The type used to support the F# query syntax. Use 'query { ... }' to use the query syntax. See + The type used to support the F# query syntax. Use 'query { ... }' to use the query syntax. See also <a href="https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/query-expressions">F# Query Expressions</a> in the F# Language Guide. @@ -8400,7 +16363,7 @@ - Library functionality for F# query syntax and interoperability with .NET LINQ Expressions. See + Library functionality for F# query syntax and interoperability with .NET LINQ Expressions. See also F# Query Expressions in the F# Language Guide. @@ -8411,6 +16374,16 @@ The input value. The converted char. + + + + open System + open FSharp.Linq.NullableOperators + + Nullable.char (Nullable<int>()) // evaluates to Nullable<char>() + Nullable.char (Nullable<int>(64)) // evaluates to Nullable<char>('@') + + Converts the argument to System.Decimal using a direct conversion for all @@ -8420,6 +16393,16 @@ The input value. The converted decimal. + + + + open System + open FSharp.Linq.NullableOperators + + Nullable.decimal (Nullable<int>()) // evaluates to Nullable<decimal>() + Nullable.decimal (Nullable<int>(3)) // evaluates to Nullable<decimal>(3.0M) + + Converts the argument to unsigned native integer using a direct conversion for all @@ -8429,6 +16412,16 @@ The input value. The converted unativeint + + + + open System + open FSharp.Linq.NullableOperators + + Nullable.unativeint (Nullable<int>()) // evaluates to Nullable<unativeint>() + Nullable.unativeint (Nullable<int>(3)) // evaluates to Nullable<unativeint>(3un) + + Converts the argument to signed native integer. This is a direct conversion for all @@ -8438,6 +16431,16 @@ The input value. The converted nativeint + + + + open System + open FSharp.Linq.NullableOperators + + Nullable.nativeint (Nullable<int>()) // evaluates to Nullable<nativeint>() + Nullable.nativeint (Nullable<int>(3)) // evaluates to Nullable<nativeint>(3n) + + Converts the argument to 64-bit float. This is a direct conversion for all @@ -8447,6 +16450,16 @@ The input value. The converted float + + + + open System + open FSharp.Linq.NullableOperators + + Nullable.double (Nullable<int>()) // evaluates to Nullable<double>() + Nullable.double (Nullable<int>(3)) // evaluates to Nullable<double>(3.0) + + Converts the argument to 32-bit float. This is a direct conversion for all @@ -8456,6 +16469,16 @@ The input value. The converted float32 + + + + open System + open FSharp.Linq.NullableOperators + + Nullable.single (Nullable<int>()) // evaluates to Nullable<float32>() + Nullable.single (Nullable<int>(3)) // evaluates to Nullable<float32>(3.0f) + + Converts the argument to 64-bit float. This is a direct conversion for all @@ -8465,6 +16488,16 @@ The input value. The converted float + + + + open System + open FSharp.Linq.NullableOperators + + Nullable.float (Nullable<int>()) // evaluates to Nullable<float>() + Nullable.float (Nullable<int>(3)) // evaluates to Nullable<float>(3.0) + + Converts the argument to 32-bit float. This is a direct conversion for all @@ -8474,6 +16507,16 @@ The input value. The converted float32 + + + + open System + open FSharp.Linq.NullableOperators + + Nullable.float32 (Nullable<int>()) // evaluates to Nullable<float32>() + Nullable.float32 (Nullable<int>(3)) // evaluates to Nullable<float32>(3.0f) + + Converts the argument to unsigned 64-bit integer. This is a direct conversion for all @@ -8483,6 +16526,16 @@ The input value. The converted uint64 + + + + open System + open FSharp.Linq.NullableOperators + + Nullable.uint64 (Nullable<int>()) // evaluates to Nullable<uint64>() + Nullable.uint64 (Nullable<int>(3)) // evaluates to Nullable<uint64>(3UL) + + Converts the argument to signed 64-bit integer. This is a direct conversion for all @@ -8492,6 +16545,16 @@ The input value. The converted int64 + + + + open System + open FSharp.Linq.NullableOperators + + Nullable.int64 (Nullable<int>()) // evaluates to Nullable<int64>() + Nullable.int64 (Nullable<int>(3)) // evaluates to Nullable<int64>(3L) + + Converts the argument to unsigned 32-bit integer. This is a direct conversion for all @@ -8501,6 +16564,16 @@ The input value. The converted uint32 + + + + open System + open FSharp.Linq.NullableOperators + + Nullable.uint32 (Nullable<int>()) // evaluates to Nullable<uint32>() + Nullable.uint32 (Nullable<int>(3)) // evaluates to Nullable(3u) + + Converts the argument to signed 32-bit integer. This is a direct conversion for all @@ -8510,6 +16583,16 @@ The input value. The converted int32 + + + + open System + open FSharp.Linq.NullableOperators + + Nullable.int32 (Nullable<int64>()) // evaluates to Nullable<int32>() + Nullable.int32 (Nullable<int64>(3)) // evaluates to Nullable(3) + + Converts the argument to a particular enum type. @@ -8517,6 +16600,16 @@ The input value. The converted enum type. + + + + open System + open FSharp.Linq.NullableOperators + + Nullable.enum<DayOfWeek> (Nullable<int>()) // evaluates to Nullable<uint>() + Nullable.enum<DayOfWeek> (Nullable<int>(3)) // evaluates to Nullable<DayOfWeek>(Wednesday) + + Converts the argument to an unsigned 32-bit integer. This is a direct conversion for all @@ -8526,6 +16619,16 @@ The input value. The converted unsigned integer + + + + open System + open FSharp.Linq.NullableOperators + + Nullable.uint (Nullable<int>()) // evaluates to Nullable<uint>() + Nullable.uint (Nullable<int>(3)) // evaluates to Nullable(3u) + + Converts the argument to signed 32-bit integer. This is a direct conversion for all @@ -8535,6 +16638,16 @@ The input value. The converted int + + + + open System + open FSharp.Linq.NullableOperators + + Nullable.int (Nullable<int64>()) // evaluates to Nullable<int>() + Nullable.int (Nullable<int64>(3)) // evaluates to Nullable(3) + + Converts the argument to unsigned 16-bit integer. This is a direct conversion for all @@ -8544,6 +16657,16 @@ The input value. The converted uint16 + + + + open System + open FSharp.Linq.NullableOperators + + Nullable.uint16 (Nullable<int>()) // evaluates to Nullable<uint16>() + Nullable.uint16 (Nullable<int>(3)) // evaluates to Nullable(3us) + + Converts the argument to signed 16-bit integer. This is a direct conversion for all @@ -8553,6 +16676,16 @@ The input value. The converted int16 + + + + open System + open FSharp.Linq.NullableOperators + + Nullable.int16 (Nullable<int>()) // evaluates to Nullable<int16>() + Nullable.int16 (Nullable<int>(3)) // evaluates to Nullable(3s) + + Converts the argument to signed byte. This is a direct conversion for all @@ -8562,6 +16695,16 @@ The input value. The converted sbyte + + + + open System + open FSharp.Linq.NullableOperators + + Nullable.int8 (Nullable<int>()) // evaluates to Nullable<sbyte>() + Nullable.int8 (Nullable<int>(3)) // evaluates to Nullable(3y) + + Converts the argument to signed byte. This is a direct conversion for all @@ -8571,6 +16714,16 @@ The input value. The converted sbyte + + + + open System + open FSharp.Linq.NullableOperators + + Nullable.sbyte (Nullable<int>()) // evaluates to Nullable<sbyte>() + Nullable.sbyte (Nullable<int>(3)) // evaluates to Nullable(3y) + + Converts the argument to byte. This is a direct conversion for all @@ -8580,14 +16733,36 @@ The input value. The converted byte + + + + open System + open FSharp.Linq.NullableOperators + + Nullable.uint8 (Nullable<int>()) // evaluates to Nullable<byte>() + Nullable.uint8 (Nullable<int>(3)) // evaluates to Nullable(3uy) + + Converts the argument to byte. This is a direct conversion for all primitive numeric types. The operation requires an appropriate static conversion method on the input type. + The input value. The converted byte + + + + open System + open FSharp.Linq.NullableOperators + + Nullable.byte (Nullable<int>()) // evaluates to Nullable<byte>() + Nullable.byte (Nullable<int>(3)) // evaluates to Nullable(3uy) + + + @@ -8595,173 +16770,291 @@ - - The division operator where a nullable value appears on both left and right sides - + The division operator where a nullable value appears on both left and right sides + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The division operator where a nullable value appears on the right - + The division operator where a nullable value appears on the right + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The division operator where a nullable value appears on the left - + The division operator where a nullable value appears on the left + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The modulus operator where a nullable value appears on both left and right sides - + The modulus operator where a nullable value appears on both left and right sides + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The modulus operator where a nullable value appears on the right - + The modulus operator where a nullable value appears on the right + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The modulus operator where a nullable value appears on the left - + The modulus operator where a nullable value appears on the left + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The multiplication operator where a nullable value appears on both left and right sides - + The multiplication operator where a nullable value appears on both left and right sides + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The multiplication operator where a nullable value appears on the right - + The multiplication operator where a nullable value appears on the right + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The multiplication operator where a nullable value appears on the left - + The multiplication operator where a nullable value appears on the left + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The subtraction operator where a nullable value appears on both left and right sides - + The subtraction operator where a nullable value appears on both left and right sides + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The subtraction operator where a nullable value appears on the right - + The subtraction operator where a nullable value appears on the right + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The subtraction operator where a nullable value appears on the left - + The subtraction operator where a nullable value appears on the left + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The addition operator where a nullable value appears on both left and right sides - + The addition operator where a nullable value appears on both left and right sides + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The addition operator where a nullable value appears on the right - + The addition operator where a nullable value appears on the right + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The addition operator where a nullable value appears on the left - + The addition operator where a nullable value appears on the left + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The '<>' operator where a nullable value appears on both left and right sides - + The '<>' operator where a nullable value appears on both left and right sides + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The '=' operator where a nullable value appears on both left and right sides - + The '=' operator where a nullable value appears on both left and right sides + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The '<' operator where a nullable value appears on both left and right sides - + The '<' operator where a nullable value appears on both left and right sides + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The '<=' operator where a nullable value appears on both left and right sides - + The '<=' operator where a nullable value appears on both left and right sides + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The '>' operator where a nullable value appears on both left and right sides - + The '>' operator where a nullable value appears on both left and right sides + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The '>=' operator where a nullable value appears on both left and right sides - + The '>=' operator where a nullable value appears on both left and right sides + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The '<>' operator where a nullable value appears on the right - + The '<>' operator where a nullable value appears on the right + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The '=' operator where a nullable value appears on the right - + The '=' operator where a nullable value appears on the right + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The '<' operator where a nullable value appears on the right - + The '<' operator where a nullable value appears on the right + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The '<=' operator where a nullable value appears on the right - + The '<=' operator where a nullable value appears on the right + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The '>' operator where a nullable value appears on the right - + The '>' operator where a nullable value appears on the right + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The '>=' operator where a nullable value appears on the right - + The '>=' operator where a nullable value appears on the right + + This operator is primarily for use in F# queries + + See the other operators in this module for related examples. - - The '<>' operator where a nullable value appears on the left - + The '<>' operator where a nullable value appears on the left + + This operator is primarily for use in F# queries + + + + open FSharp.Linq.NullableOperators + + Nullable(3) ?<>= 4 // true + Nullable(4) ?<>= 4 // false + Nullable() ?<> 4 // true + + + - - The '=' operator where a nullable value appears on the left - + The '=' operator where a nullable value appears on the left + + This operator is primarily for use in F# queries + + + + open FSharp.Linq.NullableOperators + + Nullable(3) ?= 4 // false + Nullable(4) ?= 4 // true + Nullable() ?= 4 // false + + + - - The '<' operator where a nullable value appears on the left - + The '<' operator where a nullable value appears on the left + + This operator is primarily for use in F# queries + + + + open FSharp.Linq.NullableOperators + + Nullable(3) ?< 4 // true + Nullable(4) ?< 4 // false + Nullable() ?< 4 // false + + - - The '<=' operator where a nullable value appears on the left - + The '<=' operator where a nullable value appears on the left + + This operator is primarily for use in F# queries + + + + open FSharp.Linq.NullableOperators + + Nullable(3) ?<= 4 // true + Nullable(5) ?<= 4 // false + Nullable() ?<= 4 // false + + - - The '>' operator where a nullable value appears on the left - + The '>' operator where a nullable value appears on the left + + This operator is primarily for use in F# queries + + + + open FSharp.Linq.NullableOperators + + Nullable(3) ?> 4 // false + Nullable(5) ?> 4 // true + Nullable() ?> 4 // false + + + - - The '>=' operator where a nullable value appears on the left - + The '>=' operator where a nullable value appears on the left + + This operator is primarily for use in F# queries + + + + open FSharp.Linq.NullableOperators + + Nullable(3) ?>= 4 // false + Nullable(4) ?>= 4 // true + Nullable() ?>= 4 // false + + + - Operators for working with nullable values + Operators for working with nullable values, primarily used on F# queries. @@ -8803,56 +17096,66 @@ - + A runtime helper used to evaluate nested quotation literals. - + + + - + A runtime helper used to evaluate nested quotation literals. - + + + - + Evaluates a subset of F# quotations by first converting to a LINQ expression, for the subset of LINQ expressions represented by the expression syntax in the C# language. - + + + - + Converts a subset of F# quotations to a LINQ expression, for the subset of LINQ expressions represented by the expression syntax in the C# language. - + + + - + Converts a subset of F# quotations to a LINQ expression, for the subset of LINQ expressions represented by the expression syntax in the C# language. - + + + - + When used in a quotation, this function indicates a specific conversion should be performed when converting the quotation to a LINQ expression. This function should not be called directly. - + - + When used in a quotation, this function indicates a specific conversion should be performed when converting the quotation to a LINQ expression. This function should not be called directly. - + - + When used in a quotation, this function indicates a specific conversion should be performed when converting the quotation to a LINQ expression. This function should not be called directly. - + @@ -9205,7 +17508,20 @@ - This type is for internal use by the F# code generator. + Represents an Common IL (Intermediate Language) Signature Pointer. + + This type should only be used when writing F# code that interoperates + with other .NET languages that use generic Common IL Signature Pointers. + Use of this type in F# code may result in unverifiable code being generated. + Because of the rules of Common IL Signature Pointers, you cannot use this type in generic type parameters, + resulting in compiler errors. As a result, you should convert this type to + for use in F#. Note that Common IL Signature Pointers exposed by other .NET languages are converted to + or automatically by F#, + and F# also shows generic-specialized typed native pointers correctly to other .NET languages as Common IL Signature Pointers. + However, generic typed native pointers are shown as to other .NET languages. + For other languages to interpret generic F# typed native pointers correctly, you should expose this type or + instead of . + Values of this type can be generated by the functions in the NativeInterop.NativePtr module. ByRef and Pointer Types @@ -9213,8 +17529,8 @@ Represents an untyped unmanaged pointer in F# code. This type should only be used when writing F# code that interoperates - with native code. Use of this type in F# code may result in - unverifiable code being generated. Conversions to and from the + with native code. Use of this type in F# code may result in + unverifiable code being generated. Conversions to and from the type may be required. Values of this type can be generated by the functions in the NativeInterop.NativePtr module. @@ -9224,8 +17540,8 @@ Represents an unmanaged pointer in F# code. This type should only be used when writing F# code that interoperates - with native code. Use of this type in F# code may result in - unverifiable code being generated. Conversions to and from the + with native code. Use of this type in F# code may result in + unverifiable code being generated. Conversions to and from the type may be required. Values of this type can be generated by the functions in the NativeInterop.NativePtr module. @@ -9639,6 +17955,8 @@ The input value + The F# compiler ignored this method when determining possible type-directed conversions. Instead, use Some or None explicitly. + A voption representing the value. @@ -9702,6 +18020,8 @@ The input value + The F# compiler ignored this method when determining possible type-directed conversions. Instead, use Some or None explicitly. + An option representing the value. @@ -10120,73 +18440,73 @@ ByRef and Pointer Types - The type of 32-bit unsigned integer numbers, annotated with a unit of measure. + The type of 32-bit unsigned integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type - are analyzed using reflection. The type is representationally equivalent to + are analyzed using reflection. The type is representationally equivalent to . Basic Types with Units of Measure - The type of 8-bit unsigned integer numbers, annotated with a unit of measure. + The type of 8-bit unsigned integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type - are analyzed using reflection. The type is representationally equivalent to + are analyzed using reflection. The type is representationally equivalent to . Basic Types with Units of Measure - The type of 32-bit signed integer numbers, annotated with a unit of measure. + The type of 32-bit signed integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type - are analyzed using reflection. The type is representationally equivalent to + are analyzed using reflection. The type is representationally equivalent to . Basic Types with Units of Measure - The type of 8-bit signed integer numbers, annotated with a unit of measure. + The type of 8-bit signed integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type - are analyzed using reflection. The type is representationally equivalent to + are analyzed using reflection. The type is representationally equivalent to . Basic Types with Units of Measure - The type of single-precision floating point numbers, annotated with a unit of measure. + The type of single-precision floating point numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type - are analyzed using reflection. The type is representationally equivalent to + are analyzed using reflection. The type is representationally equivalent to . Basic Types with Units of Measure - The type of double-precision floating point numbers, annotated with a unit of measure. + The type of double-precision floating point numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type - are analyzed using reflection. The type is representationally equivalent to + are analyzed using reflection. The type is representationally equivalent to . Basic Types with Units of Measure - The type of machine-sized unsigned integer numbers, annotated with a unit of measure. + The type of machine-sized unsigned integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type - are analyzed using reflection. The type is representationally equivalent to + are analyzed using reflection. The type is representationally equivalent to . Basic Types with Units of Measure - The type of 64-bit unsigned integer numbers, annotated with a unit of measure. + The type of 64-bit unsigned integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type - are analyzed using reflection. The type is representationally equivalent to + are analyzed using reflection. The type is representationally equivalent to . Basic Types with Units of Measure - The type of 16-bit unsigned integer numbers, annotated with a unit of measure. + The type of 16-bit unsigned integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type - are analyzed using reflection. The type is representationally equivalent to + are analyzed using reflection. The type is representationally equivalent to . Basic Types with Units of Measure @@ -10218,7 +18538,7 @@ The type of 64-bit signed integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type - are analyzed using reflection. The type is representationally equivalent to + are analyzed using reflection. The type is representationally equivalent to . Basic Types with Units of Measure @@ -10226,7 +18546,7 @@ The type of 16-bit signed integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type - are analyzed using reflection. The type is representationally equivalent to + are analyzed using reflection. The type is representationally equivalent to . Basic Types with Units of Measure @@ -10234,7 +18554,7 @@ The type of 8-bit signed integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type - are analyzed using reflection. The type is representationally equivalent to + are analyzed using reflection. The type is representationally equivalent to . Basic Types with Units of Measure @@ -10242,7 +18562,7 @@ The type of 32-bit signed integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type - are analyzed using reflection. The type is representationally equivalent to + are analyzed using reflection. The type is representationally equivalent to . Basic Types with Units of Measure @@ -10250,24 +18570,24 @@ The type of decimal numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type - are analyzed using reflection. The type is representationally equivalent to + are analyzed using reflection. The type is representationally equivalent to . Basic Types with Units of Measure - The type of single-precision floating point numbers, annotated with a unit of measure. + The type of single-precision floating point numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type - are analyzed using reflection. The type is representationally equivalent to + are analyzed using reflection. The type is representationally equivalent to . Basic Types with Units of Measure - The type of double-precision floating point numbers, annotated with a unit of measure. + The type of double-precision floating point numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type - are analyzed using reflection. The type is representationally equivalent to + are analyzed using reflection. The type is representationally equivalent to . Basic Types with Units of Measure @@ -10403,6 +18723,18 @@ Attributes + + Creates an instance of the attribute + InlineIfLambdaAttribute + + + Adding this attribute to a parameter of function type indicates that, if the overall function or method is inlined and the parameter is + determined to be a known lambda, then this function should be statically inlined throughout the body of the function of method. + + If the function parameter is called multiple times in the implementation of the function or method this attribute may cause code explosion and slow compilation times. + + Attributes + Indicates the warning message to be emitted when F# source code uses this construct @@ -11100,9 +19432,11 @@ Construct a format string + The input string. The captured expressions in an interpolated string. The types of expressions for %A holes in interpolated string. + The created format string. @@ -11585,6 +19919,13 @@ The input key/value pair. A tuple containing the key and value. + + + + + + + Converts the argument to character. Numeric inputs are converted according to the UTF-16 @@ -11594,6 +19935,13 @@ The input value. The converted char. + + + + + + + Converts the argument to System.Decimal using a direct conversion for all @@ -11604,6 +19952,13 @@ The input value. The converted decimal. + + + + + + + Converts the argument to a string using ToString. @@ -11613,6 +19968,13 @@ The input value. The converted string. + + + + + + + Converts the argument to unsigned native integer using a direct conversion for all @@ -11622,6 +19984,13 @@ The input value. The converted unativeint + + + + + + + Converts the argument to signed native integer. This is a direct conversion for all @@ -11631,6 +20000,13 @@ The input value. The converted nativeint + + + + + + + Converts the argument to 64-bit float. This is a direct conversion for all @@ -11641,6 +20017,13 @@ The input value. The converted float + + + + + + + Converts the argument to 32-bit float. This is a direct conversion for all @@ -11651,6 +20034,13 @@ The input value. The converted float32 + + + + + + + Converts the argument to unsigned 64-bit integer. This is a direct conversion for all @@ -11661,6 +20051,13 @@ The input value. The converted uint64 + + + + + + + Converts the argument to signed 64-bit integer. This is a direct conversion for all @@ -11671,6 +20068,13 @@ The input value. The converted int64 + + + + + + + Converts the argument to unsigned 32-bit integer. This is a direct conversion for all @@ -11681,6 +20085,13 @@ The input value. The converted uint32 + + + + + + + Converts the argument to signed 32-bit integer. This is a direct conversion for all @@ -11691,6 +20102,13 @@ The input value. The converted int32 + + + + + + + Converts the argument to a particular enum type. @@ -11698,6 +20116,13 @@ The input value. The converted enum type. + + + + + + + Converts the argument to an unsigned 32-bit integer. This is a direct conversion for all @@ -11708,6 +20133,13 @@ The input value. The converted int + + + + + + + Converts the argument to signed 32-bit integer. This is a direct conversion for all @@ -11718,6 +20150,13 @@ The input value. The converted int + + + + + + + Converts the argument to unsigned 16-bit integer. This is a direct conversion for all @@ -11728,6 +20167,13 @@ The input value. The converted uint16 + + + + + + + Converts the argument to signed 16-bit integer. This is a direct conversion for all @@ -11738,6 +20184,13 @@ The input value. The converted int16 + + + + + + + Converts the argument to signed byte. This is a direct conversion for all @@ -11748,6 +20201,13 @@ The input value. The converted sbyte + + + + + + + Converts the argument to byte. This is a direct conversion for all @@ -11758,6 +20218,13 @@ The input value. The converted byte + + + + + + + Overloaded power operator. If n > 0 then equivalent to x*...*x for n occurrences of x. @@ -11766,6 +20233,13 @@ The input exponent. The base raised to the exponent. + + + + + + + Overloaded power operator. @@ -11774,6 +20248,13 @@ The input exponent. The base raised to the exponent. + + + + + + + Overloaded truncate operator. @@ -11781,6 +20262,13 @@ The input value. The truncated value. + + + + + + + Hyperbolic tangent of the given number @@ -11788,6 +20276,13 @@ The input value. The hyperbolic tangent of the input. + + + + + + + Tangent of the given number @@ -11795,6 +20290,13 @@ The input value. The tangent of the input. + + + + + + + Hyperbolic sine of the given number @@ -11802,6 +20304,12 @@ The input value. The hyperbolic sine of the input. + + + + + + Sine of the given number @@ -11809,6 +20317,13 @@ The input value. The sine of the input. + + + + + + + Hyperbolic cosine of the given number @@ -11816,6 +20331,13 @@ The input value. The hyperbolic cosine of the input. + + + + + + + Cosine of the given number @@ -11823,6 +20345,13 @@ The input value. The cosine of the input. + + + + + + + Square root of the given number @@ -11830,6 +20359,14 @@ The input value. The square root of the input. + + + + sqrt 2.0 // Evaluates to 1.414213562 + sqrt 100.0 // Evaluates to 10.0 + + + Logarithm to base 10 of the given number @@ -11837,6 +20374,16 @@ The input value. The logarithm to base 10 of the input. + + + + log10 1000.0 // Evaluates to 3.0 + log10 100000.0 // Evaluates to 5.0 + log10 0.0001 // Evaluates to -4.0 + log10 -20.0 // Evaluates to nan + + + Natural logarithm of the given number @@ -11844,6 +20391,15 @@ The input value. The natural logarithm of the input. + + + + let logBase baseNumber value = (log value) / (log baseNumber) + logBase 2.0 32.0 // Evaluates to 5.0 + logBase 10.0 1000.0 // Evaluates to 3.0 + + + Round the given number @@ -11851,6 +20407,16 @@ The input value. The nearest integer to the input value. + + + + round 3.49 // Evaluates to 3.0 + round -3.49 // Evaluates to -3.0 + round 3.5 // Evaluates to 4.0 + round -3.5 // Evaluates to -4.0 + + + Sign of the given number @@ -11858,6 +20424,14 @@ The input value. -1, 0, or 1 depending on the sign of the input. + + + + sign -12.0 // Evaluates to -1 + sign 43 // Evaluates to 1 + + + Floor of the given number @@ -11865,6 +20439,14 @@ The input value. The floor of the input. + + + + floor 12.1 // Evaluates to 12.0 + floor -1.9 // Evaluates to -2.0 + + + Exponential of the given number @@ -11872,6 +20454,16 @@ The input value. The exponential of the input. + + + + exp 0.0 // Evaluates to 1.0 + exp 1.0 // Evaluates to 2.718281828 + exp -1.0 // Evaluates to 0.3678794412 + exp 2.0 // Evaluates to 7.389056099 + + + Ceiling of the given number @@ -11879,6 +20471,14 @@ The input value. The ceiling of the input. + + + + ceil 12.1 // Evaluates to 13.0 + ceil -1.9 // Evaluates to -1.0 + + + Inverse tangent of x/y where x and y are specified separately @@ -11887,6 +20487,16 @@ The x input value. The inverse tangent of the input ratio. + + + + let angleFromPlaneAtXY x y = atan2 y x * 180.0 / System.Math.PI + angleFromPlaneAtXY 0.0 -1.0 // Evaluates to -90.0 + angleFromPlaneAtXY 1.0 1.0 // Evaluates to 45.0 + angleFromPlaneAtXY -1.0 1.0 // Evaluates to 135.0 + + + Inverse tangent of the given number @@ -11894,6 +20504,14 @@ The input value. The inverse tangent of the input. + + + + let angleFrom opposite adjacent = atan(opposite / adjacent) + angleFrom 5.0 5.0 // Evaluates to 0.7853981634 + + + Inverse sine of the given number @@ -11901,6 +20519,15 @@ The input value. The inverse sine of the input. + + + + let angleFromOpposite opposite hypotenuse = asin(opposite / hypotenuse) + angleFromOpposite 6.0 10.0 // Evaluates to 0.6435011088 + angleFromOpposite 5.0 3.0 // Evaluates to nan + + + Inverse cosine of the given number @@ -11908,6 +20535,14 @@ The input value. The inverse cosine of the input. + + + + let angleFromAdjacent adjacent hypotenuse = acos(adjacent / hypotenuse) + angleFromAdjacent 8.0 10.0 // Evaluates to 0.6435011088 + + + Absolute value of the given number. @@ -11915,6 +20550,14 @@ The input value. The absolute value of the input. + + + + abs -12 // Evaluates to 12 + abs -15.0 // Evaluates to 15.0 + + + A generic hash function. This function has the same behaviour as 'hash', @@ -11927,6 +20570,9 @@ The input object. The computed hash. + + + A generic hash function, designed to return equal hash values for items that are @@ -11938,24 +20584,67 @@ The input object. The computed hash. + + + + hash "Bob Jones" // Evaluates to -325251320 + + + Returns the internal size of a type in bytes. For example, sizeof<int> returns 4. + + + + sizeof<bool> // Evaluates to 1 + sizeof<byte> // Evaluates to 1 + sizeof<int> // Evaluates to 4 + sizeof<double> // Evaluates to 8 + sizeof<struct(byte * byte)> // Evaluates to 2 + sizeof<nativeint> // Evaluates to 4 or 8 (32-bit or 64-bit) depending on your platform + + + Generate a System.Type representation for a type definition. If the input type is a generic type instantiation then return the generic type definition associated with all such instantiations. + + + + typeof<int list;> // Evaluates to Microsoft.FSharp.Collections.FSharpList`1[System.Int32] + typedefof<int list;> // Evaluates to Microsoft.FSharp.Collections.FSharpList`1[T] /// + + + An internal, library-only compiler intrinsic for compile-time generation of a RuntimeMethodHandle. - Returns the name of the given symbol. + Returns the name of the given symbol. + + + + let myVariableName = "This value doesn't matter" + nameof(myVariableName) // Evaluates to "myVariableName" + + + Generate a System.Type runtime representation of a static type. + + + + let t = typeof<int> // Gets the System.Type + t.FullName // Evaluates to "System.Int32" + + + Clean up resources associated with the input object after the completion of the given function. @@ -11966,6 +20655,19 @@ The action that accepts the resource. The resulting value. + + + The following code appends 10 lines to test.txt, then closes the StreamWriter when finished. + + open System.IO + + using (File.AppendText "test.txt") (fun writer -> + for i in 1 .. 10 do + writer.WriteLine("Hello World {0}", i)) + + + + Execute the function as a mutual-exclusion region using the input value as a lock. @@ -11974,6 +20676,46 @@ The action to perform during the lock. The resulting value. + + + + open System.Linq + + /// A counter object, supporting unlocked and locked increment + type TestCounter () = + let mutable count = 0 + + /// Increment the counter, unlocked + member this.IncrementWithoutLock() = + count <- count + 1 + + /// Increment the counter, locked + member this.IncrementWithLock() = + lock this (fun () -> count <- count + 1) + + /// Get the count + member this.Count = count + + let counter = TestCounter() + + // Create a parallel sequence to that uses all our CPUs + (seq {1..100000}).AsParallel() + .ForAll(fun _ -> counter.IncrementWithoutLock()) + + // Evaluates to a number between 1-100000, non-deterministically because there is no locking + counter.Count + + let counter2 = TestCounter() + + // Create a parallel sequence to that uses all our CPUs + (seq {1..100000}).AsParallel() + .ForAll(fun _ -> counter2.IncrementWithLock()) + + // Evaluates to 100000 deterministically because the increment to the counter object is locked + counter.Count + + + The standard overloaded skip range operator, e.g. [n..skip..m] for lists, seq {n..skip..m} for sequences @@ -11983,6 +20725,15 @@ The end value of the range. The sequence spanning the range using the specified step size. + + + + [1..2..6] // Evaluates to [1; 3; 5] + [1.1..0.2..1.5] // Evaluates to [1.1; 1.3; 1.5] + ['a'..'e'] // Evaluates to ['a'; 'b'; 'c'; 'd'; 'e'] + + + The standard overloaded range operator, e.g. [n..m] for lists, seq {n..m} for sequences @@ -11991,6 +20742,18 @@ The end value of the range. The sequence spanning the range. + + + + [1..4] // Evaluates to [1; 2; 3; 4] + [1.5..4.4] // Evaluates to [1.5; 2.5; 3.5] + ['a'..'d'] // Evaluates to ['a'; 'b'; 'c'; 'd'] + + [|1..4|] // Evaluates to an array [|1; 2; 3; 4|] + { 1..4 } // Evaluates to a sequence [1; 2; 3; 4]) + + + Reads the value of the property . @@ -12020,6 +20783,19 @@ The exit code to use. The result value. + + + + [<EntryPoint>] + let main argv = + if argv.Length = 0 then + eprintfn "You must provide arguments" + exit(-1) // Causes program to quit with an error code + printfn "Argument count: %i" argv.Length + 0 + + + Builds a sequence using sequence expression syntax @@ -12027,6 +20803,13 @@ The input sequence. The result sequence. + + + + seq { for i in 0..10 do yield (i, i*i) } + + + Negate a logical value. Not True equals False and not False equals True @@ -12034,6 +20817,16 @@ The value to negate. The result of the negation. + + + + not (2 + 2 = 5) // Evaluates to true + + // not is a function that can be compose with other functions + let fileDoesNotExist = System.IO.File.Exists >> not + + + Concatenate two lists. @@ -12042,16 +20835,43 @@ The second list. The concatenation of the lists. + + + + let l1 = ['a'; 'b'; 'c'] + let l2 = ['d'; 'e'; 'f'] + l1 @ l2 // Evalulates to ['a'; 'b'; 'c'; 'd'; 'e'; 'f'] + + + Increment a mutable reference cell containing an integer The reference cell. + + + + let count = ref 99 // Creates a reference cell object with a mutable Value property + incr count // Increments our counter + count.Value // Evaluates to 100 + + + Decrement a mutable reference cell containing an integer The reference cell. + + + + let count = ref 99 // Creates a reference cell object with a mutable Value property + decr count // Decrements our counter + count.Value // Evaluates to 98 + + + Dereference a mutable reference cell @@ -12059,12 +20879,31 @@ The cell to dereference. The value contained in the cell. + + + + let count = ref 12 // Creates a reference cell object with a mutable Value property + count.Value // Evaluates to 12 + !count // Also evaluates to 12 (with shorter syntax) + + + Assign to a mutable reference cell The cell to mutate. The value to set inside the cell. + + + + let count = ref 0 // Creates a reference cell object with a mutable Value property + count.Value <- 1 // Updates the value + count := 2 // Also updates the value, but with shorter syntax + count.Value // Evaluates to 2 + + + Create a mutable reference cell @@ -12072,6 +20911,16 @@ The value to contain in the cell. The created reference cell. + + + + let count = ref 0 // Creates a reference cell object with a mutable Value property + count.Value // Evaluates to 0 + count.Value <- 1 // Updates the value + count.Value // Evaluates to 1 + + + The identity function @@ -12079,6 +20928,14 @@ The input value. The same value. + + + + id 12 // Evaulates to 12 + id "abc" // Evaulates to "abc" + + + Throw a exception @@ -12086,6 +20943,22 @@ The exception message. The result value. + + + + type FileReader(filename: string) = + let mutable isOpen = false + member this.Open() = + if isOpen then invalidOp "File is already open" + // ... Here we may open the file ... + isOpen <- true + + let reader = FileReader("journal.txt") + reader.Open() // Executes fine + reader.Open() // Throws System.InvalidOperationException: File is already open + + + Throw a exception @@ -12093,6 +20966,18 @@ The argument name. The result value. + + + + let fullName firstName lastName = + nullArg (nameof(firstName)) + nullArg (nameof(lastName)) + firstName + " " + lastName + + fullName null "Jones" // Throws System.ArgumentNullException: Value cannot be null. (Parameter 'firstName') + + + Throw a exception with @@ -12102,6 +20987,21 @@ The exception message. The result value. + + + + let fullName firstName lastName = + if String.IsNullOrWhiteSpace(firstName) then + invalidArg (nameof(firstName)) "First name can't be null or blank" + if String.IsNullOrWhiteSpace(lastName) then + invalidArg (nameof(lastName)) "Last name can't be null or blank" + firstName + " " + lastName + + fullName null "Jones" + + Throws System.ArgumentException: First name can't be null or blank (Parameter 'firstName') + + Throw a exception. @@ -12109,6 +21009,17 @@ The exception message. The result value. + + + + let failingFunction() = + failwith "Oh no" // Throws an exception + true // Never reaches this + + failingFunction() // Throws a System.Exception + + + Determines whether the given value is not null. @@ -12123,6 +21034,14 @@ The value to check. True when value is null, false otherwise. + + + + isNull null // Evaluates to true + isNull "Not null" // Evaluates to false + + + Try to unbox a strongly typed value. @@ -12130,6 +21049,16 @@ The boxed value. The unboxed result as an option. + + + + let x: int = 123 + let obj1 = box x // obj1 is a generic object type + tryUnbox<int> obj1 // Evaluates to Some(123) + tryUnbox<double> obj1 // Evaluates to None + + + Boxes a strongly typed value. @@ -12137,6 +21066,16 @@ The value to box. The boxed object. + + + + let x: int = 123 + let obj1 = box x // obj1 is a generic object type + unbox<int> obj1 // Evaluates to 123 (int) + unbox<double> obj1 // Throws System.InvalidCastException + + + Unbox a strongly typed value. @@ -12144,11 +21083,28 @@ The boxed value. The unboxed result. + + + + let x: int = 123 + let obj1 = box x // obj1 is a generic object type + unbox<int> obj1 // Evaluates to 123 (int) + unbox<double> obj1 // Throws System.InvalidCastException + + + Ignore the passed value. This is often used to throw away results of a computation. The value to ignore. + + + + ignore 55555 // Evaluates to () + + + Minimum based on generic comparison @@ -12157,6 +21113,15 @@ The second value. The minimum value. + + + + min 1 2 // Evaluates to 1 + min [1;2;3] [1;2;4] // Evaluates to [1;2;3] + min "zoo" "alpha" // Evaluates to "alpha" + + + Maximum based on generic comparison @@ -12165,6 +21130,15 @@ The second value. The maximum value. + + + + max 1 2 // Evaluates to 2 + max [1;2;3] [1;2;4] // Evaluates to [1;2;4] + max "zoo" "alpha" // Evaluates to "zoo" + + + Generic comparison. @@ -12173,6 +21147,18 @@ The second value. The result of the comparison. + + + + compare 1 2 // Evaluates to -1 + compare [1;2;3] [1;2;4] // Evaluates to -1 + compare 2 2 // Evaluates to 0 + compare [1;2;3] [1;2;3] // Evaluates to 0 + compare 2 1 // Evaluates to 1 + compare [1;2;4] [1;2;3] // Evaluates to 1 + + + Return the second element of a tuple, snd (a,b) = b. @@ -12180,6 +21166,13 @@ The input tuple. The second value. + + + + snd ("first", 2) // Evaluates to 2 + + + Return the first element of a tuple, fst (a,b) = a. @@ -12187,6 +21180,13 @@ The input tuple. The first value. + + + + fst ("first", 2) // Evaluates to "first" + + + Matches objects whose runtime type is precisely @@ -12194,6 +21194,9 @@ The input exception. A string option. + + + Builds a object. @@ -12201,10 +21204,37 @@ The message for the Exception. A System.Exception. + + + + let throwException() = + raise(Failure("Oh no!!!")) + true // Never gets here + + throwException() // Throws a generic Exception class + + + Rethrows an exception. This should only be used when handling an exception The result value. + + + + let readFile (filename: string) = + try + File.ReadAllText(filename) + with ex -> + eprintfn "Couldn't read %s" filename + reraise() + + readFile "/this-file-doest-exist" + // Prints the message to stderr + // Throws a System.IO.FileNotFoundException + + + Rethrows an exception. This should only be used when handling an exception @@ -12216,6 +21246,22 @@ The exception to raise. The result value. + + + + open System.IO + exception FileNotFoundException of string + + let readFile (filename: string) = + if not (File.Exists(filename)) then + raise(FileNotFoundException(filename)) + File.ReadAllText(filename) + + readFile "/this-file-doest-exist" + + When executed, raises a FileNotFoundException. + + Concatenate two strings. The operator '+' may also be used. @@ -12227,6 +21273,15 @@ The default value of the argument. The argument value. If it is None, the defaultValue is returned. + + + + let arg1 = ValueSome(5) + defaultValueArg arg1 6 // Evaluates to 5 + defaultValueArg ValueNone 6 // Evaluates to 6 + + + Used to specify a default value for an optional argument in the implementation of a function @@ -12235,6 +21290,22 @@ The default value of the argument. The argument value. If it is None, the defaultValue is returned. + + + + type Vector(x: double, y: double, ?z: double) = + let z = defaultArg z 0.0 + member this.X = x + member this.Y = y + member this.Z = z + + let v1 = Vector(1.0, 2.0) + v1.Z // Evaluates to 0. + let v2 = Vector(1.0, 2.0, 3.0) + v2.Z // Evaluates to 3.0 + + + Apply a function to three values, the values being a triple on the right, the function on the left @@ -12245,6 +21316,14 @@ The third argument. The function result. + + + + let sum3 x y z = x + y + z + sum3 <||| (3, 4, 5) // Evaluates to 12 + + + Apply a function to two values, the values being a pair on the right, the function on the left @@ -12254,6 +21333,14 @@ The second argument. The function result. + + + + let sum x y = x + y + sum <|| (3, 4) // Evaluates to 7 + + + Apply a function to a value, the value being on the right, the function on the left @@ -12262,6 +21349,14 @@ The argument. The function result. + + + + let doubleIt x = x * 2 + doubleIt <| 3 // Evaluates to 6 + + + Apply a function to three values, the values being a triple on the left, the function on the right @@ -12272,6 +21367,14 @@ The function. The function result. + + + + let sum3 x y z = x + y + z + (3, 4, 5) |||> sum3 // Evaluates to 12 + + + Apply a function to two values, the values being a pair on the left, the function on the right @@ -12281,6 +21384,14 @@ The function. The function result. + + + + let sum x y = x + y + (3, 4) ||> sum // Evaluates to 7 + + + Apply a function to a value, the value being on the left, the function on the right @@ -12289,6 +21400,14 @@ The function. The function result. + + + + let doubleIt x = x * 2 + 3 |> doubleIt // Evaluates to 6 + + + Compose two functions, the function on the right being applied first @@ -12297,6 +21416,16 @@ The first function to apply. The composition of the input functions. + + + + let addOne x = x + 1 + let doubleIt x = x * 2 + let doubleThenAdd = addOne << doubleIt + doubleThenAdd 3 + + + Compose two functions, the function on the left being applied first @@ -12305,6 +21434,16 @@ The second function to apply. The composition of the input functions. + + + + let addOne x = x + 1 + let doubleIt x = x * 2 + let addThenDouble = addOne >> doubleIt + addThenDouble 3 // Evaluates to 8 + + + Structural inequality @@ -12313,6 +21452,15 @@ The second parameter. The result of the comparison. + + + + 5 <> 5 // Evaluates to false + 5 <> 6 // Evaluates to true + [1; 2] <> [1; 2] // Evaluates to false + + + Structural equality @@ -12321,6 +21469,16 @@ The second parameter. The result of the comparison. + + + + 5 = 5 // Evaluates to true + 5 = 6 // Evaluates to false + [1; 2] = [1; 2] // Evaluates to true + (1, 5) = (1, 6) // Evaluates to false + + + Structural less-than-or-equal comparison @@ -12329,6 +21487,15 @@ The second parameter. The result of the comparison. + + + + 5 <= 1 // Evaluates to false + 5 <= 5 // Evaluates to true + [1; 5] <= [1; 6] // Evaluates to true + + + Structural greater-than-or-equal @@ -12337,6 +21504,15 @@ The second parameter. The result of the comparison. + + + + 5 >= 1 // Evaluates to true + 5 >= 5 // Evaluates to true + [1; 5] >= [1; 6] // Evaluates to false + + + Structural greater-than @@ -12345,6 +21521,15 @@ The second parameter. The result of the comparison. + + + + 5 > 1 // Evaluates to true + 5 > 5 // Evaluates to false + (1, "a") > (1, "z") // Evaluates to false + + + Structural less-than comparison @@ -12353,6 +21538,15 @@ The second parameter. The result of the comparison. + + + + 1 < 5 // Evaluates to true + 5 < 5 // Evaluates to false + (1, "a") < (1, "z") // Evaluates to true + + + Overloaded prefix-plus operator @@ -12360,6 +21554,9 @@ The input value. The result of the operation. + + + Overloaded bitwise-NOT operator @@ -12367,6 +21564,15 @@ The input value. The result of the operation. + + + + let byte1 = 60uy // 00111100 + let byte2 = ~~~b1 // 11000011 + + Evaluates to 195 + + Overloaded byte-shift right operator by a specified number of bits @@ -12375,6 +21581,16 @@ The amount to shift. The result of the operation. + + + + let a = 206 // 00000000000000000000000011010000 + let c1 = a >> 2 // 00000000000000000000000000110100 + // Evaluates to 51 + let c2 = a >> 6 // 00000000000000000000000000000011 + Evaluates to 3 + + Overloaded byte-shift left operator by a specified number of bits @@ -12383,6 +21599,14 @@ The amount to shift. The result of the operation. + + + + let a = 13 // 00000000000000000000000000001101 + let c = a << 4 // 00000000000000000000000011010000 + + Evaluates to 206 + Overloaded bitwise-XOR operator @@ -12391,6 +21615,15 @@ The second parameter. The result of the operation. + + + + let a = 13 // 00000000000000000000000000001101 + let b = 11 // 00000000000000000000000000001011 + let c = a ^^^ b // 00000000000000000000000000000110 + + Evaluates to 6 + Overloaded bitwise-OR operator @@ -12399,6 +21632,15 @@ The second parameter. The result of the operation. + + + + let a = 13 // 00000000000000000000000000001101 + let b = 11 // 00000000000000000000000000001011 + let c = a ||| b // 00000000000000000000000000001111 + + Evaluates to 15 + Overloaded bitwise-AND operator @@ -12407,6 +21649,15 @@ The second parameter. The result of the operation. + + + + let a = 13 // 00000000000000000000000000001101 + let b = 11 // 00000000000000000000000000001011 + let c = a &&& b // 00000000000000000000000000001001 + + Evaluates to 9 + Overloaded modulo operator @@ -12415,6 +21666,12 @@ The second parameter. The result of the operation. + + + + 29 % 5 // Evaluates to 4 + + Overloaded division operator @@ -12423,6 +21680,12 @@ The second parameter. The result of the operation. + + + + 16 / 2 // Evaluates to 8 + + Overloaded multiplication operator @@ -12431,6 +21694,12 @@ The second parameter. The result of the operation. + + + + 8 * 6 // Evaluates to 48 + + Overloaded subtraction operator @@ -12439,6 +21708,12 @@ The second parameter. The result of the operation. + + + + 10 - 2 // Evaluates to 8 + + Overloaded addition operator @@ -12447,6 +21722,14 @@ The second parameter. The result of the operation. + + + + 2 + 2 // Evaluates to 4 + "Hello " + "Word" // Evaluates to "Hello World" + + + Overloaded unary negation. @@ -12454,6 +21737,9 @@ The value to negate. The result of the operation. + + + Converts the argument to char. Numeric inputs are converted using a checked @@ -12464,6 +21750,9 @@ The input value. The converted char + + + Converts the argument to unativeint. This is a direct, checked conversion for all @@ -12473,6 +21762,9 @@ The input value. The converted unativeint + + + Converts the argument to . This is a direct, checked conversion for all @@ -12482,6 +21774,9 @@ The input value. The converted nativeint + + + Converts the argument to uint64. This is a direct, checked conversion for all @@ -12492,6 +21787,9 @@ The input value. The converted uint64 + + + Converts the argument to int64. This is a direct, checked conversion for all @@ -12502,6 +21800,9 @@ The input value. The converted int64 + + + Converts the argument to uint32. This is a direct, checked conversion for all @@ -12512,6 +21813,9 @@ The input value. The converted uint32 + + + Converts the argument to int32. This is a direct, checked conversion for all @@ -12522,6 +21826,9 @@ The input value. The converted int32 + + + Converts the argument to int. This is a direct, checked conversion for all @@ -12532,6 +21839,9 @@ The input value. The converted int + + + Converts the argument to uint16. This is a direct, checked conversion for all @@ -12542,6 +21852,9 @@ The input value. The converted uint16 + + + Converts the argument to int16. This is a direct, checked conversion for all @@ -12552,6 +21865,9 @@ The input value. The converted int16 + + + Converts the argument to sbyte. This is a direct, checked conversion for all @@ -12562,6 +21878,9 @@ The input value. The converted sbyte + + + Converts the argument to byte. This is a direct, checked conversion for all @@ -12572,6 +21891,9 @@ The input value. The converted byte + + + Overloaded multiplication operator (checks for overflow) @@ -12580,6 +21902,9 @@ The second value. The product of the two input values. + + + Overloaded addition operator (checks for overflow) @@ -12588,6 +21913,9 @@ The second value. The sum of the two input values. + + + Overloaded subtraction operator (checks for overflow) @@ -12596,6 +21924,9 @@ The second value. The first value minus the second value. + + + Overloaded unary negation (checks for overflow) @@ -12603,6 +21934,9 @@ The input value. The negated value. + + + This module contains the basic arithmetic operations with overflow checks. @@ -12613,6 +21947,9 @@ The value. The hash code. + + + Minimum of the two values @@ -12621,6 +21958,9 @@ The second value. The minimum value. + + + Maximum of the two values @@ -12629,6 +21969,9 @@ The second value. The maximum value. + + + Compares the two values @@ -12637,6 +21980,9 @@ The second value. The result of the comparison. + + + Compares the two values for inequality @@ -12645,6 +21991,9 @@ The second parameter. The result of the comparison. + + + Compares the two values for equality @@ -12653,6 +22002,9 @@ The second parameter. The result of the comparison. + + + Compares the two values for less-than-or-equal @@ -12661,6 +22013,9 @@ The second parameter. The result of the comparison. + + + Compares the two values for greater-than-or-equal @@ -12669,6 +22024,9 @@ The second parameter. The result of the comparison. + + + Compares the two values for greater-than @@ -12677,6 +22035,9 @@ The second parameter. The result of the comparison. + + + Compares the two values for less-than @@ -12685,30 +22046,45 @@ The second parameter. The result of the comparison. + + + A module of comparison and equality operators that are statically resolved, but which are not fully generic and do not make structural comparison. Opening this module may make code that relies on structural or generic comparison no longer compile. - Perform generic hashing on a value where the type of the value is not + Perform generic hashing on a value where the type of the value is not statically required to satisfy the 'equality' constraint. The computed hash value. + + + - Perform generic equality on two values where the type of the values is not + Perform generic equality on two values where the type of the values is not statically required to satisfy the 'equality' constraint. The result of the comparison. + + + - Perform generic comparison on two values where the type of the values is not + Perform generic comparison on two values where the type of the values is not statically required to have the 'comparison' constraint. The result of the comparison. + + + Generate a default value for any type. This is null for reference types, For structs, this is struct value where all fields have the default value. This function is unsafe in the sense that some F# values do not have proper null values. + + + Unboxes a strongly typed value. This is the inverse of box, unbox<t>(box<t> a) equals a. @@ -12716,6 +22092,9 @@ The boxed value. The unboxed result. + + + This module contains basic operations which do not apply runtime and/or static checks @@ -12879,7 +22258,7 @@ The substring from the given indices. - + Sets a slice of an array The target array. @@ -12893,7 +22272,7 @@ The end index of the fourth dimension. The source array. - + Sets a 1D slice of a 4D array The target array. @@ -12904,7 +22283,7 @@ The fixed index of the fourth dimension. The source array. - + Sets a 1D slice of a 4D array The target array. @@ -12915,7 +22294,7 @@ The fixed index of the fourth dimension. The source array. - + Sets a 1D slice of a 4D array The target array. @@ -12926,7 +22305,7 @@ The fixed index of the fourth dimension. The source array. - + Sets a 1D slice of a 4D array The target array. @@ -12937,7 +22316,7 @@ The end index of the fourth dimension. The source array. - + Sets a 2D slice of a 4D array The target array. @@ -12949,7 +22328,7 @@ The fixed index of the fourth dimension. The source array. - + Sets a 2D slice of a 4D array The target array. @@ -12961,7 +22340,7 @@ The fixed index of the fourth dimension. The source array. - + Sets a 2D slice of a 4D array The target array. @@ -12973,7 +22352,7 @@ The end index of the fourth dimension. The source array. - + Sets a 2D slice of a 4D array The target array. @@ -12985,7 +22364,7 @@ The fixed index of the fourth dimension. The source array. - + Sets a 2D slice of a 4D array The target array. @@ -12997,7 +22376,7 @@ The end index of the fourth dimension. The source array. - + Sets a 2D slice of a 4D array The target array. @@ -13009,7 +22388,7 @@ The end index of the fourth dimension. The source array. - + Sets a 3D slice of a 4D array The target array. @@ -13022,7 +22401,7 @@ The fixed index of the fourth dimension. The source array. - + Sets a 3D slice of a 4D array The target array. @@ -13035,7 +22414,7 @@ The end index of the fourth dimension. The source array. - + Sets a 3D slice of a 4D array The target array. @@ -13048,7 +22427,7 @@ The end index of the fourth dimension. The source array. - + Sets a 3D slice of a 4D array The target array. @@ -13061,7 +22440,7 @@ The end index of the fourth dimension. The source array. - + Gets a 1D slice of a 4D array The source array. @@ -13073,7 +22452,7 @@ The one dimensional sub array from the given indices. - + Gets a 1D slice of a 4D array The source array. @@ -13085,7 +22464,7 @@ The one dimensional sub array from the given indices. - + Gets a 1D slice of a 4D array The source array. @@ -13097,7 +22476,7 @@ The one dimensional sub array from the given indices. - + Gets a 1D slice of a 4D array The source array. @@ -13109,7 +22488,7 @@ The one dimensional sub array from the given indices. - + Gets a 2D slice of a 4D array The source array. @@ -13122,7 +22501,7 @@ The two dimensional sub array from the given indices. - + Gets a 2D slice of a 4D array The source array. @@ -13135,7 +22514,7 @@ The two dimensional sub array from the given indices. - + Gets a 2D slice of a 4D array The source array. @@ -13148,7 +22527,7 @@ The two dimensional sub array from the given indices. - + Gets a 2D slice of a 4D array The source array. @@ -13161,7 +22540,7 @@ The two dimensional sub array from the given indices. - + Gets a 2D slice of a 4D array The source array. @@ -13174,7 +22553,7 @@ The two dimensional sub array from the given indices. - + Gets a 2D slice of a 4D array The source array. @@ -13187,7 +22566,7 @@ The two dimensional sub array from the given indices. - + Gets a 3D slice of a 4D array The source array. @@ -13201,7 +22580,7 @@ The three dimensional sub array from the given indices. - + Gets a 3D slice of a 4D array The source array. @@ -13215,7 +22594,7 @@ The three dimensional sub array from the given indices. - + Gets a 3D slice of a 4D array The source array. @@ -13229,7 +22608,7 @@ The three dimensional sub array from the given indices. - + Gets a 3D slice of a 4D array The source array. @@ -13243,7 +22622,7 @@ The three dimensional sub array from the given indices. - + Gets a slice of an array The source array. @@ -13258,7 +22637,7 @@ The four dimensional sub array from the given indices. - + Sets a 1D slice of a 3D array. The target array. @@ -13270,7 +22649,7 @@ The one dimensional sub array from the given indices. - + Sets a 1D slice of a 3D array. The target array. @@ -13282,7 +22661,7 @@ The one dimensional sub array from the given indices. - + Sets a 1D slice of a 3D array. The target array. @@ -13294,7 +22673,7 @@ The one dimensional sub array from the given indices. - + Sets a 2D slice of a 3D array The target array. @@ -13307,7 +22686,7 @@ The two dimensional sub array from the given indices. - + Sets a 2D slice of a 3D array The target array. @@ -13320,7 +22699,7 @@ The two dimensional sub array from the given indices. - + Sets a 2D slice of a 3D array The target array. @@ -13333,7 +22712,7 @@ The two dimensional sub array from the given indices. - + Sets a slice of an array The target array. @@ -13345,7 +22724,7 @@ The end index of the third dimension. The source array. - + Gets a 1D slice of a 3D array. The source array. @@ -13356,7 +22735,7 @@ The one dimensional sub array from the given indices. - + Gets a 1D slice of a 3D array. The source array. @@ -13367,7 +22746,7 @@ The one dimensional sub array from the given indices. - + Gets a 1D slice of a 3D array. The source array. @@ -13378,7 +22757,7 @@ The one dimensional sub array from the given indices. - + Gets a 2D slice of a 3D array. The source array. @@ -13390,7 +22769,7 @@ The two dimensional sub array from the given indices. - + Gets a 2D slice of a 3D array. The source array. @@ -13402,7 +22781,7 @@ The two dimensional sub array from the given indices. - + Gets a 2D slice of a 3D array. The source array. @@ -13414,7 +22793,7 @@ The two dimensional sub array from the given indices. - + Gets a slice of an array The source array. @@ -13427,7 +22806,7 @@ The three dimensional sub array from the given indices. - + Sets a vector slice of a 2D array. The index of the second dimension is fixed. The target array. @@ -13436,7 +22815,7 @@ The index of the second dimension. The source array. - + Sets a vector slice of a 2D array. The index of the first dimension is fixed. The target array. @@ -13445,7 +22824,7 @@ The end index of the second dimension. The source array. - + Sets a region slice of an array The target array. @@ -13455,7 +22834,7 @@ The end index of the second dimension. The source array. - + Gets a vector slice of a 2D array. The index of the second dimension is fixed. The source array. @@ -13465,7 +22844,7 @@ The sub array from the input indices. - + Gets a vector slice of a 2D array. The index of the first dimension is fixed. The source array. @@ -13475,7 +22854,7 @@ The sub array from the input indices. - + Gets a region slice of an array The source array. @@ -13523,7 +22902,7 @@ The corresponding index from the start. - + Get the index for the element offset elements away from the end of the collection. The rank of the index. This refers to the dimension in the 2d array. @@ -13531,7 +22910,7 @@ The corresponding index from the start. - + Get the index for the element offset elements away from the end of the collection. The rank of the index. This refers to the dimension in the 3d array. @@ -13539,7 +22918,7 @@ The corresponding index from the start. - + Get the index for the element offset elements away from the end of the collection. The rank of the index. This refers to the dimension in the 4d array. @@ -14150,27 +23529,27 @@ The F# compiler emits calls to some of the functions in this module as part of the compiled form of some language constructs - + The standard overloaded associative (4-indexed) mutation operator - + The standard overloaded associative (3-indexed) mutation operator - + The standard overloaded associative (2-indexed) mutation operator The standard overloaded associative (indexed) mutation operator - + The standard overloaded associative (4-indexed) lookup operator - + The standard overloaded associative (3-indexed) lookup operator - + The standard overloaded associative (2-indexed) lookup operator @@ -14285,6 +23664,13 @@ The input value. The result value, which is null if the input was ValueNone. + + + + (ValueNone: string ValueOption) |> ValueOption.toObj // evaluates to null + ValueSome "not a null string" |> ValueOption.toObj // evaluates to "not a null string" + + Convert a potentially null value to a value option. @@ -14292,6 +23678,13 @@ The input value. The result value option. + + + + (null: string) |> ValueOption.ofObj // evaluates to ValueNone + "not a null string" |> ValueOption.ofObj // evaluates to (ValueSome "not a null string") + + Convert a Nullable value to a value option. @@ -14299,6 +23692,13 @@ The input nullable value. The result value option. + + + + System.Nullable<int>() |> ValueOption.ofNullable // evaluates to ValueNone + System.Nullable(42) |> ValueOption.ofNullable // evaluates to ValueSome 42 + + Convert the value option to a Nullable value. @@ -14306,6 +23706,13 @@ The input value option. The result value. + + + + (ValueNone: int ValueOption) |> ValueOption.toNullable // evaluates to new System.Nullable<int>() + ValueSome 42 |> ValueOption.toNullable // evaluates to new System.Nullable(42) + + Convert the value option to a list of length 0 or 1. @@ -14313,6 +23720,13 @@ The input value option. The result list. + + + + (ValueNone: int ValueOption) |> ValueOption.toList // evaluates to [] + ValueSome 42 |> ValueOption.toList // evaluates to [42] + + Convert the value option to an array of length 0 or 1. @@ -14320,6 +23734,13 @@ The input value option. The result array. + + + + (ValueNone: int ValueOption) |> ValueOption.toArray // evaluates to [||] + ValueSome 42 |> ValueOption.toArray // evaluates to [|42|] + + filter f inp evaluates to match inp with ValueNone -> ValueNone | ValueSome x -> if f x then ValueSome x else ValueNone. @@ -14328,6 +23749,14 @@ The input value option. The input if the predicate evaluates to true; otherwise, ValueNone. + + + + ValueNone |> ValueOption.filter (fun x -> x >= 5) // evaluates to ValueNone + ValueSome 42 |> ValueOption.filter (fun x -> x >= 5) // evaluates to ValueSome 42 + ValueSome 4 |> ValueOption.filter (fun x -> x >= 5) // evaluates to ValueNone + + flatten inp evaluates to match inp with ValueNone -> ValueNone | ValueSome x -> x @@ -14336,6 +23765,14 @@ The input value if the value is Some; otherwise, ValueNone. flatten is equivalent to bind id. + + + + (ValueNone: int ValueOption ValueOption) |> ValueOption.flatten // evaluates to ValueNone + (ValueSome ((ValueNone: int ValueOption))) |> ValueOption.flatten // evaluates to ValueNone + (ValueSome (ValueSome 42)) |> ValueOption.flatten // evaluates to ValueSome 42 + + bind f inp evaluates to match inp with ValueNone -> ValueNone | ValueSome x -> f x @@ -14345,6 +23782,18 @@ The input value option. An option of the output type of the binder. + + + + let tryParse input = + match System.Int32.TryParse (input: string) with + | true, v -> ValueSome v + | false, _ -> ValueNone + ValueNone |> ValueOption.bind tryParse // evaluates to ValueNone + ValueSome "42" |> ValueOption.bind tryParse // evaluates to ValueSome 42 + ValueSome "Forty-two" |> ValueOption.bind tryParse // evaluates to ValueNone + + map f voption1 voption2 voption3 evaluates to match voption1, voption2, voption3 with ValueSome x, ValueSome y, ValueSome z -> ValueSome (f x y z) | _ -> ValueNone. @@ -14355,6 +23804,16 @@ The third value option. A value option of the input values after applying the mapping function, or ValueNone if any input is ValueNone. + + + + (ValueNone, ValueNone, ValueNone) |||> ValueOption.map3 (fun x y z -> x + y + z) // evaluates to ValueNone + (ValueSome 100, ValueNone, ValueNone) |||> ValueOption.map3 (fun x y z -> x + y + z) // evaluates to ValueNone + (ValueNone, ValueSome 100, ValueNone) |||> ValueOption.map3 (fun x y z -> x + y + z) // evaluates to ValueNone + (ValueNone, ValueNone, ValueSome 100) |||> ValueOption.map3 (fun x y z -> x + y + z) // evaluates to ValueNone + (ValueSome 5, ValueSome 100, ValueSome 10) |||> ValueOption.map3 (fun x y z -> x + y + z) // evaluates to ValueSome 115 + + map f voption1 voption2 evaluates to match voption1, voption2 with ValueSome x, ValueSome y -> ValueSome (f x y) | _ -> ValueNone. @@ -14364,6 +23823,15 @@ The second value option. A value option of the input values after applying the mapping function, or ValueNone if either input is ValueNone. + + + + (ValueNone, ValueNone) ||> ValueOption.map2 (fun x y -> x + y) // evaluates to ValueNone + (ValueSome 5, ValueNone) ||> ValueOption.map2 (fun x y -> x + y) // evaluates to ValueNone + (ValueNone, ValueSome 10) ||> ValueOption.map2 (fun x y -> x + y) // evaluates to ValueNone + (ValueSome 5, ValueSome 10) ||> ValueOption.map2 (fun x y -> x + y) // evaluates to ValueSome 15 + + map f inp evaluates to match inp with ValueNone -> ValueNone | ValueSome x -> ValueSome (f x). @@ -14372,6 +23840,13 @@ The input value option. A value option of the input value after applying the mapping function, or ValueNone if the input is ValueNone. + + + + ValueNone |> ValueOption.map (fun x -> x * 2) // evaluates to ValueNone + ValueSome 42 |> ValueOption.map (fun x -> x * 2) // evaluates to ValueSome 84 + + iter f inp executes match inp with ValueNone -> () | ValueSome x -> f x. @@ -14379,8 +23854,12 @@ A function to apply to the voption value. The input value option. - Unit if the option is ValueNone, otherwise it returns the result of applying the predicate - to the voption value. + + + ValueNone |> ValueOption.iter (printfn "%s") // does nothing + ValueSome "Hello world" |> ValueOption.iter (printfn "%s") // prints "Hello world" + + Evaluates to true if is ValueSome and its value is equal to . @@ -14389,6 +23868,14 @@ The input value option. True if the option is ValueSome and contains a value equal to , otherwise false. + + + + (99, ValueNone) ||> ValueOption.contains // evaluates to false + (99, ValueSome 99) ||> ValueOption.contains // evaluates to true + (99, ValueSome 100) ||> ValueOption.contains // evaluates to false + + forall p inp evaluates to match inp with ValueNone -> true | ValueSome x -> p x. @@ -14398,6 +23885,14 @@ True if the option is None, otherwise it returns the result of applying the predicate to the option value. + + + + ValueNone |> ValueOption.forall (fun x -> x >= 5) // evaluates to true + ValueSome 42 |> ValueOption.forall (fun x -> x >= 5) // evaluates to true + ValueSome 4 |> ValueOption.forall (fun x -> x >= 5) // evaluates to false + + exists p inp evaluates to match inp with ValueNone -> false | ValueSome x -> p x. @@ -14407,6 +23902,14 @@ False if the option is ValueNone, otherwise it returns the result of applying the predicate to the option value. + + + + ValueNone |> ValueOption.exists (fun x -> x >= 5) // evaluates to false + ValueSome 42 |> ValueOption.exists (fun x -> x >= 5) // evaluates to true + ValueSome 4 |> ValueOption.exists (fun x -> x >= 5) // evaluates to false + + fold f inp s evaluates to match inp with ValueNone -> s | ValueSome x -> f x s. @@ -14417,6 +23920,14 @@ The original state if the option is ValueNone, otherwise it returns the updated state with the folder and the voption value. + + + + (ValueNone, 0) ||> ValueOption.foldBack (fun x accum -> accum + x * 2) // evaluates to 0 + (ValueSome 1, 0) ||> ValueOption.foldBack (fun x accum -> accum + x * 2) // evaluates to 2 + (ValueSome 1, 10) ||> ValueOption.foldBack (fun x accum -> accum + x * 2) // evaluates to 12 + + fold f s inp evaluates to match inp with ValueNone -> s | ValueSome x -> f s x. @@ -14427,6 +23938,14 @@ The original state if the option is ValueNone, otherwise it returns the updated state with the folder and the voption value. + + + + (0, ValueNone) ||> ValueOption.fold (fun accum x -> accum + x * 2) // evaluates to 0 + (0, ValueSome 1) ||> ValueOption.fold (fun accum x -> accum + x * 2) // evaluates to 2 + (10, ValueSome 1) ||> ValueOption.fold (fun accum x -> accum + x * 2) // evaluates to 12 + + count inp evaluates to match inp with ValueNone -> 0 | ValueSome _ -> 1. @@ -14434,6 +23953,13 @@ The input value option. A zero if the option is ValueNone, a one otherwise. + + + + ValueNone |> ValueOption.count // evaluates to 0 + ValueSome 99 |> ValueOption.count // evaluates to 1 + + Gets the value associated with the option. @@ -14442,6 +23968,13 @@ The value within the option. Thrown when the option is ValueNone. + + + + ValueSome 42 |> ValueOption.get // evaluates to 42 + (ValueNone: int ValueOption) |> ValueOption.get // throws exception! + + Returns if it is Some, otherwise evaluates and returns the result. @@ -14451,6 +23984,15 @@ The voption if the voption is ValueSome, else the result of evaluating . is not evaluated unless is ValueNone. + + + + (ValueNone: int ValueOption) |> ValueOption.orElseWith (fun () -> ValueNone) // evaluates to ValueNone + ValueNone |> ValueOption.orElseWith (fun () -> (ValueSome 99)) // evaluates to ValueSome 99 + ValueSome 42 |> ValueOption.orElseWith (fun () -> ValueNone) // evaluates to ValueSome 42 + ValueSome 42 |> ValueOption.orElseWith (fun () -> (ValueSome 99)) // evaluates to ValueSome 42 + + Returns if it is Some, otherwise returns . @@ -14459,6 +24001,15 @@ The input option. The option if the option is Some, else the alternate option. + + + + ((ValueNone: int ValueOption), ValueNone) ||> ValueOption.orElse // evaluates to ValueNone + (ValueSome 99, ValueNone) ||> ValueOption.orElse // evaluates to ValueSome 99 + (ValueNone, ValueSome 42) ||> ValueOption.orElse // evaluates to ValueSome 42 + (ValueSome 99, ValueSome 42) ||> ValueOption.orElse // evaluates to ValueSome 42 + + Gets the value of the voption if the voption is ValueSome, otherwise evaluates and returns the result. @@ -14468,6 +24019,13 @@ The voption if the voption is ValueSome, else the result of evaluating . is not evaluated unless is ValueNone. + + + + ValueNone |> ValueOption.defaultWith (fun () -> 99) // evaluates to 99 + ValueSome 42 |> ValueOption.defaultWith (fun () -> 99) // evaluates to 42 + + Gets the value of the value option if the option is ValueSome, otherwise returns the specified default value. @@ -14477,6 +24035,13 @@ The voption if the voption is ValueSome, else the default value. Identical to the built-in operator, except with the arguments swapped. + + + + (99, ValueNone) ||> ValueOption.defaultValue // evaluates to 99 + (99, ValueSome 42) ||> ValueOption.defaultValue // evaluates to 42 + + Returns true if the value option is ValueNone. @@ -14484,6 +24049,13 @@ The input value option. True if the voption is ValueNone. + + + + ValueNone |> ValueOption.isNone // evaluates to true + ValueSome 42 |> ValueOption.isNone // evaluates to false + + Returns true if the value option is not ValueNone. @@ -14491,6 +24063,13 @@ The input value option. True if the value option is not ValueNone. + + + + ValueNone |> ValueOption.isSome // evaluates to false + ValueSome 42 |> ValueOption.isSome // evaluates to true + + Contains operations for working with value options. @@ -14502,84 +24081,84 @@ The input value. - - - None |> Option.toObj // evaluates to null - Some "not a null string" |> Option.toObj // evaluates to "not a null string" + The result value, which is null if the input was None. + + + + (None: string option) |> Option.toObj // evaluates to null + Some "not a null string" |> Option.toObj // evaluates to "not a null string" - - The result value, which is null if the input was None. Convert a potentially null value to an option. The input value. - - - (null: string) |> Option.ofObj // evaluates to None - "not a null string" |> Option.ofObj // evaluates to (Some "not a null string") + The result option. + + + + (null: string) |> Option.ofObj // evaluates to None + "not a null string" |> Option.ofObj // evaluates to (Some "not a null string") - - The result option. Convert a Nullable value to an option. The input nullable value. - - - System.Nullable<int>() |> Option.ofNullable // evaluates to None - System.Nullable(42) |> Option.ofNullable // evaluates to Some 42 + The result option. + + + + System.Nullable<int>() |> Option.ofNullable // evaluates to None + System.Nullable(42) |> Option.ofNullable // evaluates to Some 42 - - The result option. Convert the option to a Nullable value. The input option. - - - None |> Option.toNullable // evaluates to new System.Nullable<int>() - Some 42 |> Option.toNullable // evaluates to new System.Nullable(42) + The result value. + + + + (None: int option) |> Option.toNullable // evaluates to new System.Nullable<int>() + Some 42 |> Option.toNullable // evaluates to new System.Nullable(42) - - The result value. Convert the option to a list of length 0 or 1. The input option. - - - None |> Option.toList // evaluates to [] - Some 42 |> Option.toList // evaluates to [42] + The result list. + + + + (None: int option) |> Option.toList // evaluates to [] + Some 42 |> Option.toList // evaluates to [42] - - The result list. Convert the option to an array of length 0 or 1. The input option. - - - None |> Option.toArray // evaluates to [||] - Some 42 |> Option.toArray // evaluates to [|42|] + The result array. + + + + (None: int option) |> Option.toArray // evaluates to [||] + Some 42 |> Option.toArray // evaluates to [|42|] - - The result array. filter f inp evaluates to match inp with None -> None | Some x -> if f x then Some x else None. @@ -14587,15 +24166,15 @@ A function that evaluates whether the value contained in the option should remain, or be filtered out. The input option. - - - None |> Option.filter (fun x -> x >= 5) // evaluates to None - Some 42 |> Option.filter (fun x -> x >= 5) // evaluates to Some 42 - Some 4 |> Option.filter (fun x -> x >= 5) // evaluates to None + The input if the predicate evaluates to true; otherwise, None. + + + + None |> Option.filter (fun x -> x >= 5) // evaluates to None + Some 42 |> Option.filter (fun x -> x >= 5) // evaluates to Some 42 + Some 4 |> Option.filter (fun x -> x >= 5) // evaluates to None - - The input if the predicate evaluates to true; otherwise, None. flatten inp evaluates to match inp with None -> None | Some x -> x @@ -14603,13 +24182,14 @@ The input option. The input value if the value is Some; otherwise, None. + flatten is equivalent to bind id. - - - None |> Option.flatten // evaluates to None - (Some (None)) |> Option.flatten // evaluates to None - (Some (Some 42)) |> Option.flatten // evaluates to Some 42 + + + (None: int option option) |> Option.flatten // evaluates to None + (Some ((None: int option))) |> Option.flatten // evaluates to None + (Some (Some 42)) |> Option.flatten // evaluates to Some 42 @@ -14620,19 +24200,19 @@ an option containing a value of type U. The input option. - - - let tryParse input = - match System.Int32.TryParse input with - | true, v -> Some v - | false, _ -> None - None |> Option.bind tryParse // evaluates to None - Some "42" |> Option.bind tryParse // evaluates to Some 42 - Some "Forty-two" |> Option.bind tryParse // evaluates to None + An option of the output type of the binder. + + + + let tryParse (input: string) = + match System.Int32.TryParse input with + | true, v -> Some v + | false, _ -> None + None |> Option.bind tryParse // evaluates to None + Some "42" |> Option.bind tryParse // evaluates to Some 42 + Some "Forty-two" |> Option.bind tryParse // evaluates to None - - An option of the output type of the binder. map f option1 option2 option3 evaluates to match option1, option2, option3 with Some x, Some y, Some z -> Some (f x y z) | _ -> None. @@ -14642,17 +24222,17 @@ The second option. The third option. - - - (None, None, None) |||> Option.map3 (fun x y z -> x + y + z) // evaluates to None - (Some 100, None, None) |||> Option.map3 (fun x y z -> x + y + z) // evaluates to None - (None, Some 100, None) |||> Option.map3 (fun x y z -> x + y + z) // evaluates to None - (None, None, Some 100) |||> Option.map3 (fun x y z -> x + y + z) // evaluates to None - (Some 5, Some 100, Some 10) |||> Option.map3 (fun x y z -> x + y + z) // evaluates to Some 115 + An option of the input values after applying the mapping function, or None if any input is None. + + + + (None, None, None) |||> Option.map3 (fun x y z -> x + y + z) // evaluates to None + (Some 100, None, None) |||> Option.map3 (fun x y z -> x + y + z) // evaluates to None + (None, Some 100, None) |||> Option.map3 (fun x y z -> x + y + z) // evaluates to None + (None, None, Some 100) |||> Option.map3 (fun x y z -> x + y + z) // evaluates to None + (Some 5, Some 100, Some 10) |||> Option.map3 (fun x y z -> x + y + z) // evaluates to Some 115 - - An option of the input values after applying the mapping function, or None if any input is None. map f option1 option2 evaluates to match option1, option2 with Some x, Some y -> Some (f x y) | _ -> None. @@ -14661,16 +24241,16 @@ The first option. The second option. - - - (None, None) ||> Option.map2 (fun x y -> x + y) // evaluates to None - (Some 5, None) ||> Option.map2 (fun x y -> x + y) // evaluates to None - (None, Some 10) ||> Option.map2 (fun x y -> x + y) // evaluates to None - (Some 5, Some 10) ||> Option.map2 (fun x y -> x + y) // evaluates to Some 15 + An option of the input values after applying the mapping function, or None if either input is None. + + + + (None, None) ||> Option.map2 (fun x y -> x + y) // evaluates to None + (Some 5, None) ||> Option.map2 (fun x y -> x + y) // evaluates to None + (None, Some 10) ||> Option.map2 (fun x y -> x + y) // evaluates to None + (Some 5, Some 10) ||> Option.map2 (fun x y -> x + y) // evaluates to Some 15 - - An option of the input values after applying the mapping function, or None if either input is None. map f inp evaluates to match inp with None -> None | Some x -> Some (f x). @@ -14678,14 +24258,14 @@ A function to apply to the option value. The input option. - - - None |> Option.map (fun x -> x * 2) // evaluates to None - Some 42 |> Option.map (fun x -> x * 2) // evaluates to Some 84 + An option of the input value after applying the mapping function, or None if the input is None. + + + + None |> Option.map (fun x -> x * 2) // evaluates to None + Some 42 |> Option.map (fun x -> x * 2) // evaluates to Some 84 - - An option of the input value after applying the mapping function, or None if the input is None. iter f inp executes match inp with None -> () | Some x -> f x. @@ -14693,15 +24273,12 @@ A function to apply to the option value. The input option. - - - None |> Option.iter (printfn "%s") // does nothing - Some "Hello world" |> Option.iter (printfn "%s") // prints "Hello world" + + + None |> Option.iter (printfn "%s") // does nothing + Some "Hello world" |> Option.iter (printfn "%s") // prints "Hello world" - - Unit if the option is None, otherwise it returns the result of applying the predicate - to the option value. Evaluates to true if is Some and its value is equal to . @@ -14709,15 +24286,15 @@ The value to test for equality. The input option. - - - (99, None) ||> Option.contains // evaluates to false - (99, Some 99) ||> Option.contains // evaluates to true - (99, Some 100) ||> Option.contains // evaluates to false + True if the option is Some and contains a value equal to , otherwise false. + + + + (99, None) ||> Option.contains // evaluates to false + (99, Some 99) ||> Option.contains // evaluates to true + (99, Some 100) ||> Option.contains // evaluates to false - - True if the option is Some and contains a value equal to , otherwise false. forall p inp evaluates to match inp with None -> true | Some x -> p x. @@ -14725,16 +24302,16 @@ A function that evaluates to a boolean when given a value from the option type. The input option. - - - None |> Option.forall (fun x -> x >= 5) // evaluates to true - Some 42 |> Option.forall (fun x -> x >= 5) // evaluates to true - Some 4 |> Option.forall (fun x -> x >= 5) // evaluates to false - - - True if the option is None, otherwise it returns the result of applying the predicate to the option value. + + + + None |> Option.forall (fun x -> x >= 5) // evaluates to true + Some 42 |> Option.forall (fun x -> x >= 5) // evaluates to true + Some 4 |> Option.forall (fun x -> x >= 5) // evaluates to false + + exists p inp evaluates to match inp with None -> false | Some x -> p x. @@ -14742,16 +24319,16 @@ A function that evaluates to a boolean when given a value from the option type. The input option. - - - None |> Option.exists (fun x -> x >= 5) // evaluates to false - Some 42 |> Option.exists (fun x -> x >= 5) // evaluates to true - Some 4 |> Option.exists (fun x -> x >= 5) // evaluates to false - - - False if the option is None, otherwise it returns the result of applying the predicate to the option value. + + + + None |> Option.exists (fun x -> x >= 5) // evaluates to false + Some 42 |> Option.exists (fun x -> x >= 5) // evaluates to true + Some 4 |> Option.exists (fun x -> x >= 5) // evaluates to false + + fold f inp s evaluates to match inp with None -> s | Some x -> f x s. @@ -14760,16 +24337,16 @@ The input option. The initial state. - - - (None, 0) ||> Option.foldBack (fun x accum -> accum + x * 2) // evaluates to 0 - (Some 1, 0) ||> Option.foldBack (fun x accum -> accum + x * 2) // evaluates to 2 - (Some 1, 10) ||> Option.foldBack (fun x accum -> accum + x * 2) // evaluates to 12 - - - The original state if the option is None, otherwise it returns the updated state with the folder and the option value. + + + + (None, 0) ||> Option.foldBack (fun x accum -> accum + x * 2) // evaluates to 0 + (Some 1, 0) ||> Option.foldBack (fun x accum -> accum + x * 2) // evaluates to 2 + (Some 1, 10) ||> Option.foldBack (fun x accum -> accum + x * 2) // evaluates to 12 + + fold f s inp evaluates to match inp with None -> s | Some x -> f s x. @@ -14778,45 +24355,46 @@ The initial state. The input option. - - - (0, None) ||> Option.fold (fun accum x -> accum + x * 2) // evaluates to 0 - (0, Some 1) ||> Option.fold (fun accum x -> accum + x * 2) // evaluates to 2 - (10, Some 1) ||> Option.fold (fun accum x -> accum + x * 2) // evaluates to 12 - - - The original state if the option is None, otherwise it returns the updated state with the folder and the option value. + + + + (0, None) ||> Option.fold (fun accum x -> accum + x * 2) // evaluates to 0 + (0, Some 1) ||> Option.fold (fun accum x -> accum + x * 2) // evaluates to 2 + (10, Some 1) ||> Option.fold (fun accum x -> accum + x * 2) // evaluates to 12 + + count inp evaluates to match inp with None -> 0 | Some _ -> 1. The input option. - - - None |> Option.count // evaluates to 0 - Some 99 |> Option.count // evaluates to 1 + A zero if the option is None, a one otherwise. + + + + None |> Option.count // evaluates to 0 + Some 99 |> Option.count // evaluates to 1 - - A zero if the option is None, a one otherwise. Gets the value associated with the option. The input option. - - - Some 42 |> Option.get // evaluates to 42 - None |> Option.get // throws exception! - - - The value within the option. + Thrown when the option is None. + + + + Some 42 |> Option.get // evaluates to 42 + (None: int option) |> Option.get // throws exception! + + Returns if it is Some, otherwise evaluates and returns the result. @@ -14827,12 +24405,12 @@ The option if the option is Some, else the result of evaluating . is not evaluated unless is None. - - - None |> Option.orElseWith (fun () -> None) // evaluates to None - None |> Option.orElseWith (fun () -> (Some 99)) // evaluates to Some 99 - Some 42 |> Option.orElseWith (fun () -> None) // evaluates to Some 42 - Some 42 |> Option.orElseWith (fun () -> (Some 99)) // evaluates to Some 42 + + + (None: int Option) |> Option.orElseWith (fun () -> None) // evaluates to None + None |> Option.orElseWith (fun () -> (Some 99)) // evaluates to Some 99 + Some 42 |> Option.orElseWith (fun () -> None) // evaluates to Some 42 + Some 42 |> Option.orElseWith (fun () -> (Some 99)) // evaluates to Some 42 @@ -14842,16 +24420,16 @@ The value to use if is None. The input option. - - - (None, None) ||> Option.orElse // evaluates to None - (Some 99, None) ||> Option.orElse // evaluates to Some 99 - (None, Some 42) ||> Option.orElse // evaluates to Some 42 - (Some 99, Some 42) ||> Option.orElse // evaluates to Some 42 - - - The option if the option is Some, else the alternate option. + + + + ((None: int Option), None) ||> Option.orElse // evaluates to None + (Some 99, None) ||> Option.orElse // evaluates to Some 99 + (None, Some 42) ||> Option.orElse // evaluates to Some 42 + (Some 99, Some 42) ||> Option.orElse // evaluates to Some 42 + + Gets the value of the option if the option is Some, otherwise evaluates and returns the result. @@ -14862,10 +24440,10 @@ The option if the option is Some, else the result of evaluating . is not evaluated unless is None. - - - None |> Option.defaultWith (fun () -> 99) // evaluates to 99 - Some 42 |> Option.defaultWith (fun () -> 99) // evaluates to 42 + + + None |> Option.defaultWith (fun () -> 99) // evaluates to 99 + Some 42 |> Option.defaultWith (fun () -> 99) // evaluates to 42 @@ -14879,10 +24457,10 @@ Identical to the built-in operator, except with the arguments swapped. - - - (99, None) ||> Option.defaultValue // evaluates to 99 - (99, Some 42) ||> Option.defaultValue // evaluates to 42 + + + (99, None) ||> Option.defaultValue // evaluates to 99 + (99, Some 42) ||> Option.defaultValue // evaluates to 42 @@ -14891,27 +24469,27 @@ The input option. - - - None |> Option.isNone // evaluates to true - Some 42 |> Option.isNone // evaluates to false + True if the option is None. + + + + None |> Option.isNone // evaluates to true + Some 42 |> Option.isNone // evaluates to false - - True if the option is None. Returns true if the option is not None. The input option. - - - None |> Option.isSome // evaluates to false - Some 42 |> Option.isSome // evaluates to true + True if the option is not None. + + + + None |> Option.isSome // evaluates to false + Some 42 |> Option.isSome // evaluates to true - - True if the option is not None. Contains operations for working with options. @@ -14926,6 +24504,21 @@ The input result. A result of the output type of the binder. + + + + let tryParse (input: string) = + match System.Int32.TryParse input with + | true, v -> Ok v + | false, _ -> Error "couldn't parse" + + Error "message" |> Result.bind tryParse // evaluates to Error "message" + + Ok "42" |> Result.bind tryParse // evaluates to Ok 42 + + Ok "Forty-two" |> Result.bind tryParse // evaluates to Error "couldn't parse" + + map f inp evaluates to match inp with Error x -> Error (f x) | Ok v -> Ok v. @@ -14934,26 +24527,36 @@ The input result. A result of the error value after applying the mapping function, or Ok if the input is Ok. + + + + Ok 1 |> Result.mapError (fun x -> "bar") // evaluates to Ok 1 + + Error "foo" |> Result.mapError (fun x -> "bar") // evaluates to Error "bar" + + map f inp evaluates to match inp with Error e -> Error e | Ok x -> Ok (f x). + A function to apply to the OK result value. The input result. A result of the input value after applying the mapping function, or Error if the input is Error. + + + + Ok 1 |> Result.map (fun x -> "perfect") // evaluates to Ok "perfect" + + Error "message" |> Result.map (fun x -> "perfect") // evaluates to Error "message" + + Contains operations for working with values of type . Choices and Results - - Returns the length of the string. - - The input string. - - The number of characters in the string. - Returns a string by concatenating count instances of str. @@ -14962,22 +24565,107 @@ The concatenated string. Thrown when count is negative. + + + + "Do it!" |> String.replicate 3 + + Evaluates to "Do it!Do it!Do it!". + - - Tests if any character of the string satisfies the given predicate. + + Builds a new string whose characters are the results of applying the function mapping + to each character and index of the input string. - The function to test each character of the string. + The function to apply to each character and index of the string. The input string. - True if any character returns true for the predicate and false otherwise. + The resulting string. + + + + input |> String.mapi (fun i c -> (i, c)) + + Evaluates to [ (0, 'O'); (1, 'K'); (2, '!') ]. + - - Tests if all characters in the string satisfy the given predicate. + + Builds a new string whose characters are the results of applying the function mapping + to each of the characters of the input string. - The function to test each character of the string. + The function to apply to the characters of the string. The input string. - True if all characters return true for the predicate and false otherwise. + The resulting string. + + Changing case to upper for all characters in the input string + + open System + + let input = "Hello there!" + + input |> String.map Char.ToUpper // evaluates "HELLO THERE!" + + + + + Returns the length of the string. + + The input string. + + The number of characters in the string. + + Getting the length of different strings + + String.length null // evaluates 0 + String.length "" // evaluates 0 + String.length "123" // evaluates 3 + + + + + Applies the function action to the index of each character in the string and the + character itself. + + The function to apply to each character and index of the string. + The input string. + + Numbering the characters and printing the associated ASCII code + for each characater in the input string + + let input = "Hello" + input |> String.iteri (fun i c -> printfn "%d. %c %d" (i + 1) c (int c)) + + The sample evaluates as unit, but prints: + + 1. H 72 + 2. e 101 + 3. l 108 + 4. l 108 + 5. o 111 + + + + + Applies the function action to each character in the string. + + The function to be applied to each character of the string. + The input string. + + Printing the ASCII code for each characater in the string + + let input = "Hello" + input |> String.iter (fun c -> printfn "%c %d" c (int c)) + + The sample evaluates as unit, but prints: + + H 72 + e 101 + l 108 + l 108 + o 111 + + Builds a new string whose characters are the results of applying the function mapping @@ -14989,7 +24677,33 @@ be concatenated with the others. The constructed string. + Thrown when count is negative. + + Enumerate digits ASCII codes + + String.init 10 (fun i -> int '0' + i |> sprintf "%d ") + + The sample evaluates to: "48 49 50 51 52 53 54 55 56 57 " + + + + Tests if all characters in the string satisfy the given predicate. + + The function to test each character of the string. + The input string. + + True if all characters return true for the predicate and false otherwise. + + Looking for lowercase characters + + open System + + "all are lower" |> String.forall Char.IsLower // evaluates false + + "allarelower" |> String.forall Char.IsLower // evaluates true + + Builds a new string containing only the characters of the input string @@ -15001,47 +24715,41 @@ The input string. The resulting string. + + Filtering out just alphanumeric characters + + open System + + let input = "0 1 2 3 4 5 6 7 8 9 a A m M" + + input |> String.filter Uri.IsHexDigit // evaluates "123456789aA" + + + Filtering out just digits + + open System + + "hello" |> String.filter Char.IsDigit // evaluates "" + + - - Builds a new string whose characters are the results of applying the function mapping - to each of the characters of the input string and concatenating the resulting - strings. - - The function to produce a string from each character of the input string. - The input string. - - The concatenated string. - - - Builds a new string whose characters are the results of applying the function mapping - to each character and index of the input string. - - The function to apply to each character and index of the string. - The input string. - - The resulting string. - - - Builds a new string whose characters are the results of applying the function mapping - to each of the characters of the input string. - - The function to apply to the characters of the string. - The input string. - - The resulting string. - - - Applies the function action to the index of each character in the string and the - character itself. + + Tests if any character of the string satisfies the given predicate. - The function to apply to each character and index of the string. + The function to test each character of the string. The input string. - - - Applies the function action to each character in the string. - The function to be applied to each character of the string. - The input string. + True if any character returns true for the predicate and false otherwise. + + Looking for uppercase characters + + open System + + "Yoda" |> String.exists Char.IsUpper // evaluates true + + "nope" |> String.exists Char.IsUpper // evaluates false + + Returns a new string made by concatenating the given strings @@ -15053,6 +24761,49 @@ A new string consisting of the concatenated strings separated by the separation string. Thrown when strings is null. + + + + let input1 = ["Stefan"; "says:"; "Hello"; "there!"] + + input1 |> String.concat " " // evaluates "Stefan says: Hello there!" + + let input2 = [0..9] |> List.map string + + input2 |> String.concat "" // evaluates "0123456789" + input2 |> String.concat ", " // evaluates "0, 1, 2, 3, 4, 5, 6, 7, 8, 9" + + let input3 = ["No comma"] + + input3 |> String.concat "," // evaluates "No comma" + + + + + Builds a new string whose characters are the results of applying the function mapping + to each of the characters of the input string and concatenating the resulting + strings. + + The function to produce a string from each character of the input string. + The input string. + + The concatenated string. + + The following samples shows how to interspace spaces in a text + + let input = "Stefan says: Hi!" + + input |> String.collect (sprintf "%c ") + + The sample evaluates to "S t e f a n s a y s : H i ! " + + + How to show the ASCII representation of a very secret text + + "Secret" |> String.collect (fun chr -> int chr |> sprintf "%d ") + + The sample evaluates to "83 101 99 114 101 116 " + Functional programming operators for string processing. Further string operations @@ -15139,6 +24890,13 @@ The input formatter. The arguments of the formatter. + + + + failwithf "That's wrong. Five = %d and six = %d" (3+2) (3+3) + + Throws Exception with message "That's wrong. Five = 5 and six = 6". + sprintf, but call the given 'final' function to generate the result. @@ -15148,6 +24906,15 @@ The input formatter. The arguments of the formatter. + + Using % format patterns: + + open Printf + + ksprintf (fun s -> s + ", done!") $"Write three = {1+2}" + + Evaluates to "Write five = 5, done!". + printf, but call the given 'final' function to generate the result. @@ -15158,6 +24925,15 @@ The input formatter. The arguments of the formatter. + + Using % format patterns: + + open Printf + + kprintf (fun s -> s + ", done!") $"Write three = {1+2}" + + Evaluates to "Write five = 5, done!". + fprintf, but call the given 'final' function to generate the result. @@ -15168,6 +24944,18 @@ The input formatter. The arguments of the formatter. + + Using % format patterns: + + open Printf + open System.IO + + let file = File.CreateText("out.txt") + + kfprintf (fun () -> file.Close()) $"Write three = {1+2}" + + Writes "Write five = 5" to out.txt. + bprintf, but call the given 'final' function to generate the result. @@ -15178,6 +24966,18 @@ The input formatter. The arguments of the formatter. + + Using % format patterns: + + open Printf + open System.Text + + let buffer = new StringBuilder() + + kbprintf (fun () -> buffer.ToString()) buffer "Write five = %d" (3+2) + + Evaluates to "Write five = 5". + Print to a string via an internal string buffer and return @@ -15186,6 +24986,13 @@ The input formatter. The formatted string. + + + + sprintf "Write five = %d and six = %d" (3+2) (3+3) + + Evaluates to "Write five = 5 and six = 6". + Formatted printing to stdout, adding a newline. @@ -15193,6 +25000,22 @@ The input formatter. The return type and arguments of the formatter. + + Using interpolated strings: + + printfn $"Write three = {1+2}" + printfn $"Write four = {2+2}" + + After evaluation the two lines are written to stdout. + + + Using % format patterns: + + printfn "Write five = %d" (3+2) + printfn "Write six = %d" (3+3) + + After evaluation the two lines are written to stdout. + Formatted printing to stdout @@ -15200,6 +25023,20 @@ The input formatter. The return type and arguments of the formatter. + + Using interpolated strings: + + printf $"Write three = {1+2}" + + After evaluation the text "Write three = 3" is written to stdout. + + + Using % format patterns: + + printf "Write five = %d" (3+2) + + After evaluation the text "Write five = 5" is written to stdout. + Formatted printing to stderr, adding a newline @@ -15207,6 +25044,22 @@ The input formatter. The return type and arguments of the formatter. + + Using interpolated strings: + + eprintfn $"Write three = {1+2}" + eprintfn $"Write four = {2+2}" + + After evaluation two lines are written to stderr. + + + Using % format patterns: + + eprintfn "Write five = %d" (3+2) + eprintfn "Write six = %d" (3+3) + + After evaluation two lines are written to stderr. + Formatted printing to stderr @@ -15214,14 +25067,57 @@ The input formatter. The return type and arguments of the formatter. + + Using interpolated strings: + + eprintf $"Write three = {1+2}" + + After evaluation the text "Write three = 3" is written to stderr. + + + Using % format patterns: + + eprintf "Write five = %d" (3+2) + + After evaluation the text "Write five = 5" is written to stderr. + Print to a text writer, adding a newline - The TextWriter to print to. - The input formatter. + The TextWriter to print to. + The input formatter. + + The return type and arguments of the formatter. + + + Using interpolated strings: + + open Printf + open System.IO + + let file = File.CreateText("out.txt") + + fprintfn file $"Write three = {1+2}" + fprintfn file $"Write four = {2+2}" + file.Close() + + After evaluation the file contains two lines. + + + Using % format patterns: + + open Printf + open System.IO + + let file = File.CreateText("out.txt") - The return type and arguments of the formatter. + fprintfn file "Write five = %d" (3+2) + fprintfn file "Write six = %d" (3+3) + file.Close() + + After evaluation the file contains two lines. + Print to a text writer. @@ -15230,14 +25126,66 @@ The input formatter. The return type and arguments of the formatter. + + Using interpolated strings: + + open Printf + open System.IO + + let file = File.CreateText("out.txt") + + fprintf file $"Write three = {1+2}" + file.Close() + + After evaluation the file contains the text "Write three = 3". + + + Using % format patterns: + + open Printf + open System.IO + + let file = File.CreateText("out.txt") + + fprintf file "Write five = %d" (3+2) + file.Close() + + After evaluation the file contains the text "Write five = 5". + Print to a The StringBuilder to print to. - The input formatter. + The input format or interpolated string. The return type and arguments of the formatter. + + Using interpolated strings: + + open Printf + open System.Text + + let buffer = new StringBuilder() + + bprintf buffer $"Write three = {1+2}" + buffer.ToString() + + Evaluates to "Write three = 3". + + + Using % format patterns: + + open Printf + open System.Text + + let buffer = new StringBuilder() + + bprintf buffer "Write five = %d" (3+2) + buffer.ToString() + + Evaluates to "Write five = 5". + Extensible printf-style formatting for numbers and other datatypes @@ -15308,7 +25256,7 @@ A new enumerator for the sequence. - + The F# compiler emits implementations of this type for compiled sequence expressions. A reference to the sequence. @@ -15326,6 +25274,140 @@ The F# compiler emits implementations of this type for compiled sequence expressions. + + Creates an instance of the attribute + NoEagerConstraintApplicationAttribute + + + Adding this attribute to the method adjusts the processing of some generic methods + during overload resolution. + + During overload resolution, caller arguments are matched with called arguments + to extract type information. By default, when the caller argument type is unconstrained (for example + a simple value x without known type information), and a method qualifies for + lambda constraint propagation, then member trait constraints from a method overload + are eagerly applied to the caller argument type. This causes that overload to be preferred, + regardless of other method overload resolution rules. Using this attribute suppresses this behaviour. + + + + Consider the following overloads: + + type OverloadsWithSrtp() = + [<NoEagerConstraintApplicationAttribute>] + static member inline SomeMethod< ^T when ^T : (member Number: int) > (x: ^T, f: ^T -> int) = 1 + static member SomeMethod(x: 'T list, f: 'T list -> int) = 2 + + let inline f x = + OverloadsWithSrtp.SomeMethod (x, (fun a -> 1)) + + With the attribute, the overload resolution fails, because both members are applicable. + Without the attribute, the overload resolution succeeds, because the member constraint is + eagerly applied, making the second member non-applicable. + + Attributes + + + + Defines the implementation of the code run after the creation of a struct state machine. + + + + + Defines the implementation of the SetStateMachine method for a struct state machine. + + + + + Defines the implementation of the MoveNext method for a struct state machine. + + + + + A special compiler-recognised delegate type for specifying blocks of resumable code + with access to the state machine. + + + + + Represents the runtime continuation of a resumable state machine created dynamically + + + + + The continuation of the state machine + + + + + Additional data associated with the state machine + + + + + The continuation of the state machine + + + + + Additional data associated with the state machine + + + + + Executes the SetStateMachine implementation of the state machine + + + + + Executes the MoveNext implementation of the state machine + + + + + Create dynamic information for a state machine + + + + + Represents the delegated runtime continuation of a resumable state machine created dynamically + + + + + Copy-out or copy-in the data of the state machine + + + + + Get the resumption point of the state machine + + + + + Copy-out or copy-in the data of the state machine + + + + Represents the delegated runtime continuation for a resumable state machine created dynamically + This field is removed from state machines generated using '__stateMachine'. Resumable code + used in state machines which accesses this field will raise a runtime exception. + + + + When statically compiled, holds the continuation goto-label further execution of the state machine + + + + + When statically compiled, holds the data for the state machine + + + + + Acts as a template for struct state machines introduced by __stateMachine, and also as a reflective implementation + + Get the static parameters for a provided method. @@ -15377,7 +25459,7 @@ - Namespace name the this TypeProvider injects types into. + Gets the namespaces provided by the type provider. @@ -15399,7 +25481,9 @@ Apply static arguments to a provided type that accepts static arguments. + The provider must return a type with the given mangled name. + the provided type definition which has static parameters the full path of the type, including encoded representations of static parameters the static parameters, indexed by name @@ -15528,16 +25612,40 @@ Indicates that a code editor should hide all System.Object methods from the intellisense menus for instances of a provided type + + Gets or sets the line for the location. + + + Gets or sets the file path for the definition location. + + + Gets or sets the column for the location. + + + Gets or sets the line for the location. + + + Gets or sets the file path for the definition location. + + + Gets or sets the column for the location. + + + A type provider may provide an instance of this attribute to indicate the definition location for a provided type or member. + + + Gets the comment text. + Creates an instance of the attribute TypeProviderXmlDocAttribute - - The TypeProviderXmlDocAttribute attribute can be added to types and members. - The language service will display the CommentText property from the attribute - in the appropriate place when the user hovers over a type or member. - + A type provider may provide an instance of this attribute to indicate the documentation to show for + a provided type or member. + + + Gets the assembly name. Creates an instance of the attribute @@ -15549,8 +25657,8 @@ TypeProviderAssemblyAttribute - Place attribute on runtime assembly to indicate that there is a corresponding design-time - assembly that contains a type provider. Runtime and designer assembly may be the same. + Place this attribute on a runtime assembly to indicate that there is a corresponding design-time + assembly that contains a type provider. Runtime and design-time assembly may be the same. Additional type attribute flags related to provided types @@ -15596,7 +25704,7 @@ The F# compiler emits calls to this function to implement the compiler-intrinsic - conversions from untyped System.Collections.IEnumerable sequences to typed sequences. + conversions from untyped IEnumerable sequences to typed sequences. An initializer function. A function to iterate and test if end of sequence is reached. @@ -15625,50 +25733,322 @@ A group of functions used as part of the compiled representation of F# sequence expressions. + + + Statically generates a closure struct type based on ResumableStateMachine, + At runtime an instance of the new struct type is populated and 'afterMethod' is called + to consume it. + + + + At compile-time, the ResumableStateMachine type guides the generation of a new struct type by the F# compiler + with closure-capture fields in a way similar to an object expression. + Any mention of the ResumableStateMachine type in any the 'methods' is rewritten to this + fresh struct type. The 'methods' are used to implement the interfaces on ResumableStateMachine and are also rewritten. + The 'after' method is then executed and must eliminate the ResumableStateMachine. For example, + its return type must not include ResumableStateMachine. + + Gives the implementation of the MoveNext method on IAsyncStateMachine. + Gives the implementation of the SetStateMachine method on IAsyncStateMachine. + Gives code to execute after the generation of the state machine and to produce the final result. + + + + Indicates to jump to a resumption point within resumable code. + This may be the first statement in a MoveNextMethodImpl. + The integer must be a valid resumption point within this resumable code. + + + + + + Indicates a resumption point within resumable code + + + + + When used in a conditional, statically determines whether the 'then' branch + represents valid resumable code and provides an alternative implementation + if not. + + + + + Contains compiler intrinsics related to the definition of state machines. + + + + + The dynamic implementation of the corresponding operation. This operation should not be used directly. + + + + + The dynamic implementation of the corresponding operation. This operation should not be used directly. + + + + + The dynamic implementation of the corresponding operation. This operation should not be used directly. + + + + + The dynamic implementation of the corresponding operation. This operation should not be used directly. + + + + + The dynamic implementation of the corresponding operation. This operation should not be used directly. + + + + + Specifies resumable code which does nothing + + + + + Specifies resumable code which executes a loop + + + + + Specifies resumable code which executes with 'use' semantics + + + + + Specifies resumable code which executes with try/with semantics + + + + + Specifies resumable code which executes with try/finally semantics + + + + + Specifies resumable code which executes with try/finally semantics + + + + + Specifies resumable code which iterates yields + + + + + Specifies resumable code which iterates an input sequence + + + + + Creates resumable code whose definition is a delayed function + + + + + Sequences one section of resumable code after another + + + + + Contains functions for composing resumable code blocks + + Builds a query using query syntax and operators. + + + + let findEvensAndSortAndDouble(xs: System.Linq.IQueryable<int>) = + query { + for x in xs do + where (x % 2 = 0) + sortBy x + select (x+x) + } + + let data = [1; 2; 6; 7; 3; 6; 2; 1] + + findEvensAndSortAndDouble (data.AsQueryable()) |> Seq.toList + + Evaluates to [4; 4; 12; 12]. + An active pattern to force the execution of values of type Lazy<_>. + + + + let f (Lazy v) = v + v + + let v = lazy (printf "eval!"; 5+5) + + f v + f v + + Evaluates to 10. The text eval! is printed once on the first invocation of f. + Special prefix operator for splicing untyped expressions into quotation holes. + + + + let f v = <@@ (%%v: int) + (%%v: int) @@> + + f <@@ 5 + 5 @@>;; + + Evaluates to an untyped quotation equivalent to <@@ (5 + 5) + (5 + 5) @@> + Special prefix operator for splicing typed expressions into quotation holes. + + + + let f v = <@ %v + %v @> + + f <@ 5 + 5 @>;; + + Evaluates to a quotation equivalent to <@ (5 + 5) + (5 + 5) @> + Builds a 2D array from a sequence of sequences of elements. + + + + array2D [ [ 1.0; 2.0 ]; [ 3.0; 4.0 ] ] + + Evaluates to a 2x2 zero-based array with contents [[1.0; 2.0]; [3.0; 4.0]] + Builds a read-only lookup table from a sequence of key/value pairs. The key objects are indexed using generic hashing and equality. + + + + let table = readOnlyDict [ (1, 100); (2, 200) ] + + table[1] + + Evaluates to 100. + + + + + let table = readOnlyDict [ (1, 100); (2, 200) ] + + table[3] + + Throws System.Collections.Generic.KeyNotFoundException. + Builds a read-only lookup table from a sequence of key/value pairs. The key objects are indexed using generic hashing and equality. + + + + let table = dict [ (1, 100); (2, 200) ] + + table[1] + + Evaluates to 100. + + + + + let table = dict [ (1, 100); (2, 200) ] + + table[3] + + Throws System.Collections.Generic.KeyNotFoundException. + Converts the argument to signed byte. This is a direct conversion for all primitive numeric types. For strings, the input is converted using SByte.Parse() with InvariantCulture settings. Otherwise the operation requires and invokes a ToSByte method on the input type. + + + + int8 -12 + + Evaluates to -12y. + + + + + int8 "3" + + Evaluates to 3y. + Converts the argument to byte. This is a direct conversion for all primitive numeric types. For strings, the input is converted using Byte.Parse() on strings and otherwise requires a ToByte method on the input type. + + + + uint8 12 + + Evaluates to 12uy. + Converts the argument to 64-bit float. + This is a direct conversion for all primitive numeric types. For strings, the input is converted using Double.Parse() with InvariantCulture settings. Otherwise the operation requires and invokes a ToDouble method on the input type. + + + + double 45 + + Evaluates to 45.0. + + + + + double 12.3f + + Evaluates to 12.30000019. + Converts the argument to 32-bit float. + This is a direct conversion for all primitive numeric types. For strings, the input is converted using Single.Parse() with InvariantCulture settings. Otherwise the operation requires and invokes a ToSingle method on the input type. + + + + single 45 + + Evaluates to 45.0f. + Builds an asynchronous workflow using computation expression syntax. + + + + let sleepExample() = + async { + printfn "sleeping" + do! Async.Sleep 10 + printfn "waking up" + return 6 + } + + sleepExample() |> Async.RunSynchronously + + Builds a set from a sequence of objects. The objects are indexed using generic comparison. @@ -15676,6 +26056,13 @@ The input sequence of elements. The created set. + + + + let values = set [ 1; 2; 3; 5; 7; 11 ] + + Evaluates to a set containing the given numbers. + Print to a file using the given format, and add a newline. @@ -15684,6 +26071,8 @@ The formatter. The formatted result. + + See Printf.fprintfn (link: ) for examples. Print to a file using the given format. @@ -15692,6 +26081,8 @@ The formatter. The formatted result. + + See Printf.fprintf (link: ) for examples. Print to a string buffer and raise an exception with the given @@ -15700,6 +26091,8 @@ The formatter. The formatted result. + + See Printf.failwithf (link: ) for examples. Print to a string using the given format. @@ -15707,6 +26100,8 @@ The formatter. The formatted result. + + See Printf.sprintf (link: ) for examples. Print to stderr using the given format, and add a newline. @@ -15714,6 +26109,8 @@ The formatter. The formatted result. + + See Printf.eprintfn (link: ) for examples. Print to stderr using the given format. @@ -15721,6 +26118,8 @@ The formatter. The formatted result. + + See Printf.eprintf (link: ) for examples. Print to stdout using the given format, and add a newline. @@ -15728,6 +26127,8 @@ The formatter. The formatted result. + + See Printf.printfn (link: ) for examples. Print to stdout using the given format. @@ -15735,17 +26136,47 @@ The formatter. The formatted result. + + See Printf.printf (link: ) for examples. Converts the argument to signed byte. This is a direct, checked conversion for all primitive numeric types. For strings, the input is converted using SByte.Parse() with InvariantCulture settings. Otherwise the operation requires and invokes a ToSByte method on the input type. + + + + Checked.int8 -12 + + Evaluates to -12y. + + + + + Checked.int8 "129" + + Throws System.OverflowException. + Converts the argument to byte. This is a direct, checked conversion for all primitive numeric types. For strings, the input is converted using Byte.Parse() on strings and otherwise requires a ToByte method on the input type. + + + + Checked.uint8 12 + + Evaluates to -12y. + + + + + Checked.uint8 -12 + + Throws System.OverflowException. + A set of extra operators and functions. This module is automatically opened in all F# code. diff --git a/src/Fable.Cli/Main.fs b/src/Fable.Cli/Main.fs index 42dcc3299c..f59201c13a 100644 --- a/src/Fable.Cli/Main.fs +++ b/src/Fable.Cli/Main.fs @@ -328,7 +328,7 @@ type ProjectCracked(cliArgs: CliArgs, crackerResponse: CrackerResponse, sourceFi |> getFullProjectOpts // We display "parsed" because "cracked" may not be understood by users - Log.always $"Project an references ({result.ProjectOptions.SourceFiles.Length} files) parsed in %i{ms}ms.{newLine}" + Log.always $"Project and references ({result.ProjectOptions.SourceFiles.Length} source files) parsed in %i{ms}ms{newLine}" Log.verbose(lazy $"""F# PROJECT: %s{cliArgs.ProjectFileAsRelativePath} %s{result.ProjectOptions.OtherOptions |> String.concat $"{newLine} "} %s{result.ProjectOptions.SourceFiles |> String.concat $"{newLine} "}""") @@ -337,10 +337,10 @@ type ProjectCracked(cliArgs: CliArgs, crackerResponse: CrackerResponse, sourceFi type ProjectChecked(checker: InteractiveChecker, errors: FSharpDiagnostic array, project: Project) = - static let checkProject (config: ProjectCracked) (checker: InteractiveChecker) lastFile = - Log.always $"Compiling {config.CliArgs.ProjectFileAsRelativePath}..." + static let checkProject (config: ProjectCracked) (checker: InteractiveChecker) lastFile = async { + Log.always "Started F# compilation..." - let checkResults, ms = measureTime <| fun () -> + let! checkResults, ms = measureTimeAsync <| fun () -> let fileDic = config.SourceFiles |> Seq.map (fun f -> f.NormalizedFullPath, f) |> dict @@ -354,31 +354,34 @@ type ProjectChecked(checker: InteractiveChecker, errors: FSharpDiagnostic array, if config.FableOptions.OptimizeFSharpAst then checkResults.GetOptimizedAssemblyContents().ImplementationFiles else checkResults.AssemblyContents.ImplementationFiles - implFiles, checkResults.Diagnostics, lazy checkResults.ProjectContext.GetReferencedAssemblies() + return implFiles, checkResults.Diagnostics, lazy checkResults.ProjectContext.GetReferencedAssemblies() + } member _.Project = project member _.Checker = checker member _.Errors = errors - static member Init(config: ProjectCracked) = + static member Init(config: ProjectCracked) = async { let checker = InteractiveChecker.Create(config.ProjectOptions) - let implFiles, errors, assemblies = checkProject config checker None - - ProjectChecked(checker, errors, Project.From( - config.ProjectFile, - implFiles, - assemblies.Value, - getPlugin = loadType config.CliArgs, - trimRootModule = config.FableOptions.RootModule)) + let! implFiles, errors, assemblies = checkProject config checker None + + return ProjectChecked(checker, errors, Project.From( + config.ProjectFile, + implFiles, + assemblies.Value, + getPlugin = loadType config.CliArgs, + trimRootModule = config.FableOptions.RootModule)) + } - member this.Update(config: ProjectCracked, filesToCompile) = - let implFiles, errors, _ = + member this.Update(config: ProjectCracked, filesToCompile) = async { + let! implFiles, errors, _ = Some(Array.last filesToCompile) |> checkProject config this.Checker let filesToCompile = set filesToCompile let implFiles = implFiles |> List.filter (fun f -> filesToCompile.Contains(f.FileName)) - ProjectChecked(checker, errors, this.Project.Update(implFiles)) + return ProjectChecked(checker, errors, this.Project.Update(implFiles)) + } type Watcher = { Watcher: FsWatcher @@ -488,10 +491,10 @@ let private compilationCycle (state: State) (changes: ISet) = async { let state = { state with Watcher = watcher } // TODO: Use Result here to fail more gracefully if FCS crashes - let projChecked = + let! projChecked = match projChecked with | None -> ProjectChecked.Init(projCracked) - | Some projChecked when Array.isEmpty filesToCompile -> projChecked + | Some projChecked when Array.isEmpty filesToCompile -> async.Return projChecked | Some projChecked -> projChecked.Update(projCracked, filesToCompile) let logs = getFSharpErrorLogs projChecked.Errors @@ -502,6 +505,8 @@ let private compilationCycle (state: State) (changes: ISet) = async { if hasFSharpError && state.HasCompiledOnce then return logs, { state with PendingFiles = filesToCompile } else + Log.always "Started Fable compilation..." + let! results, ms = measureTimeAsync <| fun () -> filesToCompile |> Array.filter (fun file -> file.EndsWith(".fs") || file.EndsWith(".fsx")) diff --git a/src/Fable.Transforms/FSharp2Fable.Util.fs b/src/Fable.Transforms/FSharp2Fable.Util.fs index 8d15a53e50..383605d4c3 100644 --- a/src/Fable.Transforms/FSharp2Fable.Util.fs +++ b/src/Fable.Transforms/FSharp2Fable.Util.fs @@ -86,11 +86,11 @@ type FsMemberFunctionOrValue(m: FSharpMemberOrFunctionOrValue) = static member DisplayName(m: FSharpMemberOrFunctionOrValue) = // TODO: Change needed when updating to FCS 41 -// #if FABLE_COMPILER +#if FABLE_COMPILER Naming.removeGetSetPrefix m.DisplayName -// #else -// Naming.removeGetSetPrefix m.DisplayNameCore -// #endif +#else + Naming.removeGetSetPrefix m.DisplayNameCore +#endif interface Fable.MemberFunctionOrValue with member _.Attributes = @@ -453,9 +453,9 @@ module Helpers = | FSharpInlineAnnotation.NeverInline | FSharpInlineAnnotation.OptionalInline -> false // TODO: Change needed when updating to FCS 41 -// #if FABLE_COMPILER +#if FABLE_COMPILER | FSharpInlineAnnotation.PseudoValue -// #endif +#endif | FSharpInlineAnnotation.AlwaysInline | FSharpInlineAnnotation.AggressiveInline -> true diff --git a/src/Fable.Transforms/FSharp2Fable.fs b/src/Fable.Transforms/FSharp2Fable.fs index c7e550f458..fdef30a217 100644 --- a/src/Fable.Transforms/FSharp2Fable.fs +++ b/src/Fable.Transforms/FSharp2Fable.fs @@ -677,11 +677,11 @@ let private transformExpr (com: IFableCompiler) (ctx: Context) fsExpr = // Note F# compiler wraps the value in a closure if it detects it's a lambda | FSharpExprPatterns.Let((_, FSharpExprPatterns.Call(None,m,_,_,[e1; e2])),_), args // TODO: Change needed when updating to FCS 41 -// #if FABLE_COMPILER +#if FABLE_COMPILER when m.FullName = "Fable.Core.JsInterop.( ? )" -> -// #else -// when m.FullName = "Fable.Core.JsInterop.(?)" -> -// #endif +#else + when m.FullName = "Fable.Core.JsInterop.(?)" -> +#endif let! e1 = transformExpr com ctx e1 let! e2 = transformExpr com ctx e2 let e = Fable.Get(e1, Fable.ByKey(Fable.ExprKey e2), Fable.Any, e1.Range) diff --git a/src/fable-library/Map.fs b/src/fable-library/Map.fs index 948460f782..4dd92e31d6 100644 --- a/src/fable-library/Map.fs +++ b/src/fable-library/Map.fs @@ -653,6 +653,12 @@ type Map<[]'Key, [ value <- v; true | None -> false + member __.Keys: ICollection<'Key> = + MapTree.toSeq tree |> Seq.map (fun kvp -> kvp.Key) |> ResizeArray :> _ + + member __.Values: ICollection<'Value> = + MapTree.toSeq tree |> Seq.map (fun kvp -> kvp.Value) |> ResizeArray :> _ + member m.TryFind key = // #if TRACE_SETS_AND_MAPS // MapTree.report() diff --git a/src/fcs-fable/src/fsharp/CompilerImports.fs b/src/fcs-fable/src/fsharp/CompilerImports.fs index 1054acaeba..382b3bea13 100644 --- a/src/fcs-fable/src/fsharp/CompilerImports.fs +++ b/src/fcs-fable/src/fsharp/CompilerImports.fs @@ -821,7 +821,7 @@ type TcImports() = member x.SetCcuMap m = ccuMap <- m member x.GetImportedAssemblies() = - ccuMap.Values + ccuMap.Values |> Seq.toList member x.GetImportMap() = let loaderInterface = @@ -835,7 +835,7 @@ type TcImports() = member tcImports.GetCcusExcludingBase() = //TODO: excludes any framework imports (which may be shared between multiple builds) - ccuMap.Values |> List.map (fun x -> x.FSharpViewOfMetadata) + ccuMap.Values |> Seq.toList |> List.map (fun x -> x.FSharpViewOfMetadata) #else //!FABLE_COMPILER diff --git a/src/fcs-fable/src/fsharp/NameResolution.fs b/src/fcs-fable/src/fsharp/NameResolution.fs index ed9e6a7cd5..d3062e8bf8 100644 --- a/src/fcs-fable/src/fsharp/NameResolution.fs +++ b/src/fcs-fable/src/fsharp/NameResolution.fs @@ -4313,6 +4313,7 @@ let rec ResolvePartialLongIdentPrim (ncenv: NameResolver) (nenv: NameResolutionE | FullyQualified -> [] | OpenQualified -> nenv.eUnqualifiedItems.Values + |> Seq.toList |> List.filter (function | Item.UnqualifiedType _ -> false | Item.Value v -> not v.IsMember @@ -4345,6 +4346,7 @@ let rec ResolvePartialLongIdentPrim (ncenv: NameResolver) (nenv: NameResolutionE let tycons = nenv.TyconsByDemangledNameAndArity(fullyQualified).Values + |> Seq.toList |> List.filter (fun tcref -> not (tcref.LogicalName.Contains ",") && not tcref.IsExceptionDecl && @@ -4354,6 +4356,7 @@ let rec ResolvePartialLongIdentPrim (ncenv: NameResolver) (nenv: NameResolutionE // Get all the constructors accessible from here let constructors = nenv.TyconsByDemangledNameAndArity(fullyQualified).Values + |> Seq.toList |> List.filter (IsTyconUnseen ad g ncenv.amap m >> not) |> List.collect (InfosForTyconConstructors ncenv m ad) @@ -4505,6 +4508,7 @@ and ResolvePartialLongIdentToClassOrRecdFieldsImpl (ncenv: NameResolver) (nenv: let recdTyCons = nenv.TyconsByDemangledNameAndArity(fullyQualified).Values + |> Seq.toList |> List.filter (fun tcref -> not (tcref.LogicalName.Contains ",") && tcref.IsRecordTycon && diff --git a/tests/Integration/Fable.Tests.Integration.fsproj b/tests/Integration/Fable.Tests.Integration.fsproj index 89ef03232e..e940f1b3e2 100644 --- a/tests/Integration/Fable.Tests.Integration.fsproj +++ b/tests/Integration/Fable.Tests.Integration.fsproj @@ -10,6 +10,8 @@ + +