Re: [Haskell-cafe] 'data' syntax - a suggestion

2007-09-28 Thread Bas van Dijk
On 9/28/07, ok [EMAIL PROTECTED] wrote: Now there's a paper that was mentioned about a month ago in this mailing list which basically dealt with that by splitting each type into two: roughly speaking a bit that expresses the recursion and a bit that expresses the choice structure. Would you

Re: [Haskell-cafe] 'data' syntax - a suggestion

2007-09-27 Thread Thomas Conway
On 9/27/07, ok [EMAIL PROTECTED] wrote: I have often found myself wishing for a small extension to the syntax of Haskell 'data' declarations. It goes like this: ['where' clause to allow locally defined names in type declarations] Nice. Quite a few times I've found myself declaring type

Re: [Haskell-cafe] 'data' syntax - a suggestion

2007-09-27 Thread jerzy . karczmarczuk
Thomas Conway writes: On 9/27/07, ok [EMAIL PROTECTED] wrote: I have often found myself wishing for a small extension to the syntax of Haskell 'data' declarations. It goes like this: ['where' clause to allow locally defined names in type declarations] Nice. Quite a few times I've

Re: [Haskell-cafe] 'data' syntax - a suggestion

2007-09-27 Thread Tomasz Zielonka
On 9/27/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thomas Conway writes: On 9/27/07, ok [EMAIL PROTECTED] wrote: I have often found myself wishing for a small extension to the syntax of Haskell 'data' declarations. It goes like this: ['where' clause to allow locally defined

Re: [Haskell-cafe] 'data' syntax - a suggestion

2007-09-27 Thread Isaac Dupree
Tomasz Zielonka wrote: On 9/27/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thomas Conway writes: On 9/27/07, ok [EMAIL PROTECTED] wrote: I have often found myself wishing for a small extension to the syntax of Haskell 'data' declarations. It goes like this: ['where' clause to allow

Re: [Haskell-cafe] 'data' syntax - a suggestion

2007-09-27 Thread Albert Y. C. Lai
[EMAIL PROTECTED] wrote: Data with where? You haven't heard about GADTs? To avoid clashing with GADT's where, I propose to rename ok's keyword to wherein, or wheretype, or something data B k v = E | F b b wherein type b = B k v data B k v = E | F b b wheretype b = B k v (I also propose

Re: [Haskell-cafe] 'data' syntax - a suggestion

2007-09-27 Thread David Menendez
On 9/27/07, Albert Y. C. Lai [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Data with where? You haven't heard about GADTs? To avoid clashing with GADT's where, I propose to rename ok's keyword to wherein, or wheretype, or something data B k v = E | F b b wherein type b = B k v

Re: [Haskell-cafe] 'data' syntax - a suggestion

2007-09-27 Thread Dan Weston
Thomas Conway wrote: Although Richard's proposal was simpler, I reckon it's worth discussing whether the where clause should allow normal type/data/newtype declarations, effectively introducing a new scope. There are obviously some type variable quantification and name resolution issues that

Re: [Haskell-cafe] 'data' syntax - a suggestion

2007-09-27 Thread Thomas Conway
On 9/28/07, David Menendez [EMAIL PROTECTED] wrote: I'm not sure there is a clash. data B k v where ... is easily distinguished from data B k v = ... where ... Indeed. Although Richard's proposal was simpler, I reckon it's worth discussing whether the where clause should allow normal

Re: [Haskell-cafe] 'data' syntax - a suggestion

2007-09-27 Thread ok
On 28 Sep 2007, at 10:01 am, Thomas Conway wrote: data Tree key val = Leaf key val | Node BST key val BST where type BST = Tree key val data RelaxedTree key val = Leaf Bal [(key,val)] | Node Bal [(key,RelaxedTree key val)] where data Bal = Balanced | Unbalanced