Skip to content

Instantly share code, notes, and snippets.

@pelotom
Last active December 14, 2015 17:29
Show Gist options
  • Save pelotom/5122291 to your computer and use it in GitHub Desktop.
Save pelotom/5122291 to your computer and use it in GitHub Desktop.
data ABList a b = Cons a (ABList b a) | Nil
deriving Show
zipAB :: [a] -> [b] -> ABList a b
zipAB [] _ = Nil
zipAB (a:as) bs = Cons a (zipAB bs as)
-- > zipAB [1..] "hey"
-- Cons 1 (Cons 'h' (Cons 2 (Cons 'e' (Cons 3 (Cons 'y' (Cons 4 Nil))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment