Skip to content

Instantly share code, notes, and snippets.

@ir4y
Created March 14, 2016 16:19
Show Gist options
  • Save ir4y/d63840ec9cc9680dc283 to your computer and use it in GitHub Desktop.
Save ir4y/d63840ec9cc9680dc283 to your computer and use it in GitHub Desktop.
xx :: [a] -> [a] -> [[a]]
[] `xx` xs = []
xs `xx` [] = []
(a:as) `xx` bs = (a `x` bs) ++ (as `xx` bs)
x :: a -> [a] -> [[a]]
a `x` [] = []
a `x` (b:bs) = [[a,b]] ++ (a `x` bs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment