Re: [Haskell-cafe] All equations must have the same arity - why?

2008-01-13 Thread ajb
G'day all. Quoting Neil Mitchell <[EMAIL PROTECTED]>: I don't believe that. I suspect the type system will mop these up. As previously noted, anything involving undefined (thanks to seq) is not equivalent. While undefined is arguably uncommon, error most certainly isn't: f1 (x:xs) = {-

Re: [Haskell-cafe] All equations must have the same arity - why?

2008-01-13 Thread ajb
G'day all. Quoting Conal Elliott <[EMAIL PROTECTED]>: That eta-expansion desugaring would lose sharing. Offhand, I don't know of a desugaring that would do the trick and preserve sharing. Any ideas? How about this? f = let body = sort . nub in \xs -> case xs of [] -> [1]

Re: [Haskell-cafe] All equations must have the same arity - why?

2008-01-13 Thread ajb
G'day all. Quoting Neil Mitchell <[EMAIL PROTECTED]>: It's nice to write functions in point free style: f = sort . nub But sometimes I have to add an extra case, on a certain value: f [] = [1] f = sort . nub But now these equations have different arities, and its rejected by Haskell. I do

Re: [Haskell-cafe] Re: Solving a geometry problem with Haskell

2008-01-12 Thread ajb
G'day all. Quoting Henning Thielemann <[EMAIL PROTECTED]>: The rare cases occur for big numbers. http://www.haskell.org/haskellwiki/Generic_number_type#isSquare How big, you might ask? Prelude> let dd = undefined :: Double in floatRadix dd ^ floatDigits dd 9007199254740992 Pretty big, and

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-10 Thread ajb
G'day all. Quoting Luke Palmer <[EMAIL PROTECTED]>: What do you mean by "black hole" here? A "black hole" is what happens when evalation of something recursively depends on its own evaluation in such a way that no useful work can be done. An example is: let omega = omega + 1 in omega I

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-10 Thread ajb
G'day all. Quoting [EMAIL PROTECTED]: Perhaps another example is more relevant, the tradeoffs space-time in the "optimized" version of the powerset generator... Yeah, I was going to bring up that topic. I've been lazy programming for 15 or so years, and the only "bugs" that I can think of ar

Re: [Haskell-cafe] Re: Difference lists and ShowS

2008-01-10 Thread ajb
G'day all. Quoting Achim Schneider <[EMAIL PROTECTED]>: But you really need one with 5 differently-sized blades plus three spezialized carving blades, an USB stick, microscope, 13 kinds of torx, imbus etc drivers each, a tv set (analogue/digital) with unfoldable touchscreen, at least 3-band GSM

RE: [Haskell-cafe] Refactoring status

2008-01-03 Thread ajb
G'day all. Quoting Peter Verswyvelen <[EMAIL PROTECTED]>: I actually meant something more like http://en.wikipedia.org/wiki/Intentional_programming I'm pretty sure that "Intentional programming" is Hungarian for "I want to sell you another IDE". Cheers, Andrew Bromage ___

Re: [Haskell-cafe] Basic question concerning data constructors

2008-01-02 Thread ajb
G'day all. Quoting Yitzchak Gale <[EMAIL PROTECTED]>: Data types consist only of computable elements. Since there are only countably many computable functions, every data type has at most countably many elements. In particular, it is a set. I still say it "isn't a set" in the same way that a

Re: [Haskell-cafe] Basic question concerning data constructors

2007-12-30 Thread ajb
G'day all. Quoting David Menendez <[EMAIL PROTECTED]>: data A = B means that "B" constructs a value of type "A". The "=" acts more like the "::=" in a BNF grammar. And, indeed, that was the syntax for it in Miranda. It is *not* a claim that A equals B, since A is a type and B is a data

Re: [Haskell-cafe] Re: Wikipedia on first-class object

2007-12-30 Thread ajb
G'day all. I think it was Ketil Malde who said: If I understand correctly, a quantum computer might solve problems in NP in polynomial time, which is assumed not to be possible for deterministic computers. Quoting Miguel Mitrofanov <[EMAIL PROTECTED]>: No! Moreover, there is a hypothesis th

Re: [Haskell-cafe] Re: Wikipedia on first-class object

2007-12-29 Thread ajb
G'day all. Quoting Wolfgang Jeltsch <[EMAIL PROTECTED]>: I love my children. My laptop isn’t able to do that. Neither am I, especially since I've never met them. Cheers, Andrew Bromage ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://

Re: Re[2]: [Haskell-cafe] Re: Wikipedia on first-class object

2007-12-29 Thread ajb
G'day all. Tim Chevalier wrote: The only thing that computers can do that humans can't is to work without getting bored. Quoting Bulat Ziganshin <[EMAIL PROTECTED]>: ok, please compute 2^2^30 before continuing discussion. it seems that you just use "i'm too bored" and "i can't" as synonyms.

Re: [Haskell-cafe] Specializing classes with classes

2007-12-29 Thread ajb
G'day all. Quoting alex <[EMAIL PROTECTED]>: (Presumably you meant "instance Alg Sometype", "instance Vec Sometype" etc.) Yes, most likely. Obviously I didn't try to compile the code. Now I know what they meant what they meant by "leave your OO at the door". To be fair, Haskell typeclass

Re: [Haskell-cafe] Specializing classes with classes

2007-12-28 Thread ajb
G'day all. Quoting alex <[EMAIL PROTECTED]>: I would like to do this: class Foo t where hi :: t -> Bool class Foo t => Bar t where hi x = True This is arguably one of the most requested features in Haskell. The only reason why it hasn't been implemented yet is that

Re: [Haskell-cafe] Re: Wikipedia on first-class object

2007-12-28 Thread ajb
G'day all. Quoting Achim Schneider <[EMAIL PROTECTED]>: And if it wouldn't? After all, arguing that |N == |N is undefined because it takes too long to check would earn you a straight F in any math test. That's only because you spelled it incorrectly for the purpose of a maths test. Had you w

Re: [Haskell-cafe] Re: Haskell performance

2007-12-22 Thread ajb
G'day all. Quoting Jon Harrop <[EMAIL PROTECTED]>: I would recommend adding: 1. FFT. 2. Graph traversal, e.g. "n"th-nearest neighbor. I'd like to put in a request for Pseudoknot. Does anyone still have it? Cheers, Andrew Bromage ___ Haskell-Cafe

Re: [Haskell-cafe] class default method proposal

2007-12-11 Thread ajb
G'day all. Quoting David Menendez <[EMAIL PROTECTED]>: This is pretty much how I define Functor and Applicative instances for my monads. It is admittedly irritating to have to write out the boilerplate, but it doesn't seem irritating enough to require a language extension to eliminate. In th

Re: [Haskell-cafe] Possible Improvements

2007-12-03 Thread ajb
G'day all. On Mon, 2007-12-03 at 10:48 +0100, Ketil Malde wrote: I find that I often need to add strictness when: left thumb) parsing [Char] into something more compact, i.e. almost all cases. right thumb) storing data into maps, especially when the values are produced by

Re: [Haskell-cafe] Somewhat random history question - chicken and egg

2007-11-11 Thread ajb
G'day all. I asked: Actually, a more interesting problem is what you'd replace COBOL with, and how you'd go about it. Wouldn't it be nice if there was a modern language that you could write or rewrite new parts of your COBOL application in, and it all worked seamlessly with what you already ha

Re: [Haskell-cafe] Somewhat random history question - chicken and egg

2007-11-11 Thread ajb
G'day all. Quoting [EMAIL PROTECTED]: But... tell me please, ANYONE, who takes part in this inspiring exchange: How many COBOL programs have you written in your life? As you well know, only one COBOL program has ever been written. The rest are just modifications of it. Actually, a more inte

Re: [Haskell-cafe] Somewhat random history question

2007-11-11 Thread ajb
G'day all. Quoting Felipe Lessa <[EMAIL PROTECTED]>: But I can't say what was the particular method used by GHC. I don't either, but here's a suggested plan of attack: 1. Write a parser for a suitable subset of Haskell, in a closely related language (e.g. Miranda). 2. Write a front-end that

Re: [Haskell-cafe] Sinus in Haskell

2007-11-10 Thread ajb
G'day all. Quoting [EMAIL PROTECTED]: == No, Gentlemen, nobody rational would use Taylor nowadays! It is lousy. This is correct. Real implementations are far more likely to use the minmax polynomial of some order. However... Then, a *rational* approximation gives you the same precision wi

Re: [Haskell-cafe] Fibbonachi numbers algorithm work TOO slow.

2007-11-07 Thread ajb
G'day all. I wrote: However, this is still an O(log n) algorithm, because that's the complexity of raising-to-the-power-of. And it's slower than the simpler integer-only algorithms. Quoting Henning Thielemann <[EMAIL PROTECTED]>: You mean computing the matrix power of /1 1\ \0 1/ ? I m

Re: [Haskell-cafe] About Fibonacci again...

2007-11-07 Thread ajb
G'day all. Quoting [EMAIL PROTECTED]: zipWith (!!) (fix (([1]:).map(>>= \x->if x==0 then [1] else [1,0]))) [0..] This was the shortest variant I could manage in the time allotted: zipWith(!!)(fix(([1]:).map(>>= \x->1:[0|x==1])))[0..] Cheers, Andrew Bromage __

Re: [Haskell-cafe] About Fibonacci again...

2007-11-07 Thread ajb
G'day all. Quoting [EMAIL PROTECTED]: This nasty acquaintance of mine asked the students to write down a simple procedure which generates the sequence after the infinite number of units of time. Cool problem! "Simple" is, of course, in the eye of the beholder. zipWith (!!) (fix (([1]:).map(

Re: [Haskell-cafe] More on Fibonacci numbers

2007-11-07 Thread ajb
G'day all. Quoting [EMAIL PROTECTED]: Andrew Bromage rebukes me once more that the fl. point solution diverges from the integer one [as if I didn't know that...], Sorry if it came across as that. I just meant it as a segue into a way to make the algorithm practical. I do note that nobody ha

Re: [Haskell-cafe] Fibbonachi numbers algorithm work TOO slow.

2007-11-06 Thread ajb
G'day all. Quoting [EMAIL PROTECTED]: There is one solution missing there (unless I skipped it) fib n=((1+s)/2)^n-((1-s)/2)^n)/s where s=sqrt 5 If some of you complain that this is real, not integer, please remember that Leonardo of Pisa thought of applying this to rabbits. Well, rabbits are no

Re: [Haskell-cafe] Fibbonachi numbers algorithm work TOO slow.

2007-11-05 Thread ajb
G'day all. Quoting Dan Weston <[EMAIL PROTECTED]>: In any case, to answer your question more specifically, the memoization of *constants* I think you meant "CAFs". You can just unroll the loop yourself to see. The following runs as fast as you'd expect: fib00 = 0 fib01 = 1 fib02 = fib00 +

Re: [Haskell-cafe] Monte Carlo Pi calculation (newbie learnings)

2007-11-05 Thread ajb
G'day all. Quoting Don Stewart <[EMAIL PROTECTED]>: calculatePi total g = fromIntegral (4*count) / fromIntegral total This is slightly more robust in cases where the multiplication would overflow an Int: calculatePi total g = fromRational ((4*fromIntegral count) % fromIntegra

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-11-01 Thread ajb
Quoting Justin Bailey <[EMAIL PROTECTED]>: Done: http://www.haskell.org/haskellwiki/RuntimeCompilation . Please update it as needed. Thanks! Cheers, Andrew Bromage ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread ajb
G'day all. Quoting Derek Elkins <[EMAIL PROTECTED]>: Probably RuntimeCompilation (or something like that and linked from the Knuth-Morris-Pratt implementation on HaWiki) written by Andrew Bromage. I didn't keep a copy, but if someone wants to retrieve it from the Google cache and put it on th

Re: [Haskell-cafe] newbie optimization question

2007-10-28 Thread ajb
G'day all. Quoting Don Stewart <[EMAIL PROTECTED]>: That fits with my experience writing low level numeric code -- Integer can be a killer. Mind you, if you're intending to work with large integers or rationals, Integer is great! The bottleneck is almost always "show". Cheers, Andrew Bromag

Re: [Haskell-cafe] Re: [Haskell] Announce: generating free theorems, online and offline

2007-10-18 Thread ajb
G'day. Quoting Stefan O'Rear <[EMAIL PROTECTED]>: All the MonadPlus I can think of (IO,Maybe,[]) satisfy it. Were you thinking of right distribution? No monad transformer can satisfy it, because lift m >> mzero is not mzero. Cheers, Andrew Bromage ___

Re: [Haskell-cafe] Class invariants/laws

2007-10-18 Thread ajb
G'day all. Quoting Janis Voigtlaender <[EMAIL PROTECTED]>: Yes. But actually what we would need would be that it checks as well that we have implemented at *most* a minimal set of operations. Otherwise, we are back to the point where I can implement both (==) and (/=), and in a way that the sup

Re: [Haskell-cafe] Re: [Haskell] Announce: generating free theorems, online and offline

2007-10-18 Thread ajb
G'day all. Quoting Janis Voigtlaender <[EMAIL PROTECTED]>: Okay, it is quite natural to take this stand. But as you say, there is no such commitment in the language definition. And even if there were, I doubt it would be possible to enforce such invariants in a compiler. So there would be "ille

Re: [Haskell-cafe] Re: [Haskell] Announce: generating free theorems, online and offline

2007-10-17 Thread ajb
G'day. Quoting Janis Voigtlaender <[EMAIL PROTECTED]>: Hmm, but I can easily define an instance of Eq that does not satisfy this invariant. And I want the generated free theorem to be true for any legal Haskell program. I would think that if x == y isn't the same as not (x /= y) for some type

[Haskell-cafe] Re: [Haskell] Announce: generating free theorems, online and offline

2007-10-17 Thread ajb
[Ccing to haskell-cafe; please direct any replies there instead of haskell] G'day all. First of all, once again well done to Sascha on a great tool. Just a few comments. Quoting Janis Voigtlaender <[EMAIL PROTECTED]>: - support for type classes (e.g., enter "elem" and note the generated re

[Haskell-cafe] Re: [Haskell] IN Doubt...

2007-10-16 Thread ajb
[Moved to haskell-cafe] G'day all. Quoting Don Stewart <[EMAIL PROTECTED]>: You can't pattern match 'a' and 'a' like that -- there's no implicit unification. Since we're being nostalgic in other threads, this is #1 on my list of things I miss from Miranda. It's also high on my "things that

Re: [Haskell-cafe] On the verge of ... giving up! [OT]

2007-10-14 Thread ajb
G'day all. Quoting "Brandon S. Allbery KF8NH" <[EMAIL PROTECTED]>: I would really like to see "category theory for the working *non*mathematician". It's pricey, but your local university library probably has it: http://www.cambridge.org/catalogue/catalogue.asp?isbn=9780521478175 Cheers,

Re: [Haskell-cafe] On the verge of ... giving up! [OT]

2007-10-14 Thread ajb
G'day all. Quoting "Richard A. O'Keefe" <[EMAIL PROTECTED]>: (5) Precisely because it seeks generality, category theory seems difficult to "concrete thinkers". And books on category theory tend to be extremely fast-paced, so ideas which are not in themselves particularly esoteric (

Re: [Haskell-cafe] On the verge of ... giving up!

2007-10-14 Thread ajb
G'day all. Quoting [EMAIL PROTECTED]: I have heard that a few times, not recently. This is really interesting, WHAT do you actually miss? Off the top of my head, from H1.4, I miss: - MonadZero (a lot) - Some of the monad/functor-overloaded functions (quite a bit) - Record punning

Re: [Haskell-cafe] Re: New slogan... (A long speculation)

2007-10-14 Thread ajb
G'day all. Quoting [EMAIL PROTECTED]: Or perhaps I am again completely wrong, as in the case of "R" not being something I ever wanted? This is off-topic, but the email address "r" at google.com is Rob Pike. Only someone a similar stature (e.g. Richard O'Keefe) could get away with that. Cheer

Re: [Haskell-cafe] On the verge of ... giving up!

2007-10-14 Thread ajb
G'day all. Quoting Andrew Coppin <[EMAIL PROTECTED]>: I tried to use Wikipedia to learn about how to build digital filters... this was a disaster. There is almost no useful information there! :-( That's not my experience. I didn't really understand Kalman filters until I read the Wikipedia p

Re: [Haskell-cafe] On the verge of ... giving up!

2007-10-14 Thread ajb
G'day all. Vimal <[EMAIL PROTECTED]> quoted someone else as saying: Monads in programming seem to be the most mysterious notion of the century. I agree with the "hair shirt" talk on this. I found understanding monads no harder than understanding objects, starting from a comparable level of i

Re: [Haskell-cafe] On the verge of ... giving up!

2007-10-14 Thread ajb
G'day all. Quoting Derek Elkins <[EMAIL PROTECTED]>: The first goal listed in the Haskell 1.0 Report is: "It should be suitable for teaching, research, and applications, including building large systems." Haskell was never intended to be solely a teaching or research language. (You didn't nec

Re: [Haskell-cafe] Spot the difference!

2007-09-19 Thread ajb
G'day all. Quoting PR Stanley <[EMAIL PROTECTED]>: Fully lazy? Can you elaborate please? Sure. that code again: test1 = \n _ -> 1+n test2 = \n -> let x = n+1 in \_ -> x Suppose we have: f g x = g x + g x And we try two options: f (test1 4) 3 f (test2 4) 3 In the fir

Re: [Haskell-cafe] Spot the difference!

2007-09-19 Thread ajb
G'day all. Quoting PR Stanley <[EMAIL PROTECTED]>: \_ n -> 1 + n \_ -> (\n -> 1 + n) The outcome seems to be identical. is there a substantive difference between the two definitions? Certainly, GHC compiles these to the same code. But be careful! Consider the following two defintions:

Re: [Haskell-cafe] Re: Typeclasses and implicit parameters

2007-09-07 Thread ajb
G'day all. Quoting Chung-chieh Shan <[EMAIL PROTECTED]>: Yes. You can even do this portably, using nothing "unsafe", with Dylan Thurston's technique: That paper gives you a choice between inefficient and leaky. I think I'll take unsafeCoerce#. :-) Cheers, Andrew Bromage ___

RE: [Haskell-cafe] Typeclasses and implicit parameters

2007-09-06 Thread ajb
G'day all. Quoting Simon Peyton-Jones <[EMAIL PROTECTED]>: | -- GHC rejects this. Hugs compiles it, but I can't call it as | -- let ?foo = "Hello" in show Foo | -- | -- Is there a good reason to disallow this? | data Foo = Foo | | instance (?foo :: String) => Show Foo where | showsPrec _ F

Re: [Haskell-cafe] About mplus

