> And now for a little quiz. What's the value of the following (legal)
> Haskell expression? (Don't try it with hbc, it fails.)
>
> let (+) + 1 + 1 = (+)
> in 1 + 1
>
> This is illegal syntax!! (+) and (the second) + are the same
> variable, thus violating the linearity
> | Another strange thing about n+k patterns.
> |
> | Its definition uses >= , but >= is not part of the class Num.
> | Does that mean that n+k patterns have to be instances of class Real?
>
> Certainly. In fact, they're really meant to apply only to class
> Integral (and it would be
Another strange thing about n+k patterns.
Its definition uses >= , but >= is not part of the class Num.
Does that mean that n+k patterns have to be instances of class Real?
One could leave it class Num, if the translation were expressed
in terms of "signum" rather than ">=".
Question:
Can one
> And now for a little quiz. What's the value of the following (legal)
> Haskell expression? (Don't try it with hbc, it fails.)
>
> let (+) + 1 + 1 = (+)
> in 1 + 1
Given infixl 6 + (since you can't change this without renaming!):
(+) + 1 + 1
==> lpat6 + pat7
And now for a little quiz. What's the value of the following (legal)
Haskell expression? (Don't try it with hbc, it fails.)
let (+) + 1 + 1 = (+)
in 1 + 1
This is illegal syntax!! (+) and (the second) + are the same
variable, thus violating the linearity constraint for l
| > | Another strange thing about n+k patterns.
| > |
| > | Its definition uses >= , but >= is not part of the class Num.
| > | Does that mean that n+k patterns have to be instances of class Real?
| >
| > Certainly. In fact, they're really meant to apply only to class
| > Integral (a
>From: Lennart Augustsson <[EMAIL PROTECTED]>
>...
>And now for a little quiz. What's the value of the following (legal)
>Haskell expression? (Don't try it with hbc, it fails.)
>
>let (+) + 1 + 1 = (+)
>in 1 + 1
>
>-- Lennart
>
Gofer Version 2.28a Copyright (c) Mark P Jone
I agree with everything Paul says, about translations, and about
Norman's point.
I'll record them in my things-to-improve-in-the-next-iteration-of
the-Report file...
Incidentally, I also do not like n+k patterns, but they don't
seem to be a big issue to me, either from a semantic or implementa
| Another strange thing about n+k patterns.
|
| Its definition uses >= , but >= is not part of the class Num.
| Does that mean that n+k patterns have to be instances of class Real?
Certainly. In fact, they're really meant to apply only to class
Integral (and it would be natural numbers, if we h
Speaking of n+k patterns, did anyone ever answer this question?
> Date: Wed, 14 Apr 1993 11:24:54 +
> From: [EMAIL PROTECTED]
> Subject: Successor patterns in bindings
> To: Multiple recipients of list HASKLD-L <[EMAIL PROTECTED]>
>
> I'm puzzled by a bit of the Haskell 1.2 repo
10 matches
Mail list logo