Re: [Haskell-cafe] Why is $ right associative instead of leftassociative?

2006-02-05 Thread Jon Fairbairn
On 2006-02-04 at 21:15GMT Brian Hulley wrote: Stefan Holdermans wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Brian wrote: I think the mystery surrounding :: and : might have been that originally people thought type annotations would hardly ever be needed whereas list cons

Re: [Haskell-cafe] Why is $ right associative instead of left associative?

2006-02-05 Thread Tomasz Zielonka
On Sat, Feb 04, 2006 at 07:02:52PM -0500, [EMAIL PROTECTED] wrote: G'day all. Hello! Quoting Tomasz Zielonka [EMAIL PROTECTED]: Probably it was anticipated that right associative version will be more useful. You can use it to create a chain of transformations, similar to a chain of

Re: [Haskell-cafe] Re: Why is $ right associative instead of left associative?

2006-02-05 Thread Tomasz Zielonka
On Sun, Feb 05, 2006 at 02:27:45AM +, Ben Rudiak-Gould wrote: No one has mentioned yet that it's easy to change the associativity of $ within a module in Haskell 98: import Prelude hiding (($)) infixl 0 $ f$x = f x or, for the purists, import Prelude hiding

Re: [Haskell-cafe] Why is $ right associative instead of leftassociative?

2006-02-05 Thread Brian Hulley
Jon Fairbairn wrote: Brian Hulley wrote: snip Not exactly alone; I've felt it was wrong ever since we argued about it for the first version of Haskell. : for typing is closer to common mathematical notation. But it's far too late to change it now. - it's just syntax after all Well I'm

Re: [Haskell-cafe] Why is $ right associative instead of leftassociative?

2006-02-05 Thread Brian Hulley
Tomasz Zielonka wrote: The only problem I see right now is related to change locality. If I have a chain like this: f x y . g x $ z and I want to add some transformation between g and z I have to change one line and insert another f x y . g x . h x y $ z With

Re: [Haskell-cafe] Why is $ right associative instead ofleftassociative?

2006-02-05 Thread John Hughes
Quoting Paul Hudak [EMAIL PROTECTED]: Actually, one of the main reasons that we chose (:) is that that's what Miranda used. So, at the time at least, it was not entirely clear what the de facto universal inter-language standard was. Phil Wadler argued for the ML convention at the time,

Re: [Haskell-cafe] Why is $ right associative instead ofleftassociative?

2006-02-05 Thread Lennart Augustsson
John Hughes wrote: Quoting Paul Hudak [EMAIL PROTECTED]: Actually, one of the main reasons that we chose (:) is that that's what Miranda used. So, at the time at least, it was not entirely clear what the de facto universal inter-language standard was. Phil Wadler argued for the ML

Re: [Haskell-cafe] Why is $ right associative instead ofleftassociative?

2006-02-05 Thread John Hughes
Lennart Augustsson wrote: I now think :: for type signatures was a bad mistake. I don't use lists very much. They are not the right data structure for many things. So : is not as common as :: in my code. I checked a small sample of code, about 2 lines of Haskell. It has about 1000

Re: [Haskell-cafe] Why is $ right associative instead ofleftassociative?

2006-02-05 Thread Lennart Augustsson
John Hughes wrote: What, no list comprehensions?? No. I think the do notation is good enough. I'd disagree--sequencing is special, and lists represent it directly. Don't forget, also, that lists are also much more prevalent in beginners' code--and nice notation for beginners helps get

Re: [Haskell-cafe] Why is $ right associative instead ofleftassociative?

2006-02-05 Thread Tomasz Zielonka
On Sun, Feb 05, 2006 at 10:45:50AM -0500, Lennart Augustsson wrote: I don't really see what's so much better about writing [x1,x2,x3,x4,x5] than x1:x2:x3:x4:x5:[]. When I've explained lists to beginners I've just found it annoying and hard to explain why there are two ways of writing lists.

Re: [Haskell-cafe] Why is $ right associative instead of leftassociative?

2006-02-05 Thread Brian Hulley
Tomasz Zielonka wrote: On Sun, Feb 05, 2006 at 01:14:42PM -, Brian Hulley wrote: How about: f x y . g x $ z then you only need to add the line . h x y But then you have a problem when you when you want to add something at the beginning ;-) With right-assoc $ adding

Re: [Haskell-cafe] Why is $ right associative instead ofleftassociative?

2006-02-05 Thread Paul Hudak
Bulat Ziganshin wrote: LA In my opinion all the special syntactic sugar for lists should go LA away. I don't think lists are special enough to motivate it. i have proposal (not for Haskell', of course) of using : and [] syntax for general notion of traversable collections: Minor point,

Re: [Haskell-cafe] Why is $ right associative instead of leftassociative?

2006-02-05 Thread Tomasz Zielonka
On Sun, Feb 05, 2006 at 04:36:44PM -, Brian Hulley wrote: Just in case you are interested, in the preprocessor I'm writing, I would write these examples as: (.) # f x y g x h x y $ z and a = #[

Re: [Haskell-cafe] Re[2]: strict Haskell dialect

2006-02-05 Thread Brian Hulley
Brian Hulley wrote: Brian Hulley wrote: Robin Green wrote: snip So simply make strictness the default and have laziness annotations (for arguments), instead of making laziness the default and having strictness annotations. Where would you put these laziness annotations? If you put them in

[Haskell-cafe] Re: Why is $ right associative instead of leftassociative?

2006-02-05 Thread Aaron Denney
On 2006-02-05, Brian Hulley [EMAIL PROTECTED] wrote: Jon Fairbairn wrote: Brian Hulley wrote: snip Not exactly alone; I've felt it was wrong ever since we argued about it for the first version of Haskell. : for typing is closer to common mathematical notation. But it's far too late to

Re[2]: [Haskell-cafe] Re[2]: strict Haskell dialect

2006-02-05 Thread Bulat Ziganshin
Hello Brian, Saturday, February 04, 2006, 4:50:44 AM, you wrote: One question is how to get some kind of do notation that would work well in a strict setting. The existing do notation makes use of lazyness in so far as the second arg of is only evaluated when needed. Perhaps a new keyword

Re: [Haskell-cafe] Re[2]: strict Haskell dialect

2006-02-05 Thread Tomasz Zielonka
On Sun, Feb 05, 2006 at 05:18:55PM -, Brian Hulley wrote: I must admit I'm a bit confused as to why the strictness annotations in Haskell (and Clean) are only allowed in data declarations and not function declarations Clean does allow strictness annotations in function types. Best

Re: [Haskell-cafe] Why is $ right associative instead of leftassociative?

2006-02-05 Thread Tomasz Zielonka
On Sun, Feb 05, 2006 at 01:10:24PM -, Brian Hulley wrote: 2) Use , instead of ; in the block syntax so that all brace blocks can be replaced by layout if desired (including record blocks) Wouldn't it be better to use ; instead of , also for record syntax? Best regards Tomasz -- I am

Re: Re[2]: [Haskell-cafe] Re[2]: strict Haskell dialect

2006-02-05 Thread Brian Hulley
Bulat Ziganshin wrote: Hello Brian, Saturday, February 04, 2006, 4:50:44 AM, you wrote: One question is how to get some kind of do notation that would work well in a strict setting. The existing do notation makes use of lazyness in so far as the second arg of is only evaluated when needed.

Re: [Haskell-cafe] Why is $ right associative instead of leftassociative?

2006-02-05 Thread Brian Hulley
Tomasz Zielonka wrote: On Sun, Feb 05, 2006 at 01:10:24PM -, Brian Hulley wrote: 2) Use , instead of ; in the block syntax so that all brace blocks can be replaced by layout if desired (including record blocks) Wouldn't it be better to use ; instead of , also for record syntax? I

[Haskell-cafe] Re: Why is $ right associative instead ofleftassociative?

2006-02-05 Thread Ben Rudiak-Gould
Paul Hudak wrote: Minor point, perhaps, but I should mention that : is not special syntax -- it is a perfectly valid infix constructor. But Haskell 98 does treat it specially: you can't import Prelude hiding ((:)), or rebind it locally, or refer to it as Prelude.:. In fact I've always

[Haskell-cafe] Re: Why is $ right associative instead of leftassociative?

2006-02-05 Thread Ben Rudiak-Gould
Tomasz Zielonka wrote: On Sun, Feb 05, 2006 at 01:14:42PM -, Brian Hulley wrote: How about: f x y . g x $ z But then you have a problem when you when you want to add something at the beginning ;-) How about: id . f x y . g x $ z -- Ben

Re: [Haskell-cafe] Re[2]: strict Haskell dialect

2006-02-05 Thread Brian Hulley
Tomasz Zielonka wrote: On Sun, Feb 05, 2006 at 05:18:55PM -, Brian Hulley wrote: I must admit I'm a bit confused as to why the strictness annotations in Haskell (and Clean) are only allowed in data declarations and not function declarations Clean does allow strictness annotations in

Re: [Haskell-cafe] Re: Why is $ right associative instead of leftassociative?

2006-02-05 Thread Tomasz Zielonka
On Sun, Feb 05, 2006 at 06:58:15PM +, Ben Rudiak-Gould wrote: Tomasz Zielonka wrote: But then you have a problem when you when you want to add something at the beginning ;-) How about: id . f x y . g x $ z Yes, I've thought about it. You are using a neutral element

[Haskell-cafe] Compiling hdirect on windows with COM support

2006-02-05 Thread Marc Weber
On Fri, Feb 03, 2006 at 07:55:30AM +0100, Gracjan Polak wrote: Hi, I would be iterested in seeing what you have done. And maybe helping in getting it to work. I did not find the examples :) Many links seem to be broken on HDirect page. Hi. I have finished. It took some more

