diff --git a/src/Compiler/Service/IncrementalBuild.fs b/src/Compiler/Service/IncrementalBuild.fs index 43a7a9cde96..4e74ab4f590 100644 --- a/src/Compiler/Service/IncrementalBuild.fs +++ b/src/Compiler/Service/IncrementalBuild.fs @@ -229,11 +229,6 @@ type TcInfoExtras = member x.TcSymbolUses = x.tcSymbolUses -module ValueOption = - let toOption = function - | ValueSome x -> Some x - | _ -> None - type private SingleFileDiagnostics = (PhasedDiagnostic * FSharpDiagnosticSeverity) array type private TypeCheck = TcInfo * TcResultsSinkImpl * CheckedImplFile option * string * SingleFileDiagnostics diff --git a/src/Compiler/TypedTree/TypedTree.fs b/src/Compiler/TypedTree/TypedTree.fs index 6f897c7889a..0cd8cdfa6f6 100644 --- a/src/Compiler/TypedTree/TypedTree.fs +++ b/src/Compiler/TypedTree/TypedTree.fs @@ -2117,7 +2117,7 @@ type ModuleOrNamespaceType(kind: ModuleOrNamespaceKind, vals: QueueList, en |> List.tryFind (fun v -> match key.TypeForLinkage with | None -> true | Some keyTy -> ccu.MemberSignatureEquality(keyTy, v.Type)) - |> ValueOptionInternal.ofOption + |> ValueOption.ofOption /// Get a table of values indexed by logical name member _.AllValsByLogicalName = @@ -4229,7 +4229,7 @@ type UnionCaseRef = /// Try to dereference the reference member x.TryUnionCase = x.TyconRef.TryDeref - |> ValueOptionInternal.bind (fun tcref -> tcref.GetUnionCaseByName x.CaseName |> ValueOptionInternal.ofOption) + |> ValueOption.bind (fun tcref -> tcref.GetUnionCaseByName x.CaseName |> ValueOption.ofOption) /// Get the attributes associated with the union case member x.Attribs = x.UnionCase.Attribs @@ -4292,7 +4292,7 @@ type RecdFieldRef = /// Try to dereference the reference member x.TryRecdField = x.TyconRef.TryDeref - |> ValueOptionInternal.bind (fun tcref -> tcref.GetFieldByName x.FieldName |> ValueOptionInternal.ofOption) + |> ValueOption.bind (fun tcref -> tcref.GetFieldByName x.FieldName |> ValueOption.ofOption) /// Get the attributes associated with the compiled property of the record field member x.PropertyAttribs = x.RecdField.PropertyAttribs diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 685f9a7377c..d8c03ce23ba 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -3477,7 +3477,7 @@ let IsMatchingFSharpAttributeOpt g attrOpt (Attrib(tcref2, _, _, _, _, _, _)) = [] let (|ExtractAttribNamedArg|_|) nm args = - args |> List.tryPick (function AttribNamedArg(nm2, _, _, v) when nm = nm2 -> Some v | _ -> None) |> ValueOptionInternal.ofOption + args |> List.tryPick (function AttribNamedArg(nm2, _, _, v) when nm = nm2 -> Some v | _ -> None) |> ValueOption.ofOption [] let (|StringExpr|_|) = function Expr.Const (Const.String n, _, _) -> ValueSome n | _ -> ValueNone diff --git a/src/Compiler/Utilities/illib.fs b/src/Compiler/Utilities/illib.fs index aa1fffaf826..d36f5a1c71f 100644 --- a/src/Compiler/Utilities/illib.fs +++ b/src/Compiler/Utilities/illib.fs @@ -741,18 +741,6 @@ module Span = state -module ValueOptionInternal = - - let inline ofOption x = - match x with - | Some x -> ValueSome x - | None -> ValueNone - - let inline bind ([] f) x = - match x with - | ValueSome x -> f x - | ValueNone -> ValueNone - module String = let make (n: int) (c: char) : string = String(c, n) diff --git a/src/Compiler/Utilities/illib.fsi b/src/Compiler/Utilities/illib.fsi index 2df0d9c0959..c1d82185a71 100644 --- a/src/Compiler/Utilities/illib.fsi +++ b/src/Compiler/Utilities/illib.fsi @@ -263,12 +263,6 @@ module internal ResizeArray = module internal Span = val inline exists: predicate: ('T -> bool) -> span: Span<'T> -> bool -module internal ValueOptionInternal = - - val inline ofOption: x: 'a option -> 'a voption - - val inline bind: f: ('a -> 'b voption) -> x: 'a voption -> 'b voption - module internal String = val make: n: int -> c: char -> string diff --git a/vsintegration/src/FSharp.Editor/Common/Extensions.fs b/vsintegration/src/FSharp.Editor/Common/Extensions.fs index b0eb7305713..5b154deab73 100644 --- a/vsintegration/src/FSharp.Editor/Common/Extensions.fs +++ b/vsintegration/src/FSharp.Editor/Common/Extensions.fs @@ -327,19 +327,6 @@ module Option = else None -[] -module ValueOption = - - let inline ofOption o = - match o with - | Some v -> ValueSome v - | _ -> ValueNone - - let inline toOption o = - match o with - | ValueSome v -> Some v - | _ -> None - [] module IEnumerator = let chooseV f (e: IEnumerator<'T>) = diff --git a/vsintegration/tests/FSharp.Editor.Tests/CodeFixes/CodeFixTestFramework.fs b/vsintegration/tests/FSharp.Editor.Tests/CodeFixes/CodeFixTestFramework.fs index 1fb8d27c3a8..90dda7a213b 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/CodeFixes/CodeFixTestFramework.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/CodeFixes/CodeFixTestFramework.fs @@ -33,16 +33,6 @@ type Mode = | WithSettings of CodeFixesOptions module ValueOption = - let inline toOption o = - match o with - | ValueSome v -> Some v - | _ -> None - - let inline ofOption o = - match o with - | Some v -> ValueSome v - | _ -> ValueNone - let inline either f y o = match o with | ValueSome v -> f v