Created
February 23, 2018 08:31
-
-
Save mp4096/ed40e3b7c322fcf64cf4c70a6e0effbe to your computer and use it in GitHub Desktop.
Cartesian product using folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
product xss = foldr f [[]] xss | |
where f xs yss = foldr g [] xs | |
where g x zss = foldr h zss yss | |
where h ys qss = (x : ys) : qss |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment