Skip to content

Instantly share code, notes, and snippets.

@Jmaharman
Jmaharman / trial.fsx
Created June 19, 2020 06:51
Doing applicative validation in a CE before F# 5
open System
type Trial<'Value, 'Error> =
| Pass of 'Value
| Fail of 'Error list
[<RequireQualifiedAccess>]
module Trial =
let map2 merge trial1 trial2 =
match (trial1, trial2) with