From 04c5e593b27befdee11291cc144504e97482567a Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 22 Dec 2016 10:39:49 -0800 Subject: [PATCH] Use standard options (#2075) --- Common/CommonHelpers.fs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/Common/CommonHelpers.fs b/Common/CommonHelpers.fs index b734241285e..4ee9660ffe0 100644 --- a/Common/CommonHelpers.fs +++ b/Common/CommonHelpers.fs @@ -41,18 +41,6 @@ type internal SymbolLookupKind = | ByRightColumn | ByLongIdent -[] -module Option = - /// Gets the value associated with the option or the supplied default value. - let inline getOrElse v = function - | Some x -> x | None -> v - - /// Gets the option if Some x, otherwise try to get another value - let inline orTry f = - function - | Some x -> Some x - | None -> f() - module internal CommonHelpers = type private SourceLineData(lineStart: int, lexStateAtStartOfLine: FSharpTokenizerLexState, lexStateAtEndOfLine: FSharpTokenizerLexState, hashCode: int, classifiedSpans: IReadOnlyList, tokens: FSharpTokenInfo list) = @@ -318,7 +306,7 @@ module internal CommonHelpers = | LexerSymbolKind.GenericTypeParameter | LexerSymbolKind.StaticallyResolvedTypeParameter -> true | _ -> false) - |> Option.orTry (fun _ -> tokensUnderCursor |> List.tryFind (fun { DraftToken.Kind = k } -> k = LexerSymbolKind.Operator)) + |> Option.orElseWith (fun _ -> tokensUnderCursor |> List.tryFind (fun { DraftToken.Kind = k } -> k = LexerSymbolKind.Operator)) |> Option.map (fun token -> { Kind = token.Kind Line = linePos.Line