Quoting Ralf Hemmecke [EMAIL PROTECTED]:
All the exports that appear are basically the
exports of the Union (OK, Union still has a few more.)
---BEGIN aaa.as
#include aldor
#include aldorio
define ET: Category == with; -- ExpressionType
Expr: ET with {
MkInt: Integer - %;
It
Bill Page [EMAIL PROTECTED] writes:
| Quoting Ralf Hemmecke [EMAIL PROTECTED]:
|
|
| All the exports that appear are basically the
| exports of the Union (OK, Union still has a few more.)
|
| ---BEGIN aaa.as
| #include aldor
| #include aldorio
|
| define ET: Category == with; --
Bill Page [EMAIL PROTECTED] writes:
[...]
| in Haskell, by a kind of convenient abuse of notation
| (or polymorphism if you wish) 'MkInt' also denotes a
| function
|
|MkInt: Int - MkInt Int
Bill --
you're highly confused.
On 05/09/2007 10:02 AM, Bill Page wrote:
No, I think there is a serious misunderstanding here. What
Gaby is talking about are algebraic data types. See for
example:
http://en.wikipedia.org/wiki/Algebraic_data_type
In Gaby's example Haskell code:
data Expr = MkInt Int
| MkAdd
Quoting Ralf Hemmecke [EMAIL PROTECTED]:
On 05/09/2007 10:02 AM, Bill Page wrote:
...
MkInt is *not* a function which when given an Integer
returns something of type Expr. It is type *constructor*,
that is, when given 'Int' MkInt returns a subtype of Expr.
Before you criticize... I
Dear Bill,
I only have a comment on the following.
I agree that it's a source of confusion. But I must admit that
I would have written
MkInt: Int - Expr
instead. Otherwise there would be a type mismatch in
eval (MkInt i) = i
since MkInt(Int) is not equal to Expr. Don't you agree?
On Wed, 9 May 2007, Ralf Hemmecke wrote:
| And I cannot say whether MkInt is a type constructor in Haskell, since I don't
| know the language very well.
MkInt is NOT a type constructor in Haskell; Bill was very confused.
MkInt is a *data* constructor, and your understanding is correct.
-- Gaby
On Wed, 9 May 2007, Bill Page wrote:
[...]
| ... in Haskell, by a kind of convenient abuse of notation
| (or polymorphism if you wish) 'MkInt' also denotes a
| function
|
| MkInt: Int - MkInt Int
|
| that creates an object of type 'MkInt Int' from an object
| in 'Int'. I think
Quoting Ralf Hemmecke [EMAIL PROTECTED]:
Dear Bill,
I only have a comment on the following.
I agree that it's a source of confusion. But I must admit that
I would have written
MkInt: Int - Expr
instead. Otherwise there would be a type mismatch in
eval (MkInt i) = i
since
Quoting Gabriel Dos Reis [EMAIL PROTECTED]:
On Wed, 9 May 2007, Bill Page wrote:
[...]
| ... in Haskell, by a kind of convenient abuse of notation
| (or polymorphism if you wish) 'MkInt' also denotes a
| function
|
| MkInt: Int - MkInt Int
|
| that creates an object of type
Well, I did not interepret it as a slur against Haskell. However, it did
appear to me to be fundamentally incorrect to miss the core ideas of
algebraic data typea and how they lead to GADT:
data Expr where
MkInt:: Integer - Expr
MkAdd:: Expr - Expr - Expr
MkMul:: Expr -
Bill Page [EMAIL PROTECTED] writes:
| Quoting Gabriel Dos Reis [EMAIL PROTECTED]:
|
| On Wed, 9 May 2007, Bill Page wrote:
|
| [...]
|
| | ... in Haskell, by a kind of convenient abuse of notation
| | (or polymorphism if you wish) 'MkInt' also denotes a
| | function
| |
| |
On Wed, 9 May 2007, Ralf Hemmecke wrote:
| Well, I did not interepret it as a slur against Haskell. However, it did
| appear to me to be fundamentally incorrect to miss the core ideas of
| algebraic data typea and how they lead to GADT:
| data Expr where
|MkInt:: Integer - Expr
13 matches
Mail list logo