2007-09-05 Thread ajb
G'day all. Slight nit... Quoting ok <[EMAIL PROTECTED]>: I've been thinking about making a data type an instance of MonadPlus. From the Haddock documentation at haskell.org, I see that any such instance should satisfy mzero `mplus` x = x x `mplus` mzero = x mzero >>= f

Re: [Haskell-cafe] Hawiki articles

2007-09-03 Thread ajb
G'day all. Quoting Henning Thielemann <[EMAIL PROTECTED]>: I join this minority. Lawyers, please turn a deaf ear. I dissent in part. Speaking for myself (I wrote quite a bit of stuff for hawiki, including some of TyingTheKnot), I don't want anyone violating my copyrights. However, I /did/ g

Re: [Haskell-cafe] Haskell as an extension language

2007-09-03 Thread ajb
G'day all. Quoting Hugh Perkins <[EMAIL PROTECTED]>: Oh, I thought that I'd been an obvious C# fanboy for long enough that I didnt need to mention it by name ;-) Not everyone on haskell-cafe is stalking you, you know. :-) Cheers, Andrew Bromage ___

Re: [Haskell-cafe] Haskell as an extension language

2007-09-02 Thread ajb
G'day all. Quoting Hugh Perkins <[EMAIL PROTECTED]>: However, using Swig etc to join Python to C++ takes a significant amount of time, [...] Supposedly, Boost.Python is pretty good. Then I discovered a different language (not Haskell) that combined the ease of Python with the speed of C++.

Re: [Haskell-cafe] Learn Prolog...

2007-09-02 Thread ajb
G'day all. Quoting Bill Wood <[EMAIL PROTECTED]>: As to whether Prolog is "dead" or not, it depends on your definition of "dead". Three years ago (not ten!) I made my living maintaining and developing a large application written in Prolog. Back when I was doing logic programming, 10 or so ye

Re: [Haskell-cafe] "Tying the knot" with unknown keys

2007-08-21 Thread ajb
G'day all. Quoting David Ritchie MacIver <[EMAIL PROTECTED]>: I was playing with some code for compiling regular expressions to finite state machines and I ran into the following problem. I've solved it, but I'm not terribly happy with my solution and was wondering if someone could come up with

Re: [Haskell-cafe] A few questions on primes generating.

2007-08-13 Thread ajb
G'day all. Quoting Andrew Coppin <[EMAIL PROTECTED]>: So many other programming languages allow weird things to happen with numeric overflows... it would be nice if Haskell didn't. It would nice if CPUs supported trapping integer arithmetic. Cheers, Andrew Bromage ___

Re: [Haskell-cafe] Suffix tree

2007-08-13 Thread ajb
G'day all. Quoting Jon Harrop <[EMAIL PROTECTED]>: > Does anyone have any Haskell code implementing suffix trees? I'm particularly > interested in high-performance construction. No, but I have this: http://citeseer.ist.psu.edu/giegerich95comparison.html First person to implement them gets

[Haskell-cafe] Typeclasses and implicit parameters

2007-08-09 Thread ajb
{-# OPTIONS -fglasgow-exts #-} -- G'day everyone. -- This is okay. f1 :: (?foo :: String) => String f1 = ?foo -- So is this. f2 :: (Show a, ?foo :: a) => a -> String f2 _ = show ?foo -- Hugs allows this. GHC rejects it on the grounds that "a" is unused -- on the right-hand side of the (=>). I

Re: [Haskell-cafe] Small question

2007-08-09 Thread ajb
G'day all. Quoting Stefan O'Rear <[EMAIL PROTECTED]>: > In general, GHC doesn't do "unboxing". Instead it has a simpler and > more general approach, [...] I'm not convinced that the phrase "more general" is appropriate here. :-) > As far as actual heap usage goes, GHC creates single static val

Re: [Haskell-cafe] Matters of precision

2007-08-09 Thread ajb
G'day. Quoting Andrew Coppin <[EMAIL PROTECTED]>: > First of all, currently I'm just using Double to represent coordinates. > Can anybody tell me what the smallest value you can represent with one > is? (Not including denormals.) Remember that floating point numbers are stored in three parts. T

Re: [Haskell-cafe] Sudoku Solver

2007-08-08 Thread ajb
G'day all. Quoting Vimal <[EMAIL PROTECTED]>: > Well, Dancing Links (DLX) is just a data structure + few techniques > to help with the backtrack, after modeling Sudoku as a contraint > satisfaction problem. DLX is one realisation of an algorithm which works on boolean matrices. It's a pointer-b

Re: [Haskell-cafe] Re: Knuth Morris Pratt for Lazy Bytestrings implementation

2007-08-01 Thread ajb
G'day all. Quoting ChrisK <[EMAIL PROTECTED]>: > My optimized (and fixed) version of the code is attached. By the way. I don't know if this is relevant, but I'm curious if this approach is any faster: http://72.14.253.104/search?q=cache:kG4zvvkZPLYJ:www.haskell.org/hawiki/RunTimeCompilation I

Re: Re[2]: [Haskell-cafe] Ray tracer

2007-07-16 Thread ajb
G'day. Quoting Bulat Ziganshin <[EMAIL PROTECTED]>: > and why you stopped at 0.5? I left that job. Interestingly, I still own the IP on it, apart from some trade secret (namely the specific target language it was designed for). > was it due to haskell limitations or > something else? how haske

Re: [Haskell-cafe] Ray tracer

2007-07-15 Thread ajb
G'day all. Quoting Dan Piponi <[EMAIL PROTECTED]>: > But I don't think that means there is no role for Haskell in > rendering. Examples of places I think Haskell could play a role are: > the shader language, [...] For the record, I've written 2.5 production shader compilers. The 0.5 was in Hask

Re: [Haskell-cafe] Ray tracer

2007-07-15 Thread ajb
G'day all. By "production grade", I assumed that meant "suitable for use in a production". Quoting Sebastian Sylvan <[EMAIL PROTECTED]>: > Neither does mentalray! Correct! Most production renderers don't have GUIs. Anything that REQUIRES a GUI is by definition a toy because it can't be used i

Re: [Haskell-cafe] Ray tracer

2007-07-14 Thread ajb
G'day all. Quoting Andrew Coppin <[EMAIL PROTECTED]>: > The "Haskell ray tracer" seems to be a pretty standard and widely-used > example program. But has anybody ever seriously tried to make a > "production-grade" implementation? (I.e., one that is user-friendly, > efficient, and with lots of fun

Re: [Haskell-cafe] Indentation Creep

2007-07-14 Thread ajb
G'day. One small suggestion. Quoting Thomas Conway <[EMAIL PROTECTED]>: > Just (v,e) -> do > case e of > True -> [...] > False -> [...] This works just as well: Just (v,True) -> [...]

Re: Re[12]: [Haskell-cafe] Toy compression algorithms [was: A very edgy language]

2007-07-13 Thread ajb
G'day. Quoting Bulat Ziganshin <[EMAIL PROTECTED]>: > sorry, but you really misunderstand how PPM works and why it's so > efficient. I understand PPM. I really do. I think what you don't understand is why LZW does as well as it does considering how simple it is. It's because it's a poor but c

Re: Re[10]: [Haskell-cafe] Toy compression algorithms [was: A very edgy language]

2007-07-13 Thread ajb
G'day all. Quoting Bulat Ziganshin <[EMAIL PROTECTED]>: > it seems that you either misunderstood PPM or make too wide > assumptions. More likely I'm not explaining myself well. > in classical fixed-order ppm each char probability > found in context of previous N chars. i.e. when encoding abcdef

Re: Re[8]: [Haskell-cafe] Toy compression algorithms [was: A very edgy language]

2007-07-12 Thread ajb
G'day all. Quoting Bulat Ziganshin <[EMAIL PROTECTED]>: > in this case why you proposes to encode lzw words with a huffman > codes? :) I don't. :-) > oops. ppm build tree of contexts and use context to encode one char. > lzw builds dictionary of words and encode word in empty context. As you n

Re: Re[6]: [Haskell-cafe] Toy compression algorithms [was: A very edgy language]

2007-07-12 Thread ajb
G'day. Quoting Bulat Ziganshin <[EMAIL PROTECTED]>: > well, ppm differs from simple order-0 coder in that it uses previous > symbols to calculate probability. lzw differs from order-0 coder with > flat static probabilities in that it encodes a whole word each time. LZW doesn't have the concept o

Re: Re[4]: [Haskell-cafe] Toy compression algorithms [was: A very edgy language]

2007-07-11 Thread ajb
G'day. Quoting Bulat Ziganshin <[EMAIL PROTECTED]>: > what you mean by "flat" and "static" applied to PPM? static PPM models > exist - they carry probabilities as separate table very like static > Huffman encoding. is "flat" the same as order-0? "Static" means that the frequency distribution is

Re: Re[2]: [Haskell-cafe] Toy compression algorithms [was: A very edgy language]

2007-07-10 Thread ajb
G'day all. Andrew Coppin wrote: > > Actually, LZW works surprisingly well for such a trivial little > > algorithm... When you compare it to the complexity of an arithmetic > > coder driven by a high-order adaptive PPM model (theoretically the best > > general-purpose algorithm that exists), it's

Re: [Haskell-cafe] Clearly, Haskell is ill-founded

2007-07-10 Thread ajb
G'day all. Quoting Stefan O'Rear <[EMAIL PROTECTED]>: > Data can only be constructed using constructors, but can be > deconstructed [...] You mean "nstructed". Now if you'l excuse me, I'm off to write some "de". Cheers, Andrew Bromage ___ Haskell-Caf

Re: [Haskell-cafe] Re: In-place modification

2007-07-10 Thread ajb
G'day all. Quoting Sebastian Sylvan <[EMAIL PROTECTED]>: > Depends on your definition of "widely used". There are more digital watches, freebie four-function calculators, irritating-music-playing doorbells and furby-like toys pumped out every year than there are PCs, servers, routers and mainfra

Re: [Haskell-cafe] Collections

2007-06-22 Thread ajb
G'day. Quoting Andrew Coppin <[EMAIL PROTECTED]>: > True enough - but that's a rather specific task. There are a lot of rather specific tasks out there. Cheers, Andrew Bromage ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.o

Re: [Haskell-cafe] FP v. OOP

2007-06-04 Thread ajb
G'day all. Quoting PR Stanley <[EMAIL PROTECTED]>: > Discuss. Here, have a deceased equine and a cat o' nine tails. Please wait until I get to minimum safe distance before continuing. Thanks! Cheers, Andrew Bromage ___ Haskell-Cafe mailing list Haske

Re: [Haskell-cafe] data PLZ a

2007-05-29 Thread ajb
G'day all. Quoting Dan Mead <[EMAIL PROTECTED]>: > is that your implementation of LOLCODE? O HAI IM IN UR CODE REDUCIN' UR REDEKZEZ BURNIN' UR MEGAHURTZ Cheers, Andrew Bromage P.S. This is harder than writing l33t. ___ Ha

Re: [Haskell-cafe] New book: Real-World Haskell!

2007-05-24 Thread ajb
G'day all. Quoting Donald Bruce Stewart <[EMAIL PROTECTED]>: > I'd just add that the response is literally overwhelming! As opposed to figuratively overwhelming? I'm certain this book will have a very good editor at O'Reilly! Cheers, Andrew Bromage _

Re: [Haskell-cafe] Sudoku solving

2007-05-10 Thread ajb
G'day all. Quoting Antoine Latter <[EMAIL PROTECTED]>: > I'm a relatively new to Haskell, so I figured I needed to write a Sudoku > solver. Excellent! Please add it to the wiki: http://www.haskell.org/haskellwiki/Sudoku > The key features of this solver are: > > * It's longer than other

Re: [Haskell-cafe] Bloom Filter

2007-05-02 Thread ajb
G'day all. Quoting Henning Thielemann <[EMAIL PROTECTED]>: > Why replacing the almost-function 'if' by a special syntactic construct? In a sense, this is entirely stylistic. One works just as well as the other. But I think it's superior in this case (obviously not all cases) because this is at

Re: FW: [Haskell-cafe] RE:Cross-over from Haskell.org [Haskell] Re: Newbie: what are the advantages of Haskell?

2007-05-02 Thread ajb
G'day all. Quoting "Michael T. Richter" <[EMAIL PROTECTED]>: > Ummm... Udo? Just what the fuck did you hope to accomplish with this > kind of talk? Guys, could we keep it civil on the list, please? And for the record: http://www.perl.com/pub/2000/12/advocacy.html Cheers, Andrew Bromage

Re: [Haskell-cafe] Bloom Filter

2007-05-01 Thread ajb
G'day all. I wrote: > > insert :: a -> Bloom a -> Bloom a > > > > That way, you can use it with foldr. Quoting Josef Svenningsson <[EMAIL PROTECTED]>: > Hmmm. If you want to create a Bloom using a fold wouldn't it make more > sense to use foldl'? I think the argument order is fine. You're

Re: [Haskell-cafe] Bloom Filter

2007-05-01 Thread ajb
G'day all. Quoting Dom <[EMAIL PROTECTED]>: > But better than what is in Codec.Utils: [deletia] > It seems a shame that everyone has to roll their own. That and integer log base 2. Cheers, Andrew Bromage ___ Haskell-Cafe mailing list Haskell-Cafe@hask

Re: [Haskell-cafe] Bloom Filter

2007-04-30 Thread ajb
G'day. Quoting tom <[EMAIL PROTECTED]>: > I'm pretty new to Haskell, I've been working on a Bloom filter[1] > implementation as a learning exercise. Excellent! Sounds like a fun test. > I'd really appreciate it if someone more experienced would comment on > the code. I'm sure there's plenty of

Re: [Haskell-cafe] faster factorial function via FFI?

2007-04-24 Thread ajb
G'day all. Quoting Bryan O'Sullivan <[EMAIL PROTECTED]>: > Well... The zipWith (^) should be map (uncurry (^)). Err... yes. > And the performance of this approach is strongly dependent on the > efficiency of your prime sieve, so you're moving the complexity around, > not eliminating it. Yes an

Re: [Haskell-cafe] faster factorial function via FFI?

2007-04-23 Thread ajb
G'day all. Quoting Dan Weston <[EMAIL PROTECTED]>: > Why all the fuss? n! is in fact very easily *completely* factored into > prime numbers [...] It's even easier than that. primePowerOf :: Integer -> Integer -> Integer primePowerOf n p = (n - s p n) `div` (p-1) where s p 0 = 0 s p

Re: [Haskell-cafe] How Albus Dumbledore would sell Haskell

2007-04-19 Thread ajb
G'day all. Quoting Isaac Dupree <[EMAIL PROTECTED]>: > Okay, looking at that code: > The comments before the type definitions are mostly good... > now it looks like I'm going into critique mode :) BTW, for the record, I didn't try too hard with this. It is meant to be illustrative of what you c

RE: [Haskell-cafe] How Albus Dumbledore would sell Haskell

2007-04-19 Thread ajb
G'day all. Quoting Simon Peyton-Jones <[EMAIL PROTECTED]>: > Lots of interesting ideas on this thread, and Haskell-Cafe threads are > *supposed* to wander a bit. But, just to remind you all: I'm particularly > interested in > > concrete examples (pref running code) of programs that are >

Re: [Haskell-cafe] Re: Tutorial on Haskell

2007-04-17 Thread ajb
G'day all. Quoting apfelmus <[EMAIL PROTECTED]>: > (Btw, pairs (Int,Int) are members of the Ix class as well, so there is > no need to generate an array of arrays. I know. It originally used lists, which is why it looks like that. I only allowed myself half an hour to write & debug this, so wh

Re: [Haskell-cafe] Tutorial on Haskell

2007-04-17 Thread ajb
G'day all. I wrote: > I think you could. What you need to convince a strict programmer of is > that laziness gives you modularity. The Graham Hutton Sudoku solver is > a nice example, but it'd be cool if we had a similar example that was > less cheesy than Sudoku. OK, it's not pretty, but this

Re: [Haskell-cafe] Tutorial on Haskell

2007-04-16 Thread ajb
G'day all. Quoting Neil Mitchell <[EMAIL PROTECTED]>: > I think its important to cover whats different about Haskell. Things > like laziness are cool, but are harder to convince a strict programmer > that they are useful. I think you could. What you need to convince a strict programmer of is th

Re: [Haskell-cafe] k-minima in Haskell

2007-04-14 Thread ajb
G'day all. I wrote: > > O(log(n! / (n-k)!)) > > = O(n log n - (n-k) log (n-k)) > > = O(n log (n/(n-k)) + k log (n-k)) > > > > That looks right to me. If k << n, then this simplifies to > > O(n + k log n), and if k is close to n, it simplifies to > > O(n log n + k). Quoting Ian Lynagh <[EMAIL

Re: [Haskell-cafe] k-minima in Haskell

2007-04-13 Thread ajb
G'day all. Quoting Thomas Hartman <[EMAIL PROTECTED]>: > Does that mean you can have the k minima in O(n) time, where n is > length of list, which would seem to be an improvement? It's worth considering what the theoretical minimum is. You have n elements, and you need to locate a specific k-el

Re: [Haskell-cafe] Re: k-minima in Haskell

2007-04-12 Thread ajb
G'day all. Quoting apfelmus <[EMAIL PROTECTED]>: > You mean O(k * log n + n) of course. Erm, yes. You can do it in an imperative language by building a heap in O(n) time followed by removing k elements, in O(k log n) time. Cheers, Andrew Bromage ___

Re: [Haskell-cafe] k-minima in Haskell

2007-04-12 Thread ajb
G'day all. Quoting Kurt Hutchinson <[EMAIL PROTECTED]>: > For my own edification, what is the benefit of this sortWith over sortBy? None. I wanted to write my own sort, illustrating how the lazy evaluation thing works, and I didn't want a name clash with an existing library function. Cheers, A

Re: [Haskell-cafe] k-minima in Haskell

2007-04-11 Thread ajb
G'day all. Quoting raghu vardhan <[EMAIL PROTECTED]>: > So, any algorithm that sorts is no good (think of n as huge, and k small). The essence of all the answers that you've received is that it doesn't matter if k is small, sorting is still the most elegant answer in Haskell. The reason is that

Re: [Haskell-cafe] k-minima in Haskell

2007-04-11 Thread ajb
G'day all. Quoting raghu vardhan <[EMAIL PROTECTED]>: > What's the best way to implement the following function in haskell: > Given a list and an integer k as input return the indices of the least k > elements in the list. The code should be elegant and also, more importantly, > must not make mor

Re: [Haskell-cafe] Why the Prelude must die

2007-03-25 Thread ajb
G'day all. Quoting Neil Mitchell <[EMAIL PROTECTED]>: > Yes. It will break 100's of applications. That sounds like a challenge! Find me 100 applications that use Data.Map.map and I will eat crow. Cheers, Andrew Bromage ___ Haskell-Cafe mailing list H

<    1   2   3   4   >