cross :: Eq c => (a->b->[c]) -> [a] -> [b] -> [[c]]
cross f xs ys = 
    let lift xs = map Just xs ++ repeat Nothing
        unlift (Just x:ys) = x ++ unlift ys
        unlift (Nothing:ys) = unlift ys
        unlift _ = []
    in  map (nub . unlift)
       $ takeWhile ( any isJust )
       $  cross_inf (\ x y -> f <$> x <*> y)
        ( lift xs) (lift ys)
cross :: Eq c => (a->b->[c]) -> [a] -> [b] -> [[c]]
cross f xs ys = 
    let lift xs = map Just xs ++ repeat Nothing
        unlift (Just x:ys) = x ++ unlift ys
        unlift (Nothing:ys) = unlift ys
        unlift _ = []
    in  map (nub . unlift)
       $ takeWhile ( any isJust )
       $  cross_inf (\ x y -> f <$> x <*> y)
        ( lift xs) (lift ys)
cross f xs ys = 
    let lift xs = map Just xs ++ repeat Nothing
        unlift (Just x:ys) = x ++ unlift ys
        unlift (Nothing:ys) = unlift ys
        unlift _ = []
    in  map (nub . unlift)
       $ takeWhile ( any isJust )
       $  cross_inf (\ x y -> f <$> x <*> y)
        ( lift xs) (lift ys)