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
#! /usr/bin/env dotnet fsi --exec --langversion:preview | |
#r "nuget: Argu" | |
#r "nuget: FParsec" | |
// #I needed because of https://github.com/dotnet/fsharp/issues/9217 | |
// Should be fixed for final release | |
#I "/Users/joergbeekmann/.nuget/packages/fparsec/1.1.1/lib/netstandard2.0" | |
open Argu | |
open FParsec |
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
[<AutoOpen>] | |
module LazyBuilder = | |
let inline force(x: Lazy<_>) = x.Force() | |
type LazyCont<'a> = LazyCont of (unit -> Lazy<'a>) | |
type LazyBuilder() = | |
member __.Return x = lazy x | |
member __.ReturnFrom (x: Lazy<_>) = x | |
member __.Bind(Lazy x, f) = f x | |
member __.Delay f = LazyCont f | |
member __.Run (LazyCont f) = Lazy.Create (f >> force) |
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
type IBuilderResult = interface end | |
type ICombinable = inherit IBuilderResult | |
type INonCombinable = inherit IBuilderResult | |
type First = | |
| Payload of int | |
| Nested of ICombinable | |
interface ICombinable | |
type Second = | |
| Payload of string |