Say i've defined a Queue and have the following function:
pushq :: a -> Queue a -> Queue a
pushq x (Queue1 xs) = Queue1 (x:xs)
It works by adding a single element it to the front of a queue, but say I wanted to use the function in another method which would add an entire list of elements to a queue rather than a single one such as:
adds :: [a] -> Queue a -> Queue a
How would I be able iterate through the list and use the pushq function on every element one by one to add it to the queue?