Skip to content

Instantly share code, notes, and snippets.

@DuqueDeTuring
Last active August 29, 2015 14:21
Show Gist options
  • Save DuqueDeTuring/0d1d98beb3bcb4f3b3a9 to your computer and use it in GitHub Desktop.
Save DuqueDeTuring/0d1d98beb3bcb4f3b3a9 to your computer and use it in GitHub Desktop.
Ejemplos en Haskell
-- Generadores y "guardias"
{--
Sea la tupla (x,y) tal que,
x ∈ [1..10] ^ x < 3
y ∈ [11,13] ^ y < 12
--}
[(x,y) | x <- [1..10], y <- [11,13], x<3, y<12]
-- Fibonacci
fib = 1 : 1 : [ a+b | (a,b) <- zip fib (tail fib)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment