Created
November 5, 2016 19:46
-
-
Save bobjflong/d871008195af2413c6a627f5e8dd3891 to your computer and use it in GitHub Desktop.
adt3
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
| value = %MyModule.Bar{} | |
| result = MyModule.case value, [ | |
| Foo: fn(x) -> x + 1 end, | |
| Bar: fn(x) -> x.val <> " there" end | |
| ] | |
| # assert result == "hey there" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment