Created
July 28, 2015 06:15
-
-
Save oskwazir/75b7e33ab684f3875090 to your computer and use it in GitHub Desktop.
Functions with pattern matching
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
| -module(functions). | |
| -compile(export_all). %%replace with -export() later! | |
| head([H|_]) -> H. | |
| second([_,X|_]) -> X. | |
| same(X,X) -> | |
| true; | |
| same(_,_) -> | |
| false. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment