Add element to end of tuple list in Haskell -


im new in haskell , try add element end of tuple list

for example:

[(1,2,3),(2,3,4)] want add (3,4,5) . [(1,2,3),(2,3,4),(3,4,5)]

adding end of list inefficient can use ++:

[(1,2,3),(2,3,4)] ++ [(3,4,5)] 

if need keep adding end of collection use data.sequence instead:

import data.sequence (fromlist [(1,2,3),(2,3,4)]) |> (3,4,5) 

Comments

Popular posts from this blog

What can cause "Required Package 'IndyCore' not found" when compiling a Delphi 2010 project? -

Change the color of an oval at click in Java AWT -