Created
March 4, 2017 18:50
-
-
Save AnwarShahriar/d504b20e7470d3ce7fecce90acc7660d 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(practice). | |
-export([join/2, concat/1, member/2]). | |
join([],Y) -> Y; | |
join([X|Xs], [Y|Ys]) -> | |
[X|join(Xs, [Y|Ys])]. | |
concat([X]) -> X; | |
concat([X|Xs]) -> | |
join(X, concat(Xs)). | |
member(X, [X|_Xs]) -> true; | |
member(_X, []) -> false; | |
member(X, [_Y|Ys]) -> member(X, Ys). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment