[Haskell-cafe] alphanum in infix constructors (and possibly functions as well) - why not?

Ozgur Akgun ozgurakgun at gmail.com
Fri Jun 4 08:08:10 EDT 2010


On 4 June 2010 12:33, Ivan Lazar Miljenovic <ivan.miljenovic at gmail.com>wrote:

> Ozgur Akgun <ozgurakgun at gmail.com> writes:
> [...]
> >
> > What stops us from allowing alphanum characters appear in the Infix
> version
> > (after the colon)? Can't it be relaxed to only start woth a colon?
>
> The definition.  I believe this is probably to make parsing of
> "foo:<bar" (using your example below) unambiguous, the same as how
> symbolic operators can't contain alphanumeric characters, etc.
>
>
I see.
Then people would need to put spaces between those things, right?
What a horrible consequence!


> >
> > So I want to be able to say something like:
> >
> > data Expr = Expr :<   Expr          -- checks for LT betwen two Expr's
> >           | Expr :<2  Expr          -- a different implementation of the
> > same thing maybe
> >           | Expr :<veryfast Expr    -- and the veryfast implementation
> > of it
>
> How does a data structure have a faster implementation? >_>
>


Well it might indicate to use a different function while evaluating the
expression.
Still not a good example, I know.

Best,
Ozgur
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100604/1f2831ff/attachment.html


More information about the Haskell-Cafe mailing list