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

c# - Unity IoC Lifetime per HttpRequest for UserStore -

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

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -