-
Notifications
You must be signed in to change notification settings - Fork 789
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(FSharp.Editor): add InternalOptionBuilder module
* refactor(AddExplicitReturnType.fs, RemoveExplicitReturnType.fs): use InternalOptionBuilder for option handling * feat(FSharp.Editor.fsproj): include InternalOptionBuilder.fs in project compilation
- Loading branch information
1 parent
ec723c8
commit 407572f
Showing
4 changed files
with
84 additions
and
42 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
vsintegration/src/FSharp.Editor/Common/InternalOptionBuilder.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module internal Microsoft.VisualStudio.FSharp.Editor.InternalOptionBuilder | ||
|
||
type InternalOptionBuilder() = | ||
member _.Bind(x, f) = Option.bind f x | ||
member _.Return(x) = Some x | ||
member _.ReturnFrom(x) = x | ||
member _.Zero() = Some() | ||
|
||
let internalOption = InternalOptionBuilder() | ||
let inline (|>>) v f = Option.map f v | ||
let inline (|>!) v f = Option.bind f v | ||
let inline (>->) f g v = f v |>> g | ||
let inline (>=>) f g v = f v >>= g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters