Erlang - tuple_to_list



This method is convert a tuple to a list.

Syntax

tuple_to_list(list)

Parameters

  • Tuple − This is the tuple which needs to be converted to a list.

Return Value

Returns a list based on the tuple provided.

For example

-module(helloworld). 
-export([start/0]). 

start() -> 
   io:fwrite("~w",[tuple_to_list({1,2,3})]).

Output

The output of the above program is as follows

[1,2,3]
tuples.htm
Advertisements