Skip to content

Instantly share code, notes, and snippets.

@Sgeo
Created February 5, 2013 20:52
Show Gist options
  • Save Sgeo/4717537 to your computer and use it in GitHub Desktop.
Save Sgeo/4717537 to your computer and use it in GitHub Desktop.
Haskell code to emulate in Scala and Clojure. Idea for the functions taken from http://www.scala-lang.org/api/current/index.html#scala.util.control.TailCalls$
listEven :: [a] -> Bool
listEven [] = True
listEven (_:xs) = listOdd xs
listOdd :: [a] -> Bool
listOdd [] = False
listOdd (_:xs) = listEven xs
@Sgeo
Copy link
Author

Sgeo commented Feb 5, 2013

Confirmed working with http://ideone.com/3AKuvK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment