Idris: function works with Nat parameter and fails type checking with Integer parameter
问题 I am new to Idris. I am experimenting with types and my task is to make an "onion": a function that takes two arguments: a number and whatever and puts whatever into List nested such number of times. For example, the result for mkOnion 3 "Hello World" should be [[["Hello World"]]] . I've made such a function, this is my code: onionListType : Nat -> Type -> Type onionListType Z b = b onionListType (S a) b = onionListType a (List b) mkOnionList : (x : Nat) -> y -> onionListType x y mkOnionList