Write a function in Erlang called func that takes a list of tuples and returns a new list consisting of tuples from the original list, for which the first tuple element is smaller than the second one (each tuple in the incoming list consists of only two elements).

Respuesta :

Answer:

Please find the complete question in the attached file.

Explanation:

Following are the code to the given question:

-module(helloworld)//use a module

-export([start/0])

start() ->//start module

func([Head Taill) ->//defining a method func that takes a parameter

{

first, second} = Head,//holding head value

if //defining if block

first > second -> func(Tail)//method func that takes a parameter

true ->

[first, second}|func(Tail)]//method func that takes a parameter

end

Ver imagen codiepienagoya