New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC FS-1004] FSharpResult type with a few tests #964
Conversation
Hi @wallymathieu, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
@wallymathieu, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR. |
@wallymathieu can you add
|
@@ -601,7 +601,7 @@ namespace Microsoft.FSharp.Control | |||
let mutable defaultCancellationTokenSource = new CancellationTokenSource() | |||
|
|||
[<NoEquality; NoComparison>] | |||
type Result<'T> = | |||
type AsyncImplResult<'T> = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a public type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a private type. It's not exposed from control.fsi.
How does this relate to Chessie? Are you going to port the tests over? If we really put this into FSharp.Core then it should at least do what Chessie can. Especially in regards to C# interop this is a really hard topic. I tried so many things to make Chessie work for C# - so please also port the C# samples / tests to show that we have at elast that basic C# support that Chessie has. |
Is that really the type we want for Results? Chessie is using:
|
@enricosada there, I've updated the description and title. |
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
// Various tests for: | ||
// Microsoft.FSharp.Core.ExtraTopLevelOperators.printf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please adjust this comment to match the test target.
@wallymathieu @forki @dsyme @otawfik-ms Kevin |
[<StructuralEquality; StructuralComparison>] | ||
[<CompiledName("FSharpResult`2")>] | ||
type Result<'T1,'T2> = | ||
| Success of 'T1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename Success
to Ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename the type variables to T
and TError
Please make the adjustments mentioned above and then we can accept this, There is discussion in the RFC about whether we should also add a corresponding module of operations and a |
Should I do a merge from master and fix the compilation error in Commands.fs? |
@wallymathieu Yes please |
The failure of |
CLose/reopen to re-run CI |
Hi @wallymathieu, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! The agreement was validated by Microsoft and real humans are currently evaluating your PR. TTYL, MSBOT; |
Should we change the title and remove [WIP] ? |
@@ -3470,6 +3470,12 @@ namespace Microsoft.FSharp.Core | |||
and 'T option = Option<'T> | |||
|
|||
|
|||
[<StructuralEquality; StructuralComparison>] | |||
[<CompiledName("FSharpResult`2")>] | |||
type Result<'TOk,'TError> = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change to just "T" instead of "TOk"
@wallymathieu removed, thanks. Added one comment above TOk --> T |
@KevinRansom @otawfik-ms This is ready to merge. |
LGTM 👍 |
👍 |
This is the implementation of RFC FS-1004 Result type