Last active
July 18, 2019 19:55
-
-
Save pizycki/82402ae252a2695cb25469aa1b6591fa to your computer and use it in GitHub Desktop.
Unwrap value from DU in F#
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
| // Based on https://stackoverflow.com/a/24293478/864968 |
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
| type ReleaseRequestMovieTitle = ReleaseRequestMovieTitle of string | |
| with | |
| override this.ToString() = | |
| this |> function | |
| | ReleaseRequestMovieTitle x -> x | |
| let x = (ReleaseRequestMovieTitle "bla");; | |
| // val x : ReleaseRequestMovieTitle = ReleaseRequestMovieTitle "bla" | |
| x.ToString();; | |
| // val it : string = "bla" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment