Skip to content

Instantly share code, notes, and snippets.

@rexcfnghk
Last active July 1, 2016 14:54
Show Gist options
  • Select an option

  • Save rexcfnghk/b82242322136087f113b05a24356813e to your computer and use it in GitHub Desktop.

Select an option

Save rexcfnghk/b82242322136087f113b05a24356813e to your computer and use it in GitHub Desktop.
open System
// val tryConvertToChar: s: string -> ValidationResult<char>
let tryConvertToChar (s: string) =
match Char.TryParse s with
| true, c -> Success c
| false, _ -> Error "Input string is not a character"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment