Skip to content

Instantly share code, notes, and snippets.

@jsoffer
Created January 27, 2011 14:28
Show Gist options
  • Save jsoffer/798568 to your computer and use it in GitHub Desktop.
Save jsoffer/798568 to your computer and use it in GitHub Desktop.
-- Como recurrencias, operando sobre listas infinitas paralelas
-- con función x1 + x3
t1 = True : False : False : True : zipWith (/=) (drop 1 t1) (drop 3 t1)
-- x1 + x2 + x3
t2 = True : False : False : True : zipWith3 g (drop 1 t2) (drop 2 t2) (drop 3 t2) where
g a b c = (a /= b) /= c
leer n xs = take n $ map (\k -> if k then '1' else 0') xs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment