This repository was archived by the owner on Jul 5, 2022. It is now read-only.

Description
‘’’fsharp
let getUpperText path =
path
|> Some
|> Option.filter File.Exists
|> Option.map (File.ReadAllText >> getUpper)
|> Option.defaultIfNone "DEFAULT"
module Result =
// ('a -> bool) -> 'a -> Result<'a, 'a>
let split f x = if f x then Success x else Failure x
// ('a -> 'b) -> ('c -> 'b) -> Result<'a, 'c> -> 'b
let either f g = function
| Success succ -> f succ
| Failure fail -> g fail
‘’’
https://hexdocs.pm/fe/FE.Maybe.html#content