Skip to content

Instantly share code, notes, and snippets.

@jbezak
jbezak / AsyncResult.fs
Last active May 15, 2017 10:52
Minimal asyncResult computation expresion inspired by http://blog.ploeh.dk/2016/04/11/async-as-surrogate-io/
// using Result from F# 4.1
module AsyncResult =
let inline bind f x = async {
let! x' = x
match x' with
| Ok a -> return! f a
| Error e -> return Error e
}
@jbezak
jbezak / FsharpService.fs
Last active May 10, 2017 17:14
Combining TopShelf with Installer for InstallUtil.exe
namespace FsharpService
open System.ComponentModel
open System.Configuration.Install
open System.Diagnostics
[<RunInstaller(true)>]
type public FSharpServiceInstaller() =
inherit Installer()