subject

**Language: Erlang** Without using Erlang’s lists module functions, write a function concat/1, whose type is given by the following:
-spec concat(Lists :: [[T]]) -> [T].
The function concat takes a list of lists of elements (of some type T) and returns a list of the elements (of type T) formed by concatenating the inner lists together in order.
The following are examples written using the Erlang testing module. You can use the built-in ++ in your code, or any other helping functions. Run these tests by compiling your file and the
testing file, and then running concat_tests:main().
Example:
% $Id: concat_tests. erl, v 1.3 2015/03/12 13:50:59 leavens Exp leavens $
-module(concat_tests).
-import(testing,[dotests/2,eqTest/3 ]).
-export([main/0, tests/1]).
main() ->
compile:file(concat),
dotests("concat_tests $Revision: 1.3 $", tests(fun concat:concat/1)).
-spec tests(CFun :: fun(([[T]]) -> [T])) -> testing:testCase([atom()]).
tests(CFun) ->
[eqTest(CFun([]), "==", []),
eqTest(CFun([[]]), "==", []),
eqTest(CFun([[fee], [fie], [fo], [fum]]), "==", [fee, fie, fo, fum]),
eqTest(CFun([[], [hmm], [], [okay]]), "==", [hmm, okay]),
eqTest(CFun([[keep], [ancient, lands], [your, storied, pomp], [cries, she]]),
"==", [keep, ancient, lands, your, storied, pomp, cries, she]),
eqTest(CFun([[four, score, nd, seven], [years, ago], [our, ancestors],
[brought, forth, on, this, continent], [a, new, nation]]),
"==", [four, score, nd, seven, years, ago, our, ancestors,
brought, forth, on, this, continent, a, new, nation]),
eqTest(CFun([[[more],[nested]], [[than],[before]]]),
"==", [[more], [nested], [than], [before]])
].

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 23:30
Me2540 week 5 assignment what do i want to know?
Answers: 1
question
Computers and Technology, 22.06.2019 08:30
Active listen eliminates barries to communication true or false
Answers: 1
question
Computers and Technology, 23.06.2019 07:00
Why is investing in a mutual fund less risky than investing in a particular company's stock? a. mutual funds only invest in blue-chip stocks. b. investments in mutual funds are more liquid. c. mutual funds hold a diversified portfolio of stocks. d. investments in mutual funds offer a higher rate of return.
Answers: 2
question
Computers and Technology, 23.06.2019 09:10
(328 inc. 448 ind. 480 in25. john has a collection of toy cars. he has 2 red cars, 4 blue cars, 4 black cars, and 6 yellowcars. what is the ratio of red cars to yellow cars? a. 1: 2b. 1: 3c. 1: 626. the net of a right triangular prism is shown below.
Answers: 2
You know the right answer?
**Language: Erlang** Without using Erlang’s lists module functions, write a function concat/1, whos...
Questions
question
Mathematics, 02.01.2020 03:31
question
Mathematics, 02.01.2020 03:31
question
Mathematics, 02.01.2020 03:31
Questions on the website: 13722362