Re: [Haskell-cafe] Re: Why is $ right associative insteadofleftassociative?

2006-02-05 Thread Brian Hulley
Ben Rudiak-Gould wrote: Paul Hudak wrote: Minor point, perhaps, but I should mention that : is not special syntax -- it is a perfectly valid infix constructor. snip ... but no more confusing than the fact that [f x | x - xs] is not the same as (map f xs). Can you explain why? On page 258

Re: [Haskell-cafe] Re: Why is $ right associative insteadofleftassociative?

2006-02-05 Thread Chris Kuklewicz
Brian Hulley wrote: Ben Rudiak-Gould wrote: Paul Hudak wrote: Minor point, perhaps, but I should mention that : is not special syntax -- it is a perfectly valid infix constructor. snip ... but no more confusing than the fact that [f x | x - xs] is not the same as (map f xs). Can you

Re: [Haskell-cafe] Why is $ right associative instead of left associative?

2006-02-05 Thread Bill Wood
On Sun, 2006-02-05 at 13:49 +0100, Tomasz Zielonka wrote: . . . and I want to add some transformation between g and z I have to change one line and insert another f x y . g x . h x y $ z With right-associative $ it would be only one line-add. Probably not a very

Re: [Haskell-cafe] Re[2]: strict Haskell dialect

2006-02-05 Thread Jan-Willem Maessen
On Feb 5, 2006, at 2:02 PM, Brian Hulley wrote: ... I wonder if current compilation technology for lazy Haskell (or Clean) has reached the theoretical limits on what is possible for the compiler to optimize away, or if it is just that optimization has not received so much attention as

Re: [Haskell-cafe] Why is $ right associative instead of leftassociative?

2006-02-05 Thread Brian Hulley
Tomasz Zielonka wrote: On Sun, Feb 05, 2006 at 04:36:44PM -, Brian Hulley wrote: Just in case you are interested, in the preprocessor I'm writing, I would write these examples as: (.) # f x y g x h x y $ z and a =

Re: [Haskell-cafe] Re: Why is $ right associative instead ofleftassociative?

2006-02-05 Thread Paul Hudak
Ben Rudiak-Gould wrote: Paul Hudak wrote: Minor point, perhaps, but I should mention that : is not special syntax -- it is a perfectly valid infix constructor. But Haskell 98 does treat it specially: you can't import Prelude hiding ((:)), or rebind it locally, or refer to it as Prelude.:. In

Re: [Haskell-cafe] Re: Why is $ right associative insteadofleftassociative?

2006-02-05 Thread Paul Hudak
Chris Kuklewicz wrote: Brian Hulley wrote: Ben Rudiak-Gould wrote: ... but no more confusing than the fact that [f x | x - xs] is not the same as (map f xs). Can you explain why? On page 258 of Paul Hudak's book The Haskell School of Expression he states that do x- xs; return (f x) is

Re: [Haskell-cafe] Re: Why is $ right associative instead ofleftassociative?

2006-02-05 Thread John Meacham
On Sun, Feb 05, 2006 at 06:50:57PM +, Ben Rudiak-Gould wrote: Paul Hudak wrote: Minor point, perhaps, but I should mention that : is not special syntax -- it is a perfectly valid infix constructor. But Haskell 98 does treat it specially: you can't import Prelude hiding ((:)), or

Re: [Haskell-cafe] Why is $ right associative instead ofleftassociative?

2006-02-05 Thread Cale Gibbard
On 05/02/06, Lennart Augustsson [EMAIL PROTECTED] wrote: John Hughes wrote: What, no list comprehensions?? No. I think the do notation is good enough. I'd disagree--sequencing is special, and lists represent it directly. Don't forget, also, that lists are also much more prevalent in

Re: [Haskell-cafe] Re[2]: strict Haskell dialect

2006-02-05 Thread Cale Gibbard
On 05/02/06, Jan-Willem Maessen [EMAIL PROTECTED] wrote: On Feb 5, 2006, at 2:02 PM, Brian Hulley wrote: ... I wonder if current compilation technology for lazy Haskell (or Clean) has reached the theoretical limits on what is possible for the compiler to optimize away, or if it is just

Re: [Haskell-cafe] Why is $ right associative instead ofleftassociative?

2006-02-05 Thread John Hughes
Cale Gibbard wrote: That said, I'd *really* like to see monad comprehensions come back, since they align better with the view that monads are container types, dual to the view that monads are computations, which is supported by the do-syntax. This view is actually much easier to teach (in my

Re: [Haskell-cafe] Re[2]: strict Haskell dialect

2006-02-05 Thread John Meacham
On Sun, Feb 05, 2006 at 05:18:55PM -, Brian Hulley wrote: I must admit I'm a bit confused as to why the strictness annotations in Haskell (and Clean) are only allowed in data declarations and not function declarations, since it seems a bit random to have to guess which args can be