Re: [Haskell-cafe] Re: Field names

2008-09-10 Thread Jonathan Cast
On Wed, 2008-09-10 at 21:32 -0300, Mauricio wrote: > Do you have any reference for that use of infixing > constructors by start their name with ':'? > (...) > > > (...) for data constructors, go to > > > > http://haskell.org/onlinereport/lexemes.html > > > > and search for `O

Re: [Haskell-cafe] Re: Field names

2008-09-10 Thread Richard A. O'Keefe
On 11 Sep 2008, at 3:54 am, Brandon S. Allbery KF8NH wrote: I think that only counts as the origin of the idea; isn't :-prefixed infix constructors a ghc-ism? Haskell 98 report, page 10: "An operator symbol starting with a colon is a constructor". (I seem to have four copies of the report on

[Haskell-cafe] Re: Field names

2008-09-10 Thread Mauricio
Do you have any reference for that use of infixing constructors by start their name with ':'? (...) > (...) for data constructors, go to > > http://haskell.org/onlinereport/lexemes.html > > and search for `Operator symbols'. (...) Here it is: “Operator symbols are formed from o

Re: [Haskell-cafe] Re: Field names

2008-09-10 Thread Jonathan Cast
On Wed, 2008-09-10 at 11:54 -0400, Brandon S. Allbery KF8NH wrote: > On 2008 Sep 10, at 8:53, Bulat Ziganshin wrote: > > Wednesday, September 10, 2008, 4:07:41 PM, you wrote: > >> Do you have any reference for that use of infixing > >> constructors by start their name with ':'? That's > >> interest

Re: [Haskell-cafe] Re: Field names

2008-09-10 Thread Brandon S. Allbery KF8NH
On 2008 Sep 10, at 8:53, Bulat Ziganshin wrote: Wednesday, September 10, 2008, 4:07:41 PM, you wrote: Do you have any reference for that use of infixing constructors by start their name with ':'? That's interesting, and I didn't know about it. really? ;) sum (x:xs) = x + sum xs sum [] = 0

Re: [Haskell-cafe] Re: Field names

2008-09-10 Thread Bulat Ziganshin
Hello Mauricio, Wednesday, September 10, 2008, 4:07:41 PM, you wrote: > Do you have any reference for that use of infixing > constructors by start their name with ':'? That's > interesting, and I didn't know about it. really? ;) sum (x:xs) = x + sum xs sum [] = 0 -- Best regards, Bulat

[Haskell-cafe] Re: Field names

2008-09-10 Thread Mauricio
(...) * Since a data constructor can be an infix operator (either spelled with backticks or a symbolic name beginning with ':' ) we can also write our patterns with infix notation. (...) (Slightly off-topic?) Do you have any reference for that use of infixing constructors by start their na

Re: [Haskell-cafe] Re: Field names

2008-09-09 Thread wren ng thornton
Justin Bailey wrote: 2008/9/8 Daryoush Mehrtash <[EMAIL PROTECTED]> > Thanks. > > Pattern matching and memory management in Haskell (or may be GHC > implementation of it) is somewhat of a mystery to me. Are there > any references that explains the underlying implementation? Be careful what you

Re: [Haskell-cafe] Re: Field names

2008-09-09 Thread Justin Bailey
2008/9/8 Daryoush Mehrtash <[EMAIL PROTECTED]> > > Thanks. > > Pattern matching and memory management in Haskell (or may be GHC > implementation of it) is somewhat of a mystery to me. Are there any > references that explains the underlying implementation? > > Daryoush Be careful what you ask fo

Re: [Haskell-cafe] Re: Field names

2008-09-08 Thread Daryoush Mehrtash
Thanks. Pattern matching and memory management in Haskell (or may be GHC implementation of it) is somewhat of a mystery to me. Are there any references that explains the underlying implementation? Daryoush On Mon, Sep 8, 2008 at 6:37 PM, Mauricio <[EMAIL PROTECTED]> wrote: > > abs (Pt {poi

[Haskell-cafe] Re: Field names

2008-09-08 Thread Mauricio
abs (Pt {pointx = x, pointy = y}) = sqrt (x*x + y+y) Why is it pointx=x and not x=pointx? Your intuition is probably telling you that this is something like: abs (point) = sqrt (x*x+y*y) where {x=pointx point ; y=pointy point} Actually, it's an example of pattern matching: abs (Pt