Skip to content

Instantly share code, notes, and snippets.

@kyrylo
Created October 23, 2014 23:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyrylo/dde9fad06d3cc08e1604 to your computer and use it in GitHub Desktop.
Save kyrylo/dde9fad06d3cc08e1604 to your computer and use it in GitHub Desktop.
-module(my_tuple_to_list).
-compile(export_all).
my_tuple_to_list(T) ->
my_tuple_to_list_acc(T, [], tuple_size(T)).
my_tuple_to_list_acc(_T, L, 0) -> L;
my_tuple_to_list_acc(T, L, N) ->
my_tuple_to_list_acc(T, [element(N, T)|L], N - 1).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment