ci-fsharp-optionbuilder - FSharp.Core.Experimental.OptionBuilder 0.7.0-alpha23

option & chooseSeq computational expressions

PM> Install-Package FSharp.Core.Experimental.OptionBuilder -Version 0.7.0-alpha23 -Source https://www.myget.org/F/ci-fsharp-optionbuilder/api/v3/index.json

Copy to clipboard

> nuget.exe install FSharp.Core.Experimental.OptionBuilder -Version 0.7.0-alpha23 -Source https://www.myget.org/F/ci-fsharp-optionbuilder/api/v3/index.json

Copy to clipboard

> dotnet add package FSharp.Core.Experimental.OptionBuilder --version 0.7.0-alpha23 --source https://www.myget.org/F/ci-fsharp-optionbuilder/api/v3/index.json

Copy to clipboard
<PackageReference Include="FSharp.Core.Experimental.OptionBuilder" Version="0.7.0-alpha23" />
Copy to clipboard
source https://www.myget.org/F/ci-fsharp-optionbuilder/api/v3/index.json

nuget FSharp.Core.Experimental.OptionBuilder  ~> 0.7.0-alpha23
Copy to clipboard

> choco install FSharp.Core.Experimental.OptionBuilder --version 0.7.0-alpha23 --source https://www.myget.org/F/ci-fsharp-optionbuilder/api/v2

Copy to clipboard
Import-Module PowerShellGet
Register-PSRepository -Name "ci-fsharp-optionbuilder" -SourceLocation "https://www.myget.org/F/ci-fsharp-optionbuilder/api/v2"
Install-Module -Name "FSharp.Core.Experimental.OptionBuilder" -RequiredVersion "0.7.0-alpha23" -Repository "ci-fsharp-optionbuilder" -AllowPreRelease
Copy to clipboard

Browse the sources in this package using Visual Studio or WinDbg by configuring the following legacy symbol server URL: https://www.myget.org/F/ci-fsharp-optionbuilder/symbols/


FSharp.Interop.NullOptAble NuGet Status

Missing OptionBuilder for F# filling the void to interop with C#'s ?. usage. It works with Nulls, Options, Nullables.

CI Builds available: MyGet Pre Release

Build Statuses:

  • Windows: Build status
  • Mac & Linux: Build Status

Basic Info

There are more C# devs relying on the safe nav operator ?. and so nulls will only get worse on the C# side, making it more likely null's are going to drop out of APIs.

This project creates an option { } computational expression and chooseSeq { } computational expression that allows binding 'T option/'T Nullable/'T:null thus either returns an option or a sequence respectively.

With chooseSeq if you yield! another chooseSeq it will work recursively flatten or any sequence of NonNullSeq, list, or Set type. Any other sequence will be treated like a T:null object yield! and let! work with 'T option/'T Nullable/'T:null

Examples

let x = Nullable(3)
let y = Nullable(3)
option {
    let! x' = x
    let! y' = y
    return (x' + y')
} |> should equal (Some 6)

See more examples in Tests/RealWorld.fs.

Operator Examples

This library also has some operators available when specifically included

using FSharp.Interop.NullOptAble.Operators

You can find examples of them in Tests/RealWorldOperators.fs.

  • .NETStandard 1.6
    • FSharp.Core (>= 4.2.3)
    • NETStandard.Library (>= 1.6.1)
  • .NETStandard 1.6: 1.6.0.0

                        
Assembly Assembly hash Match
/lib/netstandard1.6/fsharp.core.experimental.optionbuilder.dll 9a616d4e0f6f413b8b2b0592d09197d5FFFFFFFF

Owners

Jay Tuley

Authors

Jay Tuley

Project URL

https://github.com/ekonbenefits/FSharp.Core.Experimental.OptionBuilder

License

MIT

Tags

fsharp option seq choose null conditional

Info

0 total downloads
0 downloads for version 0.7.0-alpha23
Download (9.83 KB)
Download legacy symbols (13.83 KB)
Found on the current feed only

Package history

Version Size Last updated Downloads Mirrored?
0.7.0-alpha23 9.83 KB Thu, 19 Apr 2018 21:13:41 GMT 0
0.7.0-alpha22 9.5 KB Thu, 19 Apr 2018 20:54:30 GMT 0
0.7.0-alpha21 9.5 KB Wed, 18 Apr 2018 19:12:45 GMT 0
0.7.0-alpha20 9.5 KB Wed, 18 Apr 2018 19:00:16 GMT 0
0.7.0-alpha19 9.5 KB Wed, 18 Apr 2018 17:40:40 GMT 0
0.7.0-alpha18 9.43 KB Wed, 18 Apr 2018 17:27:30 GMT 0
0.7.0-alpha17 9.43 KB Mon, 16 Apr 2018 05:06:37 GMT 0
0.7.0-alpha16 9.43 KB Mon, 16 Apr 2018 03:49:41 GMT 0
0.7.0-alpha15 9.43 KB Mon, 16 Apr 2018 03:22:01 GMT 0
0.7.0-alpha14 9.43 KB Mon, 16 Apr 2018 03:12:12 GMT 0
0.7.0-alpha13 9.43 KB Mon, 16 Apr 2018 02:25:45 GMT 0
0.7.0-alpha12 9.37 KB Sun, 15 Apr 2018 19:04:19 GMT 0