Skip to content

Instantly share code, notes, and snippets.

@ConnorBaker
Last active February 23, 2019 00:51
Show Gist options
  • Select an option

  • Save ConnorBaker/3d8e92326a8a98a0fd49535828644b65 to your computer and use it in GitHub Desktop.

Select an option

Save ConnorBaker/3d8e92326a8a98a0fd49535828644b65 to your computer and use it in GitHub Desktop.
Programming in Haskell, 2nd ed.: Chapter 5: Problem 3
grid :: Int -> Int -> [(Int,Int)]
grid m n = [(x,y) | x <- [0..m], y <- [0..n]]
square :: Int -> [(Int,Int)]
square n = [(x,y) | (x,y) <- grid n n, x /= y]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment