Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on You’re better off using Exceptions. Parent comment
https://github.com/dotnet/fsharp/blob/master/src/fsharp/FSha...
You could instead write it as the following to handle that.
let average (customers : Customer list) = customers |> List.choose (fun c -> c.Credit) |> function | [] -> Error "no customers with credit" | xs -> Ok (List.average xs)
https://github.com/dotnet/fsharp/blob/master/src/fsharp/FSha...
You could instead write it as the following to handle that.