PageRenderTime 54ms CodeModel.GetById 28ms RepoModel.GetById 0ms app.codeStats 0ms

/compiler/3.0/Sep2012/src/fsharp/tainted.fsi

#
F# | 93 lines | 40 code | 22 blank | 31 comment | 0 complexity | 6c99fd0a838e58c47536d4aa9d880c34 MD5 | raw file
Possible License(s): CC-BY-SA-3.0, Apache-2.0
  1. namespace Microsoft.FSharp.Compiler
  2. open System
  3. open System.Reflection
  4. open Microsoft.FSharp.Core.CompilerServices
  5. open Microsoft.FSharp.Compiler.Range
  6. open Microsoft.FSharp.Compiler.AbstractIL.IL
  7. /// Stores and transports aggregated list of errors reported by the type provider
  8. type internal TypeProviderError =
  9. inherit System.Exception
  10. /// creates new instance of TypeProviderError that represents one error
  11. new : (int * string) * string * range -> TypeProviderError
  12. /// creates new instance of TypeProviderError that represents collection of errors
  13. new : int * string * range * seq<string> -> TypeProviderError
  14. member Number : int
  15. member Range : range
  16. member ContextualErrorMessage : string
  17. /// creates new instance of TypeProviderError with specified type\method names
  18. member WithContext : string * string -> TypeProviderError
  19. /// creates new instance of TypeProviderError based on current instance information(message)
  20. member MapText : (string -> int * string) * string * range -> TypeProviderError
  21. /// provides uniform way to process aggregated errors
  22. member Iter : (TypeProviderError -> unit) -> unit
  23. /// This struct wraps a value produced by a type provider to properly attribute any failures.
  24. [<NoEquality; NoComparison; Class>]
  25. type internal Tainted<'T> =
  26. /// Create an initial tainted value
  27. static member CreateAll : (ITypeProvider * ILScopeRef) list -> Tainted<ITypeProvider> list
  28. /// A type provider that produced the value
  29. member TypeProvider : Tainted<ITypeProvider>
  30. /// Test to report for the name of the type provider that produced the value
  31. member TypeProviderDesignation : string
  32. /// The ILScopeRef of the runtime assembly reference for type provider that produced the value
  33. member TypeProviderAssemblyRef : ILScopeRef
  34. /// Apply an operation. Any exception will be attributed to the type provider with an error located at the given range
  35. member PApply : ('T -> 'U) * range:range -> Tainted<'U>
  36. /// Apply an operation. Any exception will be attributed to the type provider with an error located at the given range
  37. member PApply2 : ('T -> 'U1 * 'U2) * range:range -> Tainted<'U1> * Tainted<'U2>
  38. /// Apply an operation. Any exception will be attributed to the type provider with an error located at the given range
  39. member PApply3 : ('T -> 'U1 * 'U2 * 'U3) * range:range -> Tainted<'U1> * Tainted<'U2> * Tainted<'U3>
  40. /// Apply an operation. Any exception will be attributed to the type provider with an error located at the given range
  41. member PApply4 : ('T -> 'U1 * 'U2 * 'U3 * 'U4) * range:range -> Tainted<'U1> * Tainted<'U2> * Tainted<'U3> * Tainted<'U4>
  42. /// Apply an operation. No exception may be raised by 'f'
  43. member PApplyNoFailure : f: ('T -> 'U) -> Tainted<'U>
  44. /// Apply an operation. Any exception will be attributed to the type provider with an error located at the given range
  45. member PApplyWithProvider : ('T * ITypeProvider -> 'U) * range:range -> Tainted<'U>
  46. /// Apply an operation that returns an array. Unwrap array. Any exception will be attributed to the type provider with an error located at the given range. String is method name of thing-returning-array, to diagnostically attribute if it is null
  47. member PApplyArray : ('T -> 'U[]) * string * range:range -> Tainted<'U>[]
  48. /// Apply an operation that returns an option. Unwrap option. Any exception will be attributed to the type provider with an error located at the given range
  49. member PApplyOption : ('T -> 'U option) * range:range -> Tainted<'U> option
  50. /// Apply an operation and 'untaint' the result. The result must be marshalable. Any exception will be attributed to the type provider with an error located at the given range
  51. member PUntaint : ('T -> 'U) * range:range -> 'U
  52. /// Apply an operation and 'untaint' the result. This can be used if the return type
  53. /// is guaranteed not to be implemented by a type provider
  54. member PUntaintNoFailure : ('T -> 'U) -> 'U
  55. /// Conditionally coerce the value
  56. member OfType<'U> : unit -> Tainted<'U> option
  57. /// Assert that the value is of 'U and coerce the value.
  58. /// If corecion fails, the failuer will be blamed on a type provider
  59. member Coerce<'U> : range:range -> Tainted<'U>
  60. [<RequireQualifiedAccess>]
  61. module internal Tainted =
  62. /// Test whether the tainted value is null
  63. val (|Null|_|) : Tainted<'T> -> unit option when 'T : null
  64. /// Test whether the tainted value equals given value.
  65. /// Failure in call to equality operation will be blamed on type provider of first operand
  66. val Eq : Tainted<'T> -> 'T -> bool when 'T : equality
  67. /// Test whether the tainted value equals given value. Type providers are ignored (equal tainted values produced by different type providers are equal)
  68. /// Failure in call to equality operation will be blamed on type provider of first operand
  69. val EqTainted : Tainted<'T> -> Tainted<'T> -> bool when 'T : equality and 'T : not struct
  70. /// Compute the hash value for the tainted value
  71. val GetHashCodeTainted : Tainted<'T> -> int when 'T : equality