Fastest way to get the last element of a list in Haskell
You can use the last function to get the last element of a list. As for how to remove the first and last elements, you could use (init . tail), but I don’t know how efficient that is. I think this image from Learn You A Haskell shows the list functions fairly well: