Created
September 26, 2022 19:05
-
-
Save dsshep/87f7a7fbc6412a61c31f05cd8abb5f53 to your computer and use it in GitHub Desktop.
This file contains 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
module Age = | |
type Age = private Age of int | |
let create (age : int) : Age option = | |
if age < 0 then None else Some (Age age) | |
module Application = | |
let invalidAge = Age.create -1 // none | |
let validAge = Age.create 10 // some |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment