I am trying to implement a greedy zip method in Haskell where it does not drop the elements, instead, it will use some default value. I appreciate any feedback to make it more compact.
zip' [-1] [] r = r
zip' [] [-1] r = r
zip' [] b r = zip' [-1] b r
zip' a [] r = zip' a [-1] r
zip' a b r = (xa, xb) : (zip' xsa xsb r)
where
(xa: xsa) = a
(xb: xsb) = b
main = do
let l1 = [1, 2, 3]
let l2 = [3, 4]
print (zip' l1 l2 [])
-- expected: [(1,3),(2,4),(3,-1)]