xander wrote:
> 
> Howdy,
> 
> This is probably a RTFM/stupid/annoying/... question,
> 
> BUT, :)
> 
> is there an opposite (:) available in haskell?
> like, i can toss an element at the back of a list without
> O(n) fuss recursing bla??
> 
> The (:) operator is internally, isn't it? So why not make life easier
> and create (hack) an opposite of it?

Well, if efficiently accessing both ends of the list is really that
important, you might see if someone has already come up with a Haskell
version of a double-ended queue (deque) or something similar.

Else, you could just use the (++) operator and hope that one of the
compilers is optimized to handle it in less than O(n) time. :)

- Michael Hobbs


Reply via email to