"Fossies" - the Fresh Open Source Software Archive

Member "fsharp-4.5/src/fsharp/FSharp.Core/fslib-extra-pervasives.fsi" (5 Sep 2018, 18532 Bytes) of package /linux/misc/mono-sources/fsharp/fsharp-4.5.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "fslib-extra-pervasives.fsi": 4.1.33_vs_4.5.

    1 // Copyright (c) Microsoft Corporation.  All Rights Reserved.  See License.txt in the project root for license information.
    2 
    3 /// <summary>Pervasives: Additional bindings available at the top level</summary>
    4 namespace Microsoft.FSharp.Core
    5 
    6 [<AutoOpen>]
    7 module ExtraTopLevelOperators = 
    8 
    9     open System
   10     open Microsoft.FSharp.Core
   11     open Microsoft.FSharp.Control
   12     open Microsoft.FSharp.Collections
   13     open Microsoft.FSharp.Text
   14     open Microsoft.FSharp.Math
   15 
   16 #if !FX_NO_SYSTEM_CONSOLE
   17     /// <summary>Print to <c>stdout</c> using the given format.</summary>
   18     /// <param name="format">The formatter.</param>
   19     /// <returns>The formatted result.</returns>
   20     [<CompiledName("PrintFormat")>]
   21     val printf  :                format:Printf.TextWriterFormat<'T> -> 'T
   22 
   23     /// <summary>Print to <c>stdout</c> using the given format, and add a newline.</summary>
   24     /// <param name="format">The formatter.</param>
   25     /// <returns>The formatted result.</returns>
   26     [<CompiledName("PrintFormatLine")>]
   27     val printfn  :                format:Printf.TextWriterFormat<'T> -> 'T
   28 
   29     /// <summary>Print to <c>stderr</c> using the given format.</summary>
   30     /// <param name="format">The formatter.</param>
   31     /// <returns>The formatted result.</returns>
   32     [<CompiledName("PrintFormatToError")>]
   33     val eprintf  :               format:Printf.TextWriterFormat<'T> -> 'T
   34 
   35     /// <summary>Print to <c>stderr</c> using the given format, and add a newline.</summary>
   36     /// <param name="format">The formatter.</param>
   37     /// <returns>The formatted result.</returns>
   38     [<CompiledName("PrintFormatLineToError")>]
   39     val eprintfn  :               format:Printf.TextWriterFormat<'T> -> 'T
   40 #endif
   41 
   42     /// <summary>Print to a string using the given format.</summary>
   43     /// <param name="format">The formatter.</param>
   44     /// <returns>The formatted result.</returns>
   45     [<CompiledName("PrintFormatToString")>]
   46     val sprintf :                format:Printf.StringFormat<'T> -> 'T
   47 
   48     /// <summary>Print to a string buffer and raise an exception with the given
   49     /// result.   Helper printers must return strings.</summary>
   50     /// <param name="format">The formatter.</param>
   51     /// <returns>The formatted result.</returns>
   52     [<CompiledName("PrintFormatToStringThenFail")>]
   53     val failwithf: format:Printf.StringFormat<'T,'Result> -> 'T
   54 
   55     /// <summary>Print to a file using the given format.</summary>
   56     /// <param name="textWriter">The file TextWriter.</param>
   57     /// <param name="format">The formatter.</param>
   58     /// <returns>The formatted result.</returns>
   59     [<CompiledName("PrintFormatToTextWriter")>]
   60     val fprintf : textWriter:System.IO.TextWriter -> format:Printf.TextWriterFormat<'T> -> 'T
   61 
   62     /// <summary>Print to a file using the given format, and add a newline.</summary>
   63     /// <param name="textWriter">The file TextWriter.</param>
   64     /// <param name="format">The formatter.</param>
   65     /// <returns>The formatted result.</returns>
   66     [<CompiledName("PrintFormatLineToTextWriter")>]
   67     val fprintfn : textWriter:System.IO.TextWriter -> format:Printf.TextWriterFormat<'T> -> 'T
   68 
   69     /// <summary>Builds a set from a sequence of objects. The objects are indexed using generic comparison.</summary>
   70     /// <param name="elements">The input sequence of elements.</param>
   71     /// <returns>The created set.</returns>
   72     [<CompiledName("CreateSet")>]
   73     val set : elements:seq<'T> -> Set<'T>
   74 
   75     /// <summary>Builds an asynchronous workflow using computation expression syntax.</summary>
   76     [<CompiledName("DefaultAsyncBuilder")>]
   77     val async : Microsoft.FSharp.Control.AsyncBuilder  
   78 
   79     /// <summary>Converts the argument to 32-bit float.</summary>
   80     /// <remarks>This is a direct conversion for all 
   81     /// primitive numeric types. For strings, the input is converted using <c>Single.Parse()</c>  with InvariantCulture settings. Otherwise the operation requires and invokes a <c>ToSingle</c> method on the input type.</remarks>
   82     [<CompiledName("ToSingle")>]
   83     val inline single     : value:^T -> single     when ^T : (static member op_Explicit : ^T -> single)     and default ^T : int
   84 
   85     /// <summary>Converts the argument to 64-bit float.</summary>
   86     /// <remarks>This is a direct conversion for all 
   87     /// primitive numeric types. For strings, the input is converted using <c>Double.Parse()</c>  with InvariantCulture settings. Otherwise the operation requires and invokes a <c>ToDouble</c> method on the input type.</remarks>
   88     [<CompiledName("ToDouble")>]
   89     val inline double     : value:^T -> double      when ^T : (static member op_Explicit : ^T -> double)     and default ^T : int
   90 
   91     /// <summary>Converts the argument to byte.</summary>
   92     /// <remarks>This is a direct conversion for all 
   93     /// primitive numeric types. For strings, the input is converted using <c>Byte.Parse()</c> on strings and otherwise requires a <c>ToByte</c> method on the input type.</remarks>
   94     [<CompiledName("ToByte")>]
   95     val inline uint8       : value:^T -> uint8       when ^T : (static member op_Explicit : ^T -> uint8)       and default ^T : int        
   96     
   97     /// <summary>Converts the argument to signed byte.</summary>
   98     /// <remarks>This is a direct conversion for all 
   99     /// primitive numeric types. For strings, the input is converted using <c>SByte.Parse()</c>  with InvariantCulture settings.
  100     /// Otherwise the operation requires and invokes a <c>ToSByte</c> method on the input type.</remarks>
  101     [<CompiledName("ToSByte")>]
  102     val inline int8      : value:^T -> int8      when ^T : (static member op_Explicit : ^T -> int8)      and default ^T : int
  103     
  104 
  105     module Checked = 
  106 
  107         /// <summary>Converts the argument to byte.</summary>
  108         /// <remarks>This is a direct, checked conversion for all 
  109         /// primitive numeric types. For strings, the input is converted using <c>Byte.Parse()</c> on strings and otherwise requires a <c>ToByte</c> method on the input type.</remarks>
  110         [<CompiledName("ToByte")>]
  111         val inline uint8       : value:^T -> byte       when ^T : (static member op_Explicit : ^T -> uint8)       and default ^T : int        
  112     
  113         /// <summary>Converts the argument to signed byte.</summary>
  114         /// <remarks>This is a direct, checked conversion for all 
  115         /// primitive numeric types. For strings, the input is converted using <c>SByte.Parse()</c>  with InvariantCulture settings.
  116         /// Otherwise the operation requires and invokes a <c>ToSByte</c> method on the input type.</remarks>
  117         [<CompiledName("ToSByte")>]
  118         val inline int8      : value:^T -> sbyte      when ^T : (static member op_Explicit : ^T -> int8)      and default ^T : int
  119     
  120 
  121     /// <summary>Builds a read-only lookup table from a sequence of key/value pairs. The key objects are indexed using generic hashing and equality.</summary>
  122     [<CompiledName("CreateDictionary")>]
  123     val dict : keyValuePairs:seq<'Key * 'Value> -> System.Collections.Generic.IDictionary<'Key,'Value> when 'Key : equality
  124 
  125     /// <summary>Builds a read-only lookup table from a sequence of key/value pairs. The key objects are indexed using generic hashing and equality.</summary>
  126     [<CompiledName("CreateReadOnlyDictionary")>]
  127     val readOnlyDict : keyValuePairs:seq<'Key * 'Value> -> System.Collections.Generic.IReadOnlyDictionary<'Key,'Value> when 'Key : equality
  128 
  129     /// <summary>Builds a 2D array from a sequence of sequences of elements.</summary>
  130     [<CompiledName("CreateArray2D")>]
  131     val array2D : rows:seq<#seq<'T>> -> 'T[,]
  132 
  133     /// <summary>Special prefix operator for splicing typed expressions into quotation holes.</summary>
  134     [<CompiledName("SpliceExpression")>]
  135     val (~%) : expression:Microsoft.FSharp.Quotations.Expr<'T> -> 'T
  136 
  137     /// <summary>Special prefix operator for splicing untyped expressions into quotation holes.</summary>
  138     [<CompiledName("SpliceUntypedExpression")>]
  139     val (~%%) : expression:Microsoft.FSharp.Quotations.Expr -> 'T
  140 
  141     /// <summary>An active pattern to force the execution of values of type <c>Lazy&lt;_&gt;</c>.</summary>
  142     [<CompiledName("LazyPattern")>]
  143     val (|Lazy|) : input:Lazy<'T> -> 'T
  144 
  145     /// <summary>Builds a query using query syntax and operators.</summary>
  146     val query : Microsoft.FSharp.Linq.QueryBuilder
  147 
  148 
  149 namespace Microsoft.FSharp.Core.CompilerServices
  150 
  151     open System
  152     open System.Reflection
  153     open System.Linq.Expressions
  154     open System.Collections.Generic
  155     open Microsoft.FSharp.Core
  156     open Microsoft.FSharp.Control
  157     open Microsoft.FSharp.Quotations
  158 
  159 
  160     /// <summary>Represents the product of two measure expressions when returned as a generic argument of a provided type.</summary>
  161     type MeasureProduct<'Measure1, 'Measure2> 
  162 
  163     /// <summary>Represents the inverse of a measure expressions when returned as a generic argument of a provided type.</summary>
  164     type MeasureInverse<'Measure> 
  165 
  166     /// <summary>Represents the '1' measure expression when returned as a generic argument of a provided type.</summary>
  167     type MeasureOne
  168 
  169     /// <summary>Place on a class that implements ITypeProvider to extend the compiler</summary>
  170     [<AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple = false)>]
  171     type TypeProviderAttribute =
  172         inherit System.Attribute
  173         /// <summary>Creates an instance of the attribute</summary>
  174         /// <returns>TypeProviderAttribute</returns>
  175         new : unit -> TypeProviderAttribute
  176 
  177     /// <summary>Additional type attribute flags related to provided types</summary>
  178     type TypeProviderTypeAttributes =
  179         | SuppressRelocate = 0x80000000
  180         | IsErased = 0x40000000
  181 
  182     /// <summary>Place attribute on runtime assembly to indicate that there is a corresponding design-time 
  183     /// assembly that contains a type provider. Runtime and designer assembly may be the same. </summary>
  184     [<AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple = false)>]
  185     type TypeProviderAssemblyAttribute = 
  186         inherit System.Attribute
  187         /// <summary>Creates an instance of the attribute</summary>
  188         /// <returns>TypeProviderAssemblyAttribute</returns>
  189         new : unit -> TypeProviderAssemblyAttribute
  190         /// <summary>Creates an instance of the attribute</summary>
  191         /// <returns>TypeProviderAssemblyAttribute</returns>
  192         /// <param name="assemblyName">The name of the design-time assembly for this type provider.</param>
  193         new : assemblyName : string -> TypeProviderAssemblyAttribute
  194         member AssemblyName : string
  195 
  196     /// The TypeProviderXmlDocAttribute attribute can be added to types and members. 
  197     /// The language service will display the CommentText property from the attribute 
  198     /// in the appropriate place when the user hovers over a type or member.
  199     [<AttributeUsageAttribute(AttributeTargets.All, AllowMultiple = false)>]
  200     type TypeProviderXmlDocAttribute = 
  201         inherit System.Attribute
  202         /// <summary>Creates an instance of the attribute</summary>
  203         /// <returns>TypeProviderXmlDocAttribute</returns>
  204         new : commentText : string -> TypeProviderXmlDocAttribute
  205         member CommentText : string
  206 
  207     [<AttributeUsageAttribute(AttributeTargets.All, AllowMultiple = false)>]
  208     type TypeProviderDefinitionLocationAttribute = 
  209         inherit System.Attribute
  210         new : unit -> TypeProviderDefinitionLocationAttribute
  211         member FilePath : string with get, set
  212         member Line : int with get, set
  213         member Column : int with get, set
  214 
  215     [<AttributeUsageAttribute(AttributeTargets.Class ||| AttributeTargets.Interface ||| AttributeTargets.Struct ||| AttributeTargets.Delegate, AllowMultiple = false)>]
  216     /// <summary>Indicates that a code editor should hide all System.Object methods from the intellisense menus for instances of a provided type</summary>
  217     type TypeProviderEditorHideMethodsAttribute = 
  218         inherit System.Attribute
  219         /// <summary>Creates an instance of the attribute</summary>
  220         /// <returns>TypeProviderEditorHideMethodsAttribute</returns>
  221         new : unit -> TypeProviderEditorHideMethodsAttribute
  222 
  223     /// If the class that implements ITypeProvider has a constructor that accepts TypeProviderConfig
  224     /// then it will be constructed with an instance of TypeProviderConfig.
  225     type TypeProviderConfig =
  226         new :  systemRuntimeContainsType : (string -> bool) -> TypeProviderConfig
  227 
  228         /// Get the full path to use to resolve relative paths in any file name arguments given to the type provider instance.
  229         member ResolutionFolder : string with get,set
  230 
  231         /// Get the full path to referenced assembly that caused this type provider instance to be created.
  232         member RuntimeAssembly : string with get,set
  233 
  234         /// Get the referenced assemblies for the type provider instance.
  235         member ReferencedAssemblies : string[] with get,set
  236 
  237         /// Get the full path to use for temporary files for the type provider instance.
  238         member TemporaryFolder : string with get,set
  239 
  240         /// Indicates if the type provider host responds to invalidation events for type provider instances. 
  241         member IsInvalidationSupported : bool with get,set
  242 
  243         /// Indicates if the type provider instance is used in an environment which executes provided code such as F# Interactive.
  244         member IsHostedExecution : bool with get,set
  245 
  246         /// version of referenced system runtime assembly
  247         member SystemRuntimeAssemblyVersion : System.Version with get,set
  248 
  249         /// Checks if given type exists in target system runtime library
  250         member SystemRuntimeContainsType : string -> bool
  251 
  252 
  253     /// <summary>
  254     /// Represents a namespace provided by a type provider component.
  255     /// </summary>
  256     type IProvidedNamespace =
  257         /// Namespace name the provider injects types into.
  258         abstract NamespaceName : string
  259 
  260         /// The sub-namespaces in this namespace. An optional member to prevent generation of namespaces until an outer namespace is explored.
  261         abstract GetNestedNamespaces : unit -> IProvidedNamespace[] 
  262 
  263         /// <summary>
  264         /// The top-level types
  265         /// </summary>
  266         /// <returns></returns>
  267         abstract GetTypes : unit -> Type[] 
  268 
  269         /// <summary>
  270         /// Compilers call this method to query a type provider for a type <c>name</c>.
  271         /// </summary>
  272         /// <remarks>Resolver should return a type called <c>name</c> in namespace <c>NamespaceName</c> or <c>null</c> if the type is unknown.
  273         /// </remarks>
  274         /// <returns></returns>
  275         abstract ResolveTypeName : typeName: string -> Type
  276 
  277     /// <summary>
  278     /// Represents an instantiation of a type provider component.
  279     /// </summary>
  280     type ITypeProvider =
  281         inherit System.IDisposable
  282 
  283         /// <summary>
  284         /// Namespace name the this TypeProvider injects types into.
  285         /// </summary>
  286         abstract GetNamespaces : unit -> IProvidedNamespace[] 
  287 
  288         /// <summary>
  289         /// Get the static parameters for a provided type. 
  290         /// </summary>
  291         /// <param name="typeWithoutArguments">A type returned by GetTypes or ResolveTypeName</param>
  292         /// <returns></returns>
  293         abstract GetStaticParameters : typeWithoutArguments:Type -> ParameterInfo[] 
  294 
  295         /// <summary>
  296         /// Apply static arguments to a provided type that accepts static arguments. 
  297         /// </summary>
  298         /// <remarks>The provider must return a type with the given mangled name.</remarks>
  299         /// <param name="typeWithoutArguments">the provided type definition which has static parameters</param>
  300         /// <param name="typePathWithArguments">the full path of the type, including encoded representations of static parameters</param>
  301         /// <param name="staticArguments">the static parameters, indexed by name</param>
  302         /// <returns></returns>
  303         abstract ApplyStaticArguments : typeWithoutArguments:Type * typePathWithArguments:string[] * staticArguments:obj[] -> Type 
  304 
  305         /// <summary>
  306         /// Called by the compiler to ask for an Expression tree to replace the given MethodBase with.
  307         /// </summary>
  308         /// <param name="syntheticMethodBase">MethodBase that was given to the compiler by a type returned by a GetType(s) call.</param>
  309         /// <param name="parameters">Expressions that represent the parameters to this call.</param>
  310         /// <returns>An expression that the compiler will use in place of the given method base.</returns>
  311         abstract GetInvokerExpression : syntheticMethodBase:MethodBase * parameters:Expr[] -> Expr
  312 
  313         /// <summary>
  314         /// Triggered when an assumption changes that invalidates the resolutions so far reported by the provider
  315         /// </summary>
  316         [<CLIEvent>]
  317         abstract Invalidate : IEvent<System.EventHandler, System.EventArgs>
  318 
  319         /// <summary>
  320         /// Get the physical contents of the given logical provided assembly.
  321         /// </summary>
  322         abstract GetGeneratedAssemblyContents : assembly:Assembly -> byte[]
  323 
  324     /// Represents additional, optional information for a type provider component
  325     type ITypeProvider2 =
  326 
  327         /// <summary>
  328         /// Get the static parameters for a provided method. 
  329         /// </summary>
  330         /// <param name="methodWithoutArguments">A method returned by GetMethod on a provided type</param>
  331         /// <returns>The static parameters of the provided method, if any</returns>
  332 
  333         abstract GetStaticParametersForMethod : methodWithoutArguments:MethodBase -> ParameterInfo[] 
  334 
  335         /// <summary>
  336         /// Apply static arguments to a provided method that accepts static arguments. 
  337         /// </summary>
  338         /// <remarks>The provider must return a provided method with the given mangled name.</remarks>
  339         /// <param name="methodWithoutArguments">the provided method definition which has static parameters</param>
  340         /// <param name="methodNameWithArguments">the full name of the method that must be returned, including encoded representations of static parameters</param>
  341         /// <param name="staticArguments">the values of the static parameters, indexed by name</param>
  342         /// <returns>The provided method definition corresponding to the given static parameter values</returns>
  343         abstract ApplyStaticArgumentsForMethod : methodWithoutArguments:MethodBase * methodNameWithArguments:string * staticArguments:obj[] -> MethodBase
  344