Re: help from the community?

2007-01-31 Thread Conor McBride
Hi Ashley Yakeley wrote: Taral wrote: > I see nothing wrong with "case x of {}", with required braces. The > layout rule never generates empty braces. Also consider a simple "case x", [..] This will be useful for GADTs: data MyGADT a where IntGADT :: MyGADT Int never :: MyGADT Ch

Alleged problems with equational reasoning caused by views

2007-01-31 Thread Arie Peterson
J. Garrett Morris wrote (to Bulat Ziganshin): > Yes - you've reiterated Wadler's original design, with an automatic > creation of a type class. Erwig and Peyton-Jones, _Pattern Guards and > Transformational Patterns_ > (http://research.microsoft.com/~simonpj/Papers/pat.htm) mentions > problems wi

Re: help from the community?

2007-01-31 Thread Ashley Yakeley
Taral wrote: > I see nothing wrong with "case x of {}", with required braces. The > layout rule never generates empty braces. Also consider a simple "case x", following the already allowed omission of "where" in class and instance decls. class (This a,That a) => ThisThat a instance (This

Re: Re[2]: ADT views Re: [Haskell] Views in Haskell

2007-01-31 Thread J. Garrett Morris
On 1/31/07, Bulat Ziganshin <[EMAIL PROTECTED]> wrote: i hope that now my idea is clear Yes - you've reiterated Wadler's original design, with an automatic creation of a type class. Erwig and Peyton-Jones, _Pattern Guards and Transformational Patterns_ (http://research.microsoft.com/~simonpj/

Re: help from the community?

2007-01-31 Thread Taral
On 1/31/07, Conor McBride <[EMAIL PROTECTED]> wrote: So, as far as Haskell' is concerned, I'd favour forbidding non-empty cases, but only because I favour having some more explicit syntax for empty cases, further down the line. I see nothing wrong with "case x of {}", with required braces. The

Re[2]: ADT views Re: [Haskell] Views in Haskell

2007-01-31 Thread Bulat Ziganshin
Hello David, Wednesday, January 31, 2007, 7:12:05 PM, you wrote: >> data Coord = Coord Float Float >> view of Coord = Polar Float Float where >> Polar r d= Coord (r*d) (r+d)-- construction >> Coord x y | x/=0 || y/=0 = Polar (x*y) (x+y)-- matching > This i

Re: ADT views Re: [Haskell] Views in Haskell

2007-01-31 Thread David Roundy
On Wed, Jan 31, 2007 at 05:53:08PM +0300, Bulat Ziganshin wrote: > something like this: > > data Coord = Coord Float Float > view of Coord = Polar Float Float where > Polar r d= Coord (r*d) (r+d)-- construction > Coord x y | x/=0 || y/=0 = Polar (x*y) (x+y)-

ADT views Re: [Haskell] Views in Haskell

2007-01-31 Thread Bulat Ziganshin
Hello Simon, Monday, January 22, 2007, 5:57:27 PM, you wrote: > adding "view patterns" to Haskell. many of us was attracted to Haskell because it has clear and simple syntax. but many Hugs/GHC extensions done by independent developers differ in the syntax they used, because these developers eith

Re[2]: [Haskell] Views in Haskell

2007-01-31 Thread Bulat Ziganshin
Hello Rene, Wednesday, January 24, 2007, 10:49:06 PM, you wrote: > Going by the traffic over the previous months, I think that class aliases or > extensible records would be higher on most peoples lists than views. i think that proper views is a must for Haskell - "We are keen on abstraction, bu

Re: help from the community?

2007-01-31 Thread Conor McBride
Hi Andres Loeh wrote: I think it's important to keep some possibility for the compiler to detect probable errors as syntax errors. If all syntax is inhabited by strange defaults then this just means simple errors will go undetected eg: let a = case foo of Here, the user has probably got

Re: help from the community?

2007-01-31 Thread Andres Loeh
> >>Just a little remark on the side: 'If' and 'case' demand exactly one > >>expression. In such cases allowing zero expressions is not a > >>generalization but an unnecessary complication. 'Let' and 'where' > >>allow any number of bindings, so allowing zero bindings (instead of > >>demanding at le