Skip to content

Instantly share code, notes, and snippets.

@raichoo
Created April 13, 2014 10:53
Show Gist options
  • Save raichoo/10578943 to your computer and use it in GitHub Desktop.
Save raichoo/10578943 to your computer and use it in GitHub Desktop.
%default total
cyclicAdd : Fin 4 -> Fin 4 -> Fin 4
cyclicAdd x y = head $ drop (finToNat x + finToNat y) fins
where
fins : Stream (Fin 4)
fins = 0 :: 1 :: 2 :: 3 :: fins
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment