In the thread Literate scripts not handled correctly Simon Marlow
said:
Yes, it looks like GHC's unlit program removes whitespace when
looking for \begin{code}, but not for \end{code}. The report isn't
explicit about whether whitespace is allowed on these lines, but I
would tend
About the GCD operator, the Haskell Report currently says:
gcd x y is the greatest integer that divides both x and y.
lcm x y is the smallest positive integer that both x and y divide.
Why does 'lcm' say 'positive' while 'gcd' does not? What is
gcd -3 -6
Presumably 3, not -3. You
Simon == Simon Peyton-Jones [EMAIL PROTECTED] writes:
Simon gcd x y is the greatest POSITIVE integer that divides
Simon both x and y.
Simon I don't think that changes the specification in fact, but
Simon experience has led me to always check these things!
I find it
Folks,
Iavor has made two excellent points, upon which I have been
ruminating (and consulting). Consider
module Foo( M.Ix( index ) ) where
import qualified Ix as M( Ix )
import qualified Ix as T( index )
instance M.Ix MyType where
index a =
Does anyone know of a mirror site where I can download the latest
version of HaXml. (Connection to York is - and has been for a
while - apparently down: ftp://ftp.cs.york.ac.uk/pub/haskell/HaXml/HaXml-1.02.tar.gz,
that is)
Many thanks
d.
--
David Smallwood
Dept. of Computing
On Tue, Dec 11, 2001 at 11:06:28AM +0100, Ch. A. Herrmann wrote:
Simon == Simon Peyton-Jones [EMAIL PROTECTED] writes:
Simongcd x y is the greatest POSITIVE integer that divides
Simon both x and y.
Simon I don't think that changes the specification in fact, but
Simon
The natural reading of 'greatest' is, of course,
the greatest in the divisibility preorder (it's partial order
on natural numbers but only a preorder on integers).
Thus, gcd 0 0 = 0.
3 and -3 are equivalent in that preoder.
Thus, an additional comment may be in order.
Stefan
Simongcd x y is the greatest POSITIVE integer that divides
Simon both x and y.
I find it confusing to read a definition which contains redundant
information. Instead, I'd suggest to add something like:
Note: this number is always positive
Or, perhaps easier on the eye,
| 1. subordinate names in export lists are always
| unqualified Thus,
| we can have M.Ix( index ), but not M.Ix( T.index ).
|
| I don't see a compelling reason to outlaw the latter. We can
| permit the subordinate name to be unqualified, but why should
| we enforce it? Ditto for method
People write about the Report definition of
gcd x y
as of greatest integer that divides x and y,
and mention
gcd 0 0 = 0
But 2 also divides 0, because 2*0 = 0.
Does the Report specify that gcd 0 0 is not defined?
For an occasion:
I don't think preorders of any kind should be involved here.
Just the ordinary order on integers. No divisibility preorder (I'm not
sure how that is even defined, so how it could be natural beats me), no
absolute value.
I find the unaltered text Simon quoted to be fine as is.
But for those who
S.D.Mechveliani wrote
Does the Report specify that gcd 0 0 is not defined?
Yes. The Report definition says
gcd :: (Integral a) = a - a - a
gcd 0 0 = error Prelude.gcd: gcd 0 0 is undefined
gcd x y = gcd'
From: George Russell [EMAIL PROTECTED]
Date: Tue, 11 Dec 2001 18:18:31 +0100
...
Yes. The Report definition says
gcd :: (Integral a) = a - a - a
gcd 0 0 = error Prelude.gcd: gcd 0 0 is undefined
gcd x y = gcd' (abs x) (abs y)
I'm afraid it doesn't seem to be quite right yet :-(
Consider
instance Foo Maybe where
foo = 5
=
{4}instance Foo Maybe where
{4}foo = 5
=
{instance Foo Maybe where
{}}foo = 5
The second {4} has meant there is no 4 to cause an implicit semicolon
to be inserted.
David Smallwood [EMAIL PROTECTED] writes:
Does anyone know of a mirror site where I can download the latest
version of HaXml. (Connection to York is - and has been for a
while - apparently down:
ftp://ftp.cs.york.ac.uk/pub/haskell/HaXml/HaXml-1.02.tar.gz, that is)
The above url seemed to
The following might be of special interest to people who are
using Paul Hudak's Haskell textbook for teaching and or
study and would like to run the SOE graphics examples with
GHC - or if you simply want to have an X-based graphics
library for an application.
GHC's source distribution contains
Hiyas
With the module
{
main = undefined
foo = 5
}
and with the module
module Foo where {
foo = 5
bar = 6
}
I get
tt.hs:4: parse error on input `='
Thanks
Ian
___
Glasgow-haskell-bugs mailing list
quite right too. The explicit { suppress the implicit layout.
Simon
| -Original Message-
| From: Ian Lynagh [mailto:[EMAIL PROTECTED]]
| Sent: 11 December 2001 13:20
| To: [EMAIL PROTECTED]
| Subject: Incorrect parse errors
|
|
|
| Hiyas
|
|
| With the module
|
| {
|
On Tue, Dec 11, 2001 at 06:10:11AM -0800, Simon Peyton-Jones wrote:
quite right too. The explicit { suppress the implicit layout.
Yes, sorry, my bad.
IAn
___
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
The following might be of special interest to people who are
using Paul Hudak's Haskell textbook for teaching and or
study and would like to run the SOE graphics examples with
GHC - or if you simply want to have an X-based graphics
library for an application.
GHC's source distribution contains
20 matches
Mail list logo