[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 h

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 > Prel

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

Re: interesting example of laziness/ghc optimisation

2001-02-28 Thread Laszlo Nemeth
* * * Ketil Malde <[EMAIL PROTECTED]> wrote: > > runRandom last max num > > | num > 1 = runRandom (fst new) max (num-1) > > | otherwise = snd new > > What's the difference between the pipe-syntax, and a case statement, > i.e. writing the function as > > runRandom last max num = case n

Re: Library conventions

2000-06-25 Thread Laszlo Nemeth
> > I don't have a clear picture about common practice regarding argument > > order. Any ideas for simple rules which cover most cases? > > For functions that take an old version of something plus some modifiers > and return a new version, current practice is inconsistent. Fusion rules (cata-bui

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) g

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 tha

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

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'

Re: how to write a simple cat

1999-06-02 Thread Laszlo Nemeth
efinitions 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: Another Haskell 98 question

1999-05-10 Thread Laszlo Nemeth
, but I'm in the habit of publishing >proposals before implementing them. Will this change be compatible with the first class (extensible?) records work? I know that first class records will not be part of Haskell98, but it would be nice if Haskell2000 (or whatever) could be close to the stable language of H98. Can we expect first class records in the near future? 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 ab

Re: STL for Haskell

1999-04-29 Thread Laszlo Nemeth
ons which I generate later, I'd be happy to give you a copy. (It's 3.02, I'm afraid) Laszlo Nemeth [EMAIL PROTECTED]