Re: [Haskell-cafe] Basic question concerning data constructors

2008-01-03 Thread Yitzchak Gale
Hi Benja, I wrote: >> By the type expression Integer -> Integer >> we mean all Haskell functions mapping Integers to Integers. >> There are only countably many of those. > ... >> But that was not the context in this thread. The category >> Hask that we often mention in discussions about Haskell >>

Re: [Haskell-cafe] Basic question concerning data constructors

2008-01-02 Thread Benja Fallenstein
Hi Yitz, On Jan 2, 2008 10:34 AM, Yitzchak Gale <[EMAIL PROTECTED]> wrote: > No, only countably many. By the type expression Integer -> Integer > we mean all Haskell functions mapping Integers to Integers. > There are only countably many of those. ... > But that was not the context in this thread.

Re: [Haskell-cafe] Basic question concerning data constructors

2008-01-02 Thread ajb
G'day all. Quoting Yitzchak Gale <[EMAIL PROTECTED]>: Data types consist only of computable elements. Since there are only countably many computable functions, every data type has at most countably many elements. In particular, it is a set. I still say it "isn't a set" in the same way that a

Re: [Haskell-cafe] Basic question concerning data constructors

2008-01-02 Thread Yitzchak Gale
I wrote: >> The classical definition of "general recursive function" >> refers to functions in Integer -> Integer to begin >> with, so there can only be countably many values by >> construction. Luke Palmer wrote: > Except that there are uncountably many (2^Aleph_0) functions in > Integer -> Integ

Re: [Haskell-cafe] Basic question concerning data constructors

2008-01-01 Thread Luke Palmer
On Jan 1, 2008 3:43 PM, Yitzchak Gale <[EMAIL PROTECTED]> wrote: > The classical definition of "general recursive function" > refers to functions in Integer -> Integer to begin > with, so there can only be countably many values by > construction. Except that there are uncountably many (2^Aleph_0)

Re: [Haskell-cafe] Basic question concerning data constructors

2008-01-01 Thread Yitzchak Gale
Andrew Bromage wrote: >> [*] Theoretical nit: It's not technically a "set". >> >> Consider the data type: >> >> data Foo = Foo (Foo -> Bool) >> >> This declaration states that there's a bijection between the elements of >> Foo and the elements of 2^Foo, which by Cantor's diagonal theorem canno

Re: [Haskell-cafe] Basic question concerning data constructors

2008-01-01 Thread Yitzchak Gale
Andrew Bromage wrote: > [*] Theoretical nit: It's not technically a "set". > > Consider the data type: > > data Foo = Foo (Foo -> Bool) > > This declaration states that there's a bijection between the elements of > Foo and the elements of 2^Foo, which by Cantor's diagonal theorem cannot > be t

Re: [Haskell-cafe] Basic question concerning data constructors

2008-01-01 Thread Benja Fallenstein
On Dec 31, 2007 7:17 AM, <[EMAIL PROTECTED]> wrote: > This declaration states that there's a bijection between the elements of > Foo and the elements of 2^Foo, which by Cantor's diagonal theorem cannot > be true for any set. That's because we only allow computable functions, Nit the nit: Or (mor

Re: [Haskell-cafe] Basic question concerning data constructors

2007-12-30 Thread ajb
G'day all. Quoting David Menendez <[EMAIL PROTECTED]>: data A = B means that "B" constructs a value of type "A". The "=" acts more like the "::=" in a BNF grammar. And, indeed, that was the syntax for it in Miranda. It is *not* a claim that A equals B, since A is a type and B is a data

Re: [Haskell-cafe] Basic question concerning data constructors

2007-12-30 Thread David Menendez
On Dec 30, 2007 9:24 AM, Joost Behrends <[EMAIL PROTECTED]> wrote: > A similar point: The tutorials teach, that "=" has a similar meaning than > "=" in > mathematics. But there is a big difference: it is not reflexive. The > the right side is the definition of the left. Thus "x=y" has still some >

Re: [Haskell-cafe] Basic question concerning data constructors

2007-12-30 Thread Jake McArthur
On Dec 30, 2007, at 8:24 AM, Joost Behrends wrote: For adapting hws (one of the reasons for me to be here, not many languages have a native web server) to Windows i must work on time. In System.Time i found data ClockTime = TOD Integer Integer 2 questions arise here: Does this define "TOD"

Re: [Haskell-cafe] Basic question concerning data constructors

2007-12-30 Thread Bulat Ziganshin
Hello Joost, Sunday, December 30, 2007, 5:24:59 PM, you wrote: > data ClockTime = TOD Integer Integer it declares type with name ClockTime (which you may use on type signatures, other type declarations and so on) with one constructor TOD accepting two Integer values. the only way to construct va

[Haskell-cafe] Basic question concerning data constructors

2007-12-30 Thread Joost Behrends
Hello, perhaps i will make a wishlist of topics not dealt in the tutorials. Here is something i miss in each of them: notes at the semantics of data constructors. We read data Pair a b = Pair a b in YetAnotherHaskellTutorial. And that is all ! If we omit "data" here, this would be a silly pl