Created
June 29, 2016 10:38
-
-
Save pocketberserker/3c6828b25487b1a15dd9d1ee95b13bf3 to your computer and use it in GitHub Desktop.
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 ListReaderBuilder() = | |
member this.Bind(g, f) = function (x::xs) -> (f (g x)) xs | _ -> () | |
member this.Return(_) = fun _ -> () | |
let listReader = ListReaderBuilder() | |
let test = listReader { | |
do! printfn "%d" | |
do! printfn "%d" | |
} | |
test [1;2;3] | |
printfn "---" | |
test [4] |
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
1 | |
2 | |
--- | |
4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment