Skip to content

Instantly share code, notes, and snippets.

@clementi
Created March 8, 2019 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clementi/60b0ee4dec4753df4bd1f70217b3c0e8 to your computer and use it in GitHub Desktop.
Save clementi/60b0ee4dec4753df4bd1f70217b3c0e8 to your computer and use it in GitHub Desktop.
Idris stuff
rev : List a -> List a
rev xs = revAcc [] xs where
revAcc : List a -> List a -> List a
revAcc acc [] = acc
revAcc acc (x :: xs) = revAcc (x :: acc) xs
even : Nat -> Bool
even Z = True
even (S k) = odd k where
odd Z = False
odd (S k) = even k
odd : Nat -> Bool
odd = not . even
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment