Issue727.agda 364 B

12345678910111213141516
  1. -- {-# OPTIONS -v tc.lhs.problem:10 #-}
  2. -- {-# OPTIONS --compile --ghc-flag=-i.. #-}
  3. module Issue727 where
  4. open import Common.Prelude renaming (Nat to ℕ)
  5. Sum : ℕ → Set
  6. Sum 0 = ℕ
  7. Sum (suc n) = ℕ → Sum n
  8. sum : (n : ℕ) → ℕ → Sum n
  9. sum 0 acc = acc
  10. sum (suc n) acc m = sum n (m + acc)
  11. main = putStrLn (natToString (sum 3 0 1 2 3))