Last active
July 1, 2016 14:54
-
-
Save rexcfnghk/b82242322136087f113b05a24356813e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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