Created
February 21, 2017 11:09
-
-
Save cls/822370cc18197c158fbebffba814be89 to your computer and use it in GitHub Desktop.
Cartesian product over lists
This file contains 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
cartesian :: [[a]] -> [[a]] | |
cartesian [] = [[]] | |
cartesian (xs:zss) = [x:ys | x <- xs, ys <- cartesian zss] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment