Skip to content

Commit 2596a80

Browse files
committed
see refs in comments for option result and result option
1 parent 8a1f6ae commit 2596a80

File tree

3 files changed

+61
-63
lines changed

3 files changed

+61
-63
lines changed

src/Danom/Option/Option.cs

+22-22
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ private Option(T t)
2020
}
2121

2222
/// <summary>
23-
/// Returns true if Option is Some, false otherwise.
23+
/// Returns true if <see cref="Option{T}"/> is Some, false otherwise.
2424
/// </summary>
2525
public bool IsSome { get; } = false;
2626

2727
/// <summary>
28-
/// Returns true if Option is None, false otherwise.
28+
/// Returns true if <see cref="Option{T}"/> is None, false otherwise.
2929
/// </summary>
3030
public bool IsNone => !IsSome;
3131

3232
/// <summary>
33-
/// If Option is Some evaluate the some delegate, otherwise none.
33+
/// If <see cref="Option{T}"/> is Some evaluate the some delegate, otherwise none.
3434
/// </summary>
3535
/// <typeparam name="U"></typeparam>
3636
/// <param name="some"></param>
@@ -42,7 +42,7 @@ public U Match<U>(Func<T, U> some, Func<U> none) =>
4242
none();
4343

4444
/// <summary>
45-
/// Evaluates the bind delegate if Option is Some otherwise return None.
45+
/// Evaluates the bind delegate if <see cref="Option{T}"/> is Some otherwise return None.
4646
/// </summary>
4747
/// <typeparam name="U"></typeparam>
4848
/// <param name="bind"></param>
@@ -52,7 +52,7 @@ public Option<U> Bind<U>(
5252
Match(bind, Option<U>.None);
5353

5454
/// <summary>
55-
/// Evaluates the map delegate if Option is Some otherwise return None.
55+
/// Evaluates the map delegate if <see cref="Option{T}"/> is Some otherwise return None.
5656
/// </summary>
5757
/// <typeparam name="U"></typeparam>
5858
/// <param name="map"></param>
@@ -62,7 +62,7 @@ public Option<U> Map<U>(
6262
Bind(x => Option<U>.Some(map(x)));
6363

6464
/// <summary>
65-
/// Returns the value of Option if it is T otherwise return default.
65+
/// Returns the value of <see cref="Option{T}"/> if it is T otherwise return default.
6666
/// </summary>
6767
/// <param name="defaultValue"></param>
6868
/// <returns></returns>
@@ -71,7 +71,7 @@ public T DefaultValue(
7171
Match(some => some, () => defaultValue);
7272

7373
/// <summary>
74-
/// Returns the value of Option if it is T otherwise evaluate default.
74+
/// Returns the value of <see cref="Option{T}"/> if it is T otherwise evaluate default.
7575
/// </summary>
7676
/// <param name="defaultWith"></param>
7777
/// <returns></returns>
@@ -80,7 +80,7 @@ public T DefaultWith(
8080
Match(some => some, () => defaultWith());
8181

8282
/// <summary>
83-
/// Return Option if it is Some, otherwise return ifNone.
83+
/// Return <see cref="Option{T}"/> if it is Some, otherwise return ifNone.
8484
/// </summary>
8585
/// <param name="ifNone"></param>
8686
/// <returns></returns>
@@ -89,7 +89,7 @@ public Option<T> OrElse(
8989
Match(Option<T>.Some, () => ifNone);
9090

9191
/// <summary>
92-
/// Return Option if it is Some, otherwise evaluate ifNoneWith.
92+
/// Return <see cref="Option{T}"/> if it is Some, otherwise evaluate ifNoneWith.
9393
/// </summary>
9494
/// <param name="ifNoneWith"></param>
9595
/// <returns></returns>
@@ -99,45 +99,45 @@ public Option<T> OrElseWith(
9999

100100

101101
/// <summary>
102-
/// Creates a new Option with the specified value.
102+
/// Creates a new <see cref="Option{T}"/> with the specified value.
103103
/// </summary>
104104
/// <param name="value"></param>
105105
/// <returns></returns>
106106
public static Option<T> Some(T value) =>
107107
new(value);
108108

109109
/// <summary>
110-
/// Creates Option with the specified value wrapped in a completed Task.
110+
/// Creates <see cref="Option{T}"/> with the specified value wrapped in a completed Task.
111111
/// </summary>
112112
/// <param name="value"></param>
113113
/// <returns></returns>
114114
public static Task<Option<T>> SomeAsync(T value) =>
115115
Task.FromResult(Some(value));
116116

117117
/// <summary>
118-
/// Creates a new Option with the value of the awaited Task.
118+
/// Creates a new <see cref="Option{T}"/> with the value of the awaited Task.
119119
/// </summary>
120120
/// <param name="value"></param>
121121
/// <returns></returns>
122122
public static async Task<Option<T>> SomeAsync(Task<T> value) =>
123123
Some(await value);
124124

125125
/// <summary>
126-
/// Creates a new Option with no value.
126+
/// Creates a new <see cref="Option{T}"/> with no value.
127127
/// </summary>
128128
/// <returns></returns>
129129
public static Option<T> None() =>
130130
new();
131131

132132
/// <summary>
133-
/// Creates a new Option with no value wrapped in a completed Task.
133+
/// Creates a new <see cref="Option{T}"/> with no value wrapped in a completed Task.
134134
/// </summary>
135135
/// <returns></returns>
136136
public static Task<Option<T>> NoneAsync() =>
137137
Task.FromResult(None());
138138

139139
/// <summary>
140-
/// Returns true if the specified Options are equal.
140+
/// Returns true if the specified <see cref="Option{T}"/>s are equal.
141141
/// </summary>
142142
/// <param name="left"></param>
143143
/// <param name="right"></param>
@@ -146,7 +146,7 @@ public static Task<Option<T>> NoneAsync() =>
146146
left.Equals(right);
147147

148148
/// <summary>
149-
/// Returns true if the specified Options are not equal.
149+
/// Returns true if the specified <see cref="Option{T}"/>s are not equal.
150150
/// </summary>
151151
/// <param name="left"></param>
152152
/// <param name="right"></param>
@@ -155,15 +155,15 @@ public static Task<Option<T>> NoneAsync() =>
155155
!(left == right);
156156

157157
/// <summary>
158-
/// Returns true if the specified Options are equal.
158+
/// Returns true if the specified <see cref="Option{T}"/>s are equal.
159159
/// </summary>
160160
/// <param name="obj"></param>
161161
/// <returns></returns>
162162
public override bool Equals(object? obj) =>
163163
obj is Option<T> o && Equals(o);
164164

165165
/// <summary>
166-
/// Returns true if the specified Options are equal.
166+
/// Returns true if the specified <see cref="Option{T}"/>s are equal.
167167
/// </summary>
168168
/// <param name="other"></param>
169169
/// <returns></returns>
@@ -180,7 +180,7 @@ public readonly bool Equals(Option<T> other) =>
180180
);
181181

182182
/// <summary>
183-
/// Returns the hash code of the Option.
183+
/// Returns the hash code of the <see cref="Option{T}"/>.
184184
/// </summary>
185185
/// <returns></returns>
186186
public override int GetHashCode() =>
@@ -189,7 +189,7 @@ public override int GetHashCode() =>
189189
none: () => 0);
190190

191191
/// <summary>
192-
/// Returns the string representation of the Option.
192+
/// Returns the string representation of the <see cref="Option{T}"/>.
193193
/// </summary>
194194
/// <returns></returns>
195195
public override string ToString() =>
@@ -199,12 +199,12 @@ public override string ToString() =>
199199
}
200200

201201
/// <summary>
202-
/// Extension methods to allow Option matching using
202+
/// Extension methods to allow <see cref="Option{T}"/> matching using
203203
/// </summary>
204204
public static class OptionActionExtensions
205205
{
206206
/// <summary>
207-
/// If Option is Some, evaluates the some delegate, otherwise evaluates
207+
/// If <see cref="Option{T}"/> is Some, evaluates the some delegate, otherwise evaluates
208208
/// the none delegate.
209209
/// </summary>
210210
/// <typeparam name="T"></typeparam>

0 commit comments

Comments
 (0)