On Thu, 10 Jan 2008 19:38:07 +0200, Tillmann Rendel
[EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote:
Although it could be argued that laziness is the cause of some very
obscure bugs... g Niko
Example, PLEASE.
Prelude sum [1..100]
*** Exception: stack overflow
Not true in Hugs.
The IETF (http://www.ietf.org/) holds a meeting of its Application
Area and is looking for papers.
In a position paper, Joe Gregorio asked for information about the
theory of templating languages. Giving the interest here in DSLs and
conceptualization, he may find on this list the help he wants
Emacs is completely frozen until I press C-g and then it goes back to
normal (without loading the file). Here's the back trace:
Debugger entered--Lisp error: (quit)
accept-process-output(#process haskell)
(and (not (re-search-forward comint-prompt-regexp nil t))
On Fri, 11 Jan 2008 09:16:12 +0200, Lennart Augustsson
[EMAIL PROTECTED] wrote:
Thank you Duncan, you took the words out of my mouth. :)
On Jan 10, 2008 5:42 PM, Duncan Coutts [EMAIL PROTECTED]
wrote:
So let's imagine:
ones = 1 : ones
ones' = repeat 1
where repeat n = n : repeat n
Am Freitag, 11. Januar 2008 08:11 schrieb Lennart Augustsson:
Some people seem to think that == is an equality predicate.
This is a big source of confusion for them; until they realize that == is
just another function returning Bool they will make claims like
[1..]==[1..] having an unnatural
On Fri, 11 Jan 2008 09:11:52 +0200, Lennart Augustsson
[EMAIL PROTECTED] wrote:
Some people seem to think that == is an equality predicate.
This is a big source of confusion for them; until they realize that == is
just another function returning Bool they will make claims like
[1..]==[1..]
Consider this:
type Super = forall a. [a]
type Sub = forall b. b
cast0 :: Sub - Super
cast0 s = s
cast1a :: forall p. (Super - p) - (Sub - p)
cast1a sp x = sp x
cast1b :: forall p. (Super - p) - (Sub - p)
cast1b sp = sp
This compiles except for cast1b (ghc -c -fglasgow-exts):
Achim Schneider [EMAIL PROTECTED] writes:
You need to use the / operator, if you want to do floating-point
division.
Yes, exactly, integers don't have +-0 and +-infinity... only
(obviously) a kind of nan.
No, failure (exception, bottom) is different from NaN, which is just
another value in
However, the fact that (0 / 0) == (0 / 0) yields False is quite shocking.
In my opinion it is the better than yielding True. 0/0 doesn't make
sense. So it can't be compared to anything else which doesn't make
sense.
Whether == should yield False at all is another matter. It may be better
to
On Thu, 10 Jan 2008, David Roundy wrote:
On Thu, Jan 10, 2008 at 08:10:57PM +, Sebastian Sylvan wrote:
On Jan 10, 2008 8:06 PM, Ketil Malde [EMAIL PROTECTED] wrote:
David Roundy [EMAIL PROTECTED] writes:
I just want to point out that unsafePerformIO is at the core of the
On Fri, 11 Jan 2008 09:11:52 +0200, Lennart Augustsson
[EMAIL PROTECTED] wrote:
Some people seem to think that == is an equality predicate.
This is a big source of confusion for them; until they realize that == is
just another function returning Bool they will make claims like
[1..]==[1..]
On Jan 10, 2008 8:39 PM, apfelmus [EMAIL PROTECTED] wrote:
Victor Nazarov wrote:
Yes, there is: you can use a zipper
http://en.wikibooks.org/wiki/Haskell/Zippers
Here's how:
data Branch v = AppL (Term v)
| AppR (Term v)
| Lamb v
type Context
Wolfgang Jeltsch [EMAIL PROTECTED] schrieb:
However, the fact that (0 / 0) == (0 / 0) yields False is quite shocking. It
doesn?t adhere to any meaningful axiom set for Eq. So I think that this
behavior should be changed. Think of a set implementation which uses (==) to
compare set
On Jan 11, 2008 7:47 AM, Miguel Mitrofanov [EMAIL PROTECTED] wrote:
However, the fact that (0 / 0) == (0 / 0) yields False is quite shocking.
Just for the record: the following is from Firebug (JavaScript debugger for
Firefox) session:
a = 0/0
NaN
a == a
false
a === a
false
However, the fact that (0 / 0) == (0 / 0) yields False is quite shocking.
Just for the record: the following is from Firebug (JavaScript debugger for
Firefox) session:
a = 0/0
NaN
a == a
false
a === a
false
___
Haskell-Cafe mailing list
As GNU is not Unix, NaN is not a number,
Since NaN /= NaN, I think, we should decipher NaN as Not a NaN instead.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Wolfgang Jeltsch [EMAIL PROTECTED] writes:
However, the fact that (0 / 0) == (0 / 0) yields False is quite shocking. It
doesn’t adhere to any meaningful axiom set for Eq.
Tough luck, but that's how floating point works, and what the
numericalists know, and possibly even love (although I have
Achim Schneider wrote:
The list instance for Eq might eg. know something about the structure
of the lists and be smart enough not to get caught in the recursion of x
= 1:1:x and y = 1:1:1:y so it could successfully compare x == y to
True in six compares.
This would not be something about the
On Fri, 11 Jan 2008 13:29:35 +0200, Wolfgang Jeltsch
[EMAIL PROTECTED] wrote:
Am Freitag, 11. Januar 2008 10:54 schrieb Wilhelm B. Kloke:
Wolfgang Jeltsch [EMAIL PROTECTED] schrieb:
However, the fact that (0 / 0) == (0 / 0) yields False is quite
shocking.
It doesn?t adhere to any
Am Freitag, 11. Januar 2008 11:33 schrieben Sie:
Wolfgang Jeltsch [EMAIL PROTECTED] writes:
However, the fact that (0 / 0) == (0 / 0) yields False is quite shocking.
It doesn’t adhere to any meaningful axiom set for Eq.
Tough luck, but that's how floating point works, and what the
Call for Copy
The Monad.Reader - Issue 10
It is not too late to consider writing something for the next issue
of The Monad.Reader. The deadline for Issue 10 is
** January 25, 2007 **
It doesn't matter if you're an established
Am Freitag, 11. Januar 2008 10:54 schrieb Wilhelm B. Kloke:
Wolfgang Jeltsch [EMAIL PROTECTED] schrieb:
However, the fact that (0 / 0) == (0 / 0) yields False is quite shocking.
It doesn?t adhere to any meaningful axiom set for Eq. So I think that
this behavior should be changed. Think
Victor Nazarov wrote:
import Control.Monad.Writer
-- use a difference list or something for better performance
type Trace v = [Zipper v]
whnf :: Term v - Writer (Trace v) (Term v)
whnf t = whnf' ([],t)
where
whnf' (AppL e':cxt, Lam x e) = tell (cxt, App (Lam x e)
Ketil Malde:
Wolfgang Jeltsch:
However, the fact that (0 / 0) == (0 / 0) yields False is quite shocking.
It doesn’t adhere to any meaningful axiom set for Eq.
Tough luck, but that's how floating point works, and what the
numericalists know, and possibly even love (although I have my
doubts).
Ketil Malde [EMAIL PROTECTED] writes:
The bombing of NaN *might* be a profound compilation option, but for
people who really do numerical work, this is a blessing NOT to have
it.
I'll expand a bit of this, after I've checked with Wikipedia. Please
correct me (and it) if I'm wrong, but:
1)
On Fri, 11 Jan 2008 14:21:45 +0200, [EMAIL PROTECTED]
wrote:
Ketil Malde:
Wolfgang Jeltsch:
However, the fact that (0 / 0) == (0 / 0) yields False is quite
shocking.
It doesn’t adhere to any meaningful axiom set for Eq.
Tough luck, but that's how floating point works, and what the
Wolfgang Jeltsch wrote:
Am Freitag, 11. Januar 2008 11:33 schrieben Sie:
Wolfgang Jeltsch [EMAIL PROTECTED] writes:
However, the fact that (0 / 0) == (0 / 0) yields False is quite shocking.
It doesn’t adhere to any meaningful axiom set for Eq.
Tough luck, but that's how floating point works,
That would give you a language with a semantics I don't want to touch.
Sometimes useful, yes, but far to intensional for my taste.
-- Lennart
On Jan 11, 2008 5:59 AM, Achim Schneider [EMAIL PROTECTED] wrote:
Yes, thanks. I actually do think that many things would be easier if
every
[EMAIL PROTECTED] writes:
The difference between you (and/or Wolfgang J.) and myself is that I enjoy
more my freedom, even if I have to pay with a little more work. You want
to enforce rigid reactions of the system. You should be free to do it on
*your* machine, not on mine.
You are putting
On Jan 11, 2008 9:27 AM, Wolfgang Jeltsch [EMAIL PROTECTED] wrote:
However, the fact that (0 / 0) == (0 / 0) yields False is quite shocking. It
doesn't adhere to any meaningful axiom set for Eq. So I think that this
behavior should be changed. Think of a set implementation which uses (==) to
On Thu, 2008-01-10 at 20:37 -0800, Jonathan Cast wrote:
It might be faster; laziness usually has higher constants than direct
implementations. But I doubt the difference is critical in this
case, and I would definitely time a re-writing and throw it away
unless it was significantly
If you talk to anyone who uses floating point numbers for real they would
find (0/0)==(0/0) perfectly natural.
It disobeys some axioms that Eq instances don't fulfill anyway, but changing
it would make a lot of people surprised too.
In general, the floating point instances break almost all axioms
Johan == Johan Tibell [EMAIL PROTECTED] writes:
Emacs is completely frozen until I press C-g and then it goes back to
normal (without loading the file). Here's the back trace:
Debugger entered--Lisp error: (quit)
accept-process-output(#process haskell)
(and (not
Am Freitag, 11. Januar 2008 13:21 schrieb [EMAIL PROTECTED]:
Ketil Malde:
Wolfgang Jeltsch:
However, the fact that (0 / 0) == (0 / 0) yields False is quite
shocking. It doesn’t adhere to any meaningful axiom set for Eq.
Tough luck, but that's how floating point works, and what the
[EMAIL PROTECTED] writes:
People, you are monsters.
Well, bring on the torches and the pitchforks (although the image in
my mind is more like a mob carrying lenses and bananas).
no, some users are victims of its success as a formal language, not
just as a coding tool
I think Haskell's
The thing is that y already is a *builtin* function in Haskell.
On Fri, 11 Jan 2008 15:59:50 +0200, Achim Schneider [EMAIL PROTECTED] wrote:
Cristian Baboi [EMAIL PROTECTED] wrote:
So let's imagine:
ones = 1 : ones
ones' = repeat 1
where repeat n = n : repeat n
(==) :: Eq a = a - a
Jonathan Cast [EMAIL PROTECTED] wrote:
On 10 Jan 2008, at 7:55 AM, Achim Schneider wrote:
Daniel Yokomizo [EMAIL PROTECTED] wrote:
On Jan 10, 2008 3:36 PM, Achim Schneider [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote:
Niko Korhonen writes:
...
Although it could be argued
If you can't stomach the weirdness of floating point then perhaps you should
try to define your own type that obeys all the expected laws? :)
On Jan 11, 2008 3:36 AM, Wolfgang Jeltsch [EMAIL PROTECTED]
wrote:
Am Freitag, 11. Januar 2008 11:03 schrieb Felipe Lessa:
Another thing for the
Wolfgang Jeltsch protests (all this is about pathologies of the floating
point computations in Haskell, of course...):
Please don’t suggest that “illegalizing” some Ord instance is similar to
killing people out of religious motives.
Did I? Where?? This is silly...
I admit that I have
2008/1/11 Nicholls, Mark [EMAIL PROTECTED]:
Can someone explain (in simple terms) what is meant by existential and
universal types.
Preferably illustrating it in terms of logic rather than lambda calculus.
Well, I don't know about logic. While they are certainly related to
existential and
On Fri, Jan 11, 2008 at 02:54:20PM +0100, Achim Schneider wrote:
+-0 / +-0 is always NaN 'cos you can't tell which one is bigger and
thus can't decide between positive and negative Infinity, and it
isn't both, either.
But then there's +0/0 and -0/0, which would be +Infinity and
-Infinity,
Cristian Baboi writes after my long political speech on numerics:
Well, Haskell has this referential transparency thing which say that a
function is a function and you will never be able to build anything else
:-)
What do you want to say/claim/suggest/propose/deny??
All these speculations
Maurício wrote:
Is it possible not to load Prelude (...)
(...) NoImplicitPrelude is more aggressive
than 'import Prelude()'. You will have to
look elsewhere for a better explanation of
the difference.
I tried google and ghc homepage, but could
not find “elsewhere” :) Can you give me
Can someone explain (in simple terms) what is meant by existential and
universal types.
Preferably illustrating it in terms of logic rather than lambda
calculus.
There's plenty of stuff out there on itbut most of it seems double
dutch (no offense to the dutch intended).
Ketil Malde [EMAIL PROTECTED] wrote:
Achim Schneider [EMAIL PROTECTED] writes:
You need to use the / operator, if you want to do floating-point
division.
Yes, exactly, integers don't have +-0 and +-infinity... only
(obviously) a kind of nan.
No, failure (exception, bottom) is
Actually, here's a better example:
Prelude foldl (+) 0 [1..100]
*** Exception: stack overflow
Prelude Data.List foldl' (+) 0 [1..100]
5050
The explanation to what happens here is trivial to Haskell gurus but
completely baffling to newbies. It is difficult to explain to someone
Join us at the next meeting of pdxfunc, the Portland Functional
Programming Study Group, on Monday, 14th January, at CubeSpace.
We'll have presentations, demos and discussions. We welcome programmers
interested in all
On 11/01/2008, Nicholls, Mark [EMAIL PROTECTED] wrote:
Preferably illustrating it in terms of logic rather than lambda calculus.
There's plenty of stuff out there on it….but most of it seems double dutch
(no offense to the dutch intended).
I think the preferred idiom, considering the
David Roundy [EMAIL PROTECTED] wrote:
Prelude let x=1e-300/1e300
Prelude x
0.0
Prelude x/x
NaN
The true answer here is that x/x == 1.0 (not 0 or +Infinity), but
there's no way for the computer to know this, so it's NaN.
Wl.. math philosophy, Ok.
You can't divide
On Jan 11, 2008 5:47 PM, Nicholls, Mark [EMAIL PROTECTED] wrote:
If you wrap an existential type up in a constructor, not
much changes:
If you wrap a what?should this read existential or universal?
Whoops, right, universal.
newtype ID = ID (forall a. a - a)
ID can hold any value
Cristian Baboi [EMAIL PROTECTED] wrote:
On Fri, 11 Jan 2008 09:11:52 +0200, Lennart Augustsson
[EMAIL PROTECTED] wrote:
Some people seem to think that == is an equality predicate.
This is a big source of confusion for them; until they realize that
== is just another function returning
It seems GHC 6.8.2 fixes a couple of bugs in GHC 6.8.1, so I'm using
that one.
Gtk2HS does not yet detect my GHC 6.8.2 installation, but I guess it is
100% compatible.
Is it possible to get the Gtk2HS installer detect GHC 6.8.2? I’m on Windows.
Thanks again,
Peter
-Original Message-
From: Luke Palmer [mailto:[EMAIL PROTECTED]
Sent: 11 January 2008 17:11
To: Nicholls, Mark
Cc: haskell-cafe@haskell.org
Subject: Re: [Haskell-cafe] type questions again
2008/1/11 Nicholls, Mark [EMAIL PROTECTED]:
Can someone explain (in simple terms)
On Thu, 10 Jan 2008, Michael Roth wrote:
Hello list,
still playing with monads and states, I have the following question:
Given:
import Control.Monad.State.Lazy
data MyData = MyData { content :: String }
foobar :: State MyData String
foobar = do
gets
On Jan 11, 2008 8:13 PM, Jeremy Shaw [EMAIL PROTECTED] wrote:
At Thu, 10 Jan 2008 22:16:27 -0200,
Maurício wrote:
I tried google and ghc homepage, but could
not find elsewhere :) Can you give me a
link or somewhere to start from?
No. What I meant to say was, I'm not really sure myself,
On Fri, 2008-01-11 at 20:20 -0200, Andre Nathan wrote:
Both versions which use getDirectoryContents also use much more memory
than the one which uses readDirStream (about 8M vs about 2M). Maybe I'm
not exploting getDirectoryContents' laziness correctly? I expected the
second and third versions
On Fri, 11 Jan 2008, Luke Palmer wrote:
So, when you write the number 3 in Haskell, GHC converts this to
essentially (Prelude.fromInteger (3::Integer)) in its internal format.
So it doesn't matter if you import Prelude (), Prelude's version of
fromInteger still gets called. If you give
Also, there are only two zeros, +0 and -0 and they compare equal.
On Jan 11, 2008 10:12 AM, Achim Schneider [EMAIL PROTECTED] wrote:
I was wrong in claiming that
But then there's +0/0 and -0/0, which would be +Infinity and
-Infinity, and +0 0 -0. AFAIK there are no floats with three
Hello,
I see where the top level code (written in Haskell)for STM. I have
found STM.c;however, I can't seem to find the FFI glue code.?
Thanks, Vasili
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
On Fri, Jan 11, 2008 at 06:15:52PM -0600, Galchin Vasili wrote:
Hello,
I see where the top level code (written in Haskell)for STM. I have
found STM.c;however, I can't seem to find the FFI glue code.?
Thanks, Vasili
There isn't any. readTVar# etc are primops.
Stefan
signature.asc
On 11 Jan 2008, at 5:13 AM, Achim Schneider wrote:
Jonathan Cast [EMAIL PROTECTED] wrote:
What kind of mathematics? I don't know of any mathematics where
algebraic simplifications are employed without proof of the
underlying equations (in some denotational model).
Mathematics as, as my
On 11 Jan 2008, at 10:12 AM, Achim Schneider wrote:
David Roundy [EMAIL PROTECTED] wrote:
Prelude let x=1e-300/1e300
Prelude x
0.0
Prelude x/x
NaN
The true answer here is that x/x == 1.0 (not 0 or +Infinity), but
there's no way for the computer to know this, so it's NaN.
Didn't catch this
On 11 Jan 2008, at 7:27 AM, Andre Nathan wrote:
On Thu, 2008-01-10 at 20:37 -0800, Jonathan Cast wrote:
It might be faster; laziness usually has higher constants than direct
implementations. But I doubt the difference is critical in this
case, and I would definitely time a re-writing and
On 11 Jan 2008, at 2:20 PM, Andre Nathan wrote:
On Fri, 2008-01-11 at 13:27 -0200, Andre Nathan wrote:
I was wondering if laziness would make it run as if it was a
single O(n)
operation (get one directory entry on demand, pass it to filter and
then to insertInTree), because only one entry is
On 11 Jan 2008, at 2:24 PM, Andre Nathan wrote:
processEntry :: DirStream - IO ()
processEntry ds = do
entry - readDirStream ds
if entry =~ ^[0-9]+$
then do
putStrLn entry
processEntry ds
else
if entry == then return () else processEntry ds
bar :: IO ()
bar = do
Jonathan Cast [EMAIL PROTECTED] wrote:
On 11 Jan 2008, at 5:13 AM, Achim Schneider wrote:
Jonathan Cast [EMAIL PROTECTED] wrote:
What kind of mathematics? I don't know of any mathematics where
algebraic simplifications are employed without proof of the
underlying equations (in some
Jonathan Cast [EMAIL PROTECTED] wrote:
On 11 Jan 2008, at 10:12 AM, Achim Schneider wrote:
David Roundy [EMAIL PROTECTED] wrote:
Prelude let x=1e-300/1e300
Prelude x
0.0
Prelude x/x
NaN
The true answer here is that x/x == 1.0 (not 0 or +Infinity), but
there's no way for the
67 matches
Mail list logo