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
Post a Comment