From cea8e7092233df68b410c562bc732deaffc9f7aa Mon Sep 17 00:00:00 2001 From: Chet Husk Date: Wed, 8 Sep 2021 09:11:26 -0500 Subject: [PATCH] Add language tags to the existing example code sections (#12129) --- src/fsharp/FSharp.Core/async.fsi | 2 +- src/fsharp/FSharp.Core/option.fsi | 52 +++++++++++++++---------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/fsharp/FSharp.Core/async.fsi b/src/fsharp/FSharp.Core/async.fsi index 4f9f765bf6f..0cae20eb808 100644 --- a/src/fsharp/FSharp.Core/async.fsi +++ b/src/fsharp/FSharp.Core/async.fsi @@ -174,7 +174,7 @@ namespace Microsoft.FSharp.Control /// /// 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 diff --git a/src/fsharp/FSharp.Core/option.fsi b/src/fsharp/FSharp.Core/option.fsi index 1c4c74f78a8..d148f29d4a0 100644 --- a/src/fsharp/FSharp.Core/option.fsi +++ b/src/fsharp/FSharp.Core/option.fsi @@ -16,7 +16,7 @@ module Option = /// The input option. /// /// - /// + /// /// None |> Option.isSome // evaluates to false /// Some 42 |> Option.isSome // evaluates to true /// @@ -31,7 +31,7 @@ module Option = /// The input option. /// /// - /// + /// /// None |> Option.isNone // evaluates to true /// Some 42 |> Option.isNone // evaluates to false /// @@ -51,7 +51,7 @@ module Option = /// 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 /// @@ -68,7 +68,7 @@ module Option = /// is not evaluated unless is None. /// /// - /// + /// /// None |> Option.defaultWith (fun () -> 99) // evaluates to 99 /// Some 42 |> Option.defaultWith (fun () -> 99) // evaluates to 42 /// @@ -82,7 +82,7 @@ module Option = /// 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 @@ -103,7 +103,7 @@ module Option = /// 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 @@ -118,7 +118,7 @@ module Option = /// The input option. /// /// - /// + /// /// Some 42 |> Option.get // evaluates to 42 /// None |> Option.get // throws exception! /// @@ -134,7 +134,7 @@ module Option = /// The input option. /// /// - /// + /// /// None |> Option.count // evaluates to 0 /// Some 99 |> Option.count // evaluates to 1 /// @@ -151,7 +151,7 @@ module Option = /// 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 @@ -170,7 +170,7 @@ module 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 @@ -188,7 +188,7 @@ module Option = /// 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 @@ -206,7 +206,7 @@ module Option = /// 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 @@ -224,7 +224,7 @@ module Option = /// 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 @@ -241,7 +241,7 @@ module Option = /// The input option. /// /// - /// + /// /// None |> Option.iter (printfn "%s") // does nothing /// Some "Hello world" |> Option.iter (printfn "%s") // prints "Hello world" /// @@ -258,7 +258,7 @@ module Option = /// 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 /// @@ -275,7 +275,7 @@ module 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 @@ -295,7 +295,7 @@ module 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 @@ -315,7 +315,7 @@ module Option = /// The input option. /// /// - /// + /// /// let tryParse input = /// match System.Int32.TryParse input with /// | true, v -> Some v @@ -338,7 +338,7 @@ module Option = /// 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 @@ -353,7 +353,7 @@ module Option = /// 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 @@ -369,7 +369,7 @@ module Option = /// The input option. /// /// - /// + /// /// None |> Option.toArray // evaluates to [||] /// Some 42 |> Option.toArray // evaluates to [|42|] /// @@ -384,7 +384,7 @@ module Option = /// The input option. /// /// - /// + /// /// None |> Option.toList // evaluates to [] /// Some 42 |> Option.toList // evaluates to [42] /// @@ -399,7 +399,7 @@ module Option = /// The input option. /// /// - /// + /// /// None |> Option.toNullable // evaluates to new System.Nullable<int>() /// Some 42 |> Option.toNullable // evaluates to new System.Nullable(42) /// @@ -414,7 +414,7 @@ module Option = /// The input nullable value. /// /// - /// + /// /// System.Nullable<int>() |> Option.ofNullable // evaluates to None /// System.Nullable(42) |> Option.ofNullable // evaluates to Some 42 /// @@ -429,7 +429,7 @@ module Option = /// The input value. /// /// - /// + /// /// (null: string) |> Option.ofObj // evaluates to None /// "not a null string" |> Option.ofObj // evaluates to (Some "not a null string") /// @@ -444,7 +444,7 @@ module Option = /// The input value. /// /// - /// + /// /// None |> Option.toObj // evaluates to null /// Some "not a null string" |> Option.toObj // evaluates to "not a null string" ///