[Haskell-cafe] Re: Field names
Jonathan Cast
jonathanccast at fastmail.fm
Wed Sep 10 23:31:42 EDT 2008
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 `Operator symbols'. (...)
>
> Here it is:
>
> “Operator symbols are formed from one or more
> symbol characters, as defined above, and are
> lexically distinguished into two namespaces
> (Section 1.4):
>
> * An operator symbol starting with a colon is
> a constructor.(...)”
>
> Cool! What is the syntax for using that in 'data'?
> Is it something like “data X = Y | Int :°& Double”?
Right. So then
(:°&) :: Int -> Double -> X
jcc
More information about the Haskell-Cafe
mailing list