Re[2]: [Haskell-cafe] Re: Type-Level Naturals Like Prolog?

2006-07-20 Thread Bulat Ziganshin
Hello Jared, Tuesday, July 18, 2006, 11:12:09 PM, you wrote: % defining natural numbers natural(zero). natural(s(X)) :- natural(X). % translate to integers toInt(zero, 0). toInt(s(X), N) :- toInt(X, Y), N is Y + 1. Thank you. I can now more precisely state that what I'm trying

Re: [Haskell-cafe] Re: Type-Level Naturals Like Prolog?

2006-07-20 Thread Tom Schrijvers
On Tue, 18 Jul 2006, Jared Warren wrote: % defining natural numbers natural(zero). natural(s(X)) :- natural(X). % translate to integers toInt(zero, 0). toInt(s(X), N) :- toInt(X, Y), N is Y + 1. Thank you. I can now more precisely state that what I'm trying to figure out is: what is

Re: [Haskell-cafe] Re: Type-Level Naturals Like Prolog?

2006-07-18 Thread Bulat Ziganshin
Hello Jared, Tuesday, July 18, 2006, 9:05:09 AM, you wrote: % defining natural numbers natural(zero). natural(s(X)) :- natural(X). % translate to integers toInt(zero, 0). toInt(s(X), N) :- toInt(X, Y), N is Y + 1. Thank you. I can now more precisely state that what I'm trying to figure

[Haskell-cafe] Re: Type-Level Naturals Like Prolog?

2006-07-17 Thread Jared Warren
Thank you to everyone for the responses. I guess what I should have clarified is that I know how Peano numbers are *normally* encoded in the type language (I am very familiar with the HList library), but I would like to know why the type language appears to require data structures to do so while

Re: [Haskell-cafe] Re: Type-Level Naturals Like Prolog?

2006-07-17 Thread Donald Bruce Stewart
jawarren: Thank you to everyone for the responses. I guess what I should have clarified is that I know how Peano numbers are *normally* encoded in the type language (I am very familiar with the HList library), but I would like to know why the type language appears to require data structures