Re: [q-lang-users] New stuff in cvs: multichar ops, views
Brought to you by:
agraef
From: Albert G. <Dr....@t-...> - 2007-06-27 16:00:46
|
Sorry for chiming in so late, I'm still trying to catch up on my email. Rob Hubbard wrote: > Upon a little further thought, I would want only (+:) to be available > for pattern matching. If the presence of a (-:) operator would upset > the pattern matching, then I'd withdraw the suggestion in any case... Unfortunately, with the current Wadler view system, you can't define alternative views like that. I.e., if you define a view which returns X+:Y and X-:Y for the two half-planes, then you'll also have to write rules matching against both. That's why I didn't include '-:' in the first place, in fact I had the same idea a while back. ;-) For more elaborate kinds of views, so-called value input would be needed which would allow you to pick a certain variation of a view in the lhs pattern. One such proposal can be found on the Haskell site. Also, a while back LtU mentioned an ICFP07 submission from the Microsoft FP team, which also discusses a generalized view mechanism (for F#, IIRC). I still have to take a closer look at that. I know that some of you guys are on this list, maybe you could comment on that? :) Considering the precedence of '+:' a.k.a. ':+', I can see that it would be convenient to have a higher priority for some uses, but wouldn't that confuse Haskell programmers where ':+' has the same precedence as '+'? After all the current representation was meant to be more or less compatible with Haskell. Cheers, Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |