Hi,
To quote Prelude's FAQ on linked lists
My question is that, how is maintaining a head and tail pointer more expensive than, say traversing the entire list each time you want to add a node at the end?For code that maintains both a head and tail pointer, the first and last functions will never even be used! The only reason I put them there is because I'm usually too lazy to maintain head and tail pointers. But just so that you know the issues, regular use of first and last can be a big performance hit for large lists.
Thanks,
Sahil