Created
May 5, 2019 08:57
-
-
Save AndreasHassing/13791250d1d6b6a70b80e0f76ebf7255 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
| let (|UpperCase|) (str: string) = str.ToUpper() | |
| // This blows my mind! | |
| // thanks: https://youtu.be/yE88l29NOZw?t=151 | |
| let usedInAFunctionSignature (UpperCase(upper)) = | |
| printfn "%s" upper | |
| let usedLikeAMethod str = | |
| let upper = (|UpperCase|) str | |
| printfn "%s" upper |
Author
Author
Immensely useful to be able to use single case active pattern like this in the method signature - sort of like a function signature level converter.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks @7sharp9! :)