To make it short:

Main> let append' xs y = init xs ++ [last xs ++ [y]]

This works for the three given examples but maybe incorrect
for the task you have in mind, e.g., if xs is empty.

Main> append' [ [1, 2], [3, 4], [5] ] 6
[[1,2],[3,4],[5,6]]
Main> append' [ ['1', '2'], ['3'] ] '4'
["12","34"]
Main> append' [ [True], [True] ] False
[[True],[True,False]]

Cheers
--
 Christoph
 
_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to