I have a function like the one provided below:
zip :: [a] -> [b] -> Maybe [(a,b)]
zip (headX:tailX) (headY:tailY) = (headX,headY):zip tailX tailY
zip _ _ = Nothing
Now
zip tailX tailY
Will return a type of Maybe list, and I am trying to prepend (headX,headY) to it using the : operator. Is there an easy way to do this? If I try to prepend it directly the compiler gives me errors because : operator only works on lists.