arithmetic sequences and the prelude: minor problems?

2006-06-30 Thread Laszlo Nemeth
Hi, Haskell Report 6.3.4, pg 86-87, talks about arithmetic sequences. For all four of these Prelude numeric types, all of the enumFrom family of functions are strict in all their arguments. This seems to imply that for other Prelude types, functions of the enumFrom family aren't. Yet, bot

unexpected arithmetic sequence and deriving Enum behaviour

2006-06-30 Thread Laszlo Nemeth
Hi, Consider the following code fragment: data Colour = Red | Black | Blue deriving (Show, Bounded) instance Enum Colour where succ Red = Black succ Black = Blue succ Blue = error succ of maxBound fromEnum Red = 1 fromEnum Black = 2 fromEnum Blue = 3 toEnum 1 = Red

[Haskell] standard prelude and specifications

2006-04-13 Thread Laszlo Nemeth
Hi, Chp 8 of the Haskell Report says: In this chapter the entire Haskell Prelude is given. It constitutes a *specification* for the Prelude. Many of the definitions are written with clarity rather than efficiency in mind, and it is not required that the specification be implemented as shown

Re: HUGS error: Unresolved overloading

2001-05-21 Thread Laszlo Nemeth
Hi Mark, isSorted xs = and (zipWith (=) xs (tail xs)) In other words: When is a list xs sorted? If each element in xs is less than or equal to its successor in the list (i.e., the corresponding element in tail xs). That's right ... under cbn! At the same time David's version with

Re: Pattern guards vs. case (was, unfortunately :Re: interesting example of laziness/ghc optimisation)

2001-03-01 Thread Laszlo Nemeth
* * * Ketil Malde [EMAIL PROTECTED] wrote: ut - the converse is not true, is it? I can write ... = case foo of (Foo f) - ... (Bar b) - ... ut I can't express that as a pattern-guarded expression, can I? You probably have already seen John's reply

Re: Pattern guards vs. case (was, unfortunately :Re: interesting exampleof laziness/ghc optimisation)

2001-03-01 Thread Laszlo Nemeth
* * * Johannes Waldmann wrote: But if you want to be really weird you can write something like (I haven't typed this in): f x | (Foo _) == x = f x | (Bar _) == x = no, you can't, e. g. hugs (Feb 2000) says Prelude let f x | Just 4 == x = 0 in f (Just 4) 0 Prelude let f x |

Deja vu: Re: In hoc signo vinces (Was: Revamping the numeric classes)

2001-02-12 Thread Laszlo Nemeth
[incomprehensible (not necessarily wrong!) stuff about polynomials, rings, modules over Z and complaints about the current prelude nuked] --- Marcin 'Qrczak' Kowalczyk pisze --- Please show a concrete proposal how Prelude classes could be improved. --- Jerzy Karczmarczuk repondre --- I am

GHC seems to me stricter than one would think...

2000-04-13 Thread Laszlo Nemeth
Hi, I'm using a 4.06. I have a piece of code (in my version of the compiler) which is in the uniq supply monad, but the result of the computation is *ignored*. Nevertheless, it gives an error from Subst.lhs: nonexhaustive patterns in zip_ty_env (my code calls coreExprType). I always thought

Strange runtime error

2000-04-03 Thread Laszlo Nemeth
Hi, I attach a piece of code: it's part of my thesis, attempts to turn (strict) functions to catamorphisms (see the comment in the code). It compiles just fine with core lint and debug on, but when I add the call to cheapSimplify it produces a runtime error: [hsc: no threads to run: infinite

Latest GHC (binary distr) and Suse 6.3 linux

2000-02-15 Thread Laszlo Nemeth
the gnu web site, freshly installed. After 'make' the libgmp.so.2 file was generated from libgmp.a by ld -Bsymbolic. If anyone had similar problems or knows how to fix this I would appreciate any hints. Thanks, Laszlo Nemeth

Re: Licenses and Libraries

1999-08-23 Thread Mr. Laszlo Nemeth
Paul Hudak wrote: P.S. I really like the idea someone suggested of maintaining a list of open projects, who's working on what, etc. as in the Linux community. One major difference between the Linux community and the Haskell community is that in LinuxLand the reward is the name, recognition,

Re: Question

1999-08-20 Thread Mr. Laszlo Nemeth
Mark Jones wrote: One of the greatest disappointments to date of the move to more liberal (i.e. free software) licenses for systems like Hugs and GHC, is that it has done almost nothing to stimulate contributions to the implementations themselves from outside the immediate (and small) group

Re: Zipping two sequences together with only cons, empty, foldr

1999-07-02 Thread Laszlo Nemeth
Erik Meijer wrote: Zipping lists however is *much* easier expressed using anamorphisms or unfold. The reason is that when zipping two lists you are co-inductively *constructing* a list, and not so much inductively destructing a list. Hence the trick of inductively destructing a list that

Re: Zipping two sequences together with only cons, empty, foldr

1999-07-02 Thread Laszlo Nemeth
Lennart Augustsson wrote: Kevin Atkinson wrote: Lennart Augustsson wrote: No, it will not be as efficient. foldr is not the right primitive for making functions on lists. You want the more general recurse :: (a - c a - b - b) - b - c a - b Could you give me some refrence

Re: Zipping two sequences together with only cons, empty, foldr

1999-07-01 Thread Laszlo Nemeth
Kevin Atkinson wrote: cons :: a - c a - c a empty :: c foldr :: (a - b - b) - b - c a - b I am not an expert. I have a minor problem with this, the type of empty: if c stands for a type constructor then empty should have type (c a). Moreover, I don't understand why you use 'c' for lists

Re: how to write a simple cat

1999-06-02 Thread Laszlo Nemeth
for + and ^. So I wanted to fetch them from the archive...which was last updated on the 28 May. Is the archive broken or just rarely updated? Thanks, Laszlo Nemeth

Re: STL for Haskell

1999-04-30 Thread Laszlo Nemeth
Chris Okasaki wrote: Unfortunately, it's not quite that easy. For a library with several implementations of, say, sets, you want the various implementations to support the same fold function. In other words, in a library with abstract data types, you want the folds to be over the

No Subject

1999-02-08 Thread Laszlo Nemeth
Hi, This looks like a bug: freshly checked out ghc-3-branch, I am compiling it on easter (with the installed 3.02) with -fno-specialise and -dcore-lint and get this message: /local/fp/bin/i386-unknown-linux/ghc-3.02 -cpp -fglasgow-exts -Rghc-timing -I. -IcodeGen -InativeGen -Iparser

Re: Something is broken with Handles...

1998-11-04 Thread Laszlo Nemeth
Hi, I tried your version of exec. Still the same problem. With 2.10 it outputs "aaa" (as expected) and doesn't terminate (???), with 3.03 (-fno-specialise) it gives ^@^@^@ and terminates. I guess it is some control character...And yes, this is Solaris. I would bet that this has something to do

Something is broken with Handles...

1998-10-27 Thread Laszlo Nemeth
(with apologies to D. Adams) Hi, The code enclosed, works as expected for 2.10, works for proto-3.03-15-Jul but breaks for 3.03 (latest from the CVS). The problems seems to be something to do with handles: you write something to it, but it doesn't go to the pipe. With the code I am working