@@ -12,6 +12,16 @@ module internal Internals=
1212open Internals
1313
1414[<Extension>]
15+ /// <summary >
16+ /// Helpers for working with <c >FSharpOption< ; T> ; </c > from C#.
17+ /// </summary >
18+ /// <example >
19+ /// <code lang =" csharp " >
20+ /// var sum = from x in 5.Some()
21+ /// from y in 6.Some()
22+ /// select x + y; // Some 11
23+ /// </code >
24+ /// </example >
1525type Options =
1626 static member Cast ( o : obj ) : 'a option =
1727 try
@@ -42,6 +52,9 @@ type Options =
4252 | _ -> Some v
4353
4454 [<Extension>]
55+ /// <summary >
56+ /// Creates <c >Some(value)</c > from C#.
57+ /// </summary >
4558 static member Some ( a : 'a ) : 'a option = Option.Some a
4659
4760 [<Extension>]
@@ -158,6 +171,9 @@ type NumberParser(numberstyles: NumberStyles, cultureInfo: CultureInfo)=
158171
159172
160173[<Extension>]
174+ /// <summary >
175+ /// Helpers for creating and matching F# <c >Choice</c > values from C#.
176+ /// </summary >
161177type Choices =
162178
163179
@@ -197,6 +213,15 @@ type Choices =
197213 static member Create3Of3 < 'T1 , 'T2 , 'T3 > ( a : 'T3 ) : Choice < 'T1 , 'T2 , 'T3 > = Choice3Of3 a
198214
199215[<Extension>]
216+ /// <summary >
217+ /// Helpers for working with F# <c >Result< ; TOk, TError> ; </c > from C#.
218+ /// </summary >
219+ /// <example >
220+ /// <code lang =" csharp " >
221+ /// var parsed = parser.TryParseInt("42").ToResult("invalid");
222+ /// var plusOne = parsed.Select(x => x + 1);
223+ /// </code >
224+ /// </example >
200225type Results =
201226
202227 /// Attempts to cast an object.
@@ -236,7 +261,13 @@ type Results =
236261
237262 // constructors
238263
264+ /// <summary >
265+ /// Creates <c >Ok(value)</c >.
266+ /// </summary >
239267 static member Ok < 'T1 , 'T2 > ( a : 'T1 ) : Result < 'T1 , 'T2 > = Ok a
268+ /// <summary >
269+ /// Creates <c >Error(value)</c >.
270+ /// </summary >
240271 static member Error < 'T1 , 'T2 > ( b : 'T2 ) : Result < 'T1 , 'T2 > = Result.Error b
241272
242273
@@ -309,4 +340,3 @@ module Enums=
309340 let getValues < 't > ()=
310341 let values = System.Enum.GetValues ( typeof< 't>)
311342 Enumerable.Cast< 't> values //Array.unbox
312-
0 commit comments