Mutual.agda 341 B

12345678910111213141516171819202122
  1. -- examples for termination checking mutual recursion
  2. module Mutual where
  3. data Odd : Set
  4. data Even : Set where
  5. zeroE : Even
  6. succE : Odd -> Even
  7. data Odd where
  8. succO : Even -> Odd
  9. addEO : Even -> Odd -> Odd
  10. addOO : Odd -> Odd -> Even
  11. addOO (succO x) y = succE (addEO x y)
  12. addEO zeroE y = y
  13. addEO (succE x) y = succO (addOO x y)