[Haskell-cafe] Wouter-style expressions

2008-06-04 Thread Ron Alford
Here's something that should be an easy extension of Wouter's approach to extensible datatypes, but I'm failing (possibly since it's 2:20am). I several classes of expressions I'm trying to represent (thus, Wouter's approach), and my first operation to implement over them is printing. Attached

Re: [Haskell-cafe] More on performance

2008-06-04 Thread Henning Thielemann
On Tue, 3 Jun 2008, Don Stewart wrote: I wrote up the second part of the tour of understanding low level performance in GHC here, http://reddit.com/r/programming/info/6lx36/comments/ Follows on from the discussion last week about various performance related things. Now the difficult

Re: [Haskell-cafe] Laziness leaks

2008-06-04 Thread Bernie Pope
On 04/06/2008, at 10:12 AM, Ronald Guida wrote: I would ask, how do I examine the evaluation order of my code, but the answer is already available: use a debugger. Haskell already has debugging tools that do exactly what I need. (http://www.haskell.org/haskellwiki/Debugging) In particular,

Re: [Haskell-cafe] Wouter-style expressions

2008-06-04 Thread Wouter Swierstra
Hi Ron, I've attached a revised file that solves your problem. The solution is actually quite subtle. If you define the class as: class Functor f = Printable f where exprDoc :: f t - Doc you can't make recursive calls to sub-expressions. There is, after all, no reason to believe that t is

Re: [Haskell-cafe] A simple beginner question

2008-06-04 Thread Yitzchak Gale
Adam Smyczek wrote: data SampleType = A | B Int | C String | D -- etc. sampleTypes = [A, B 5, C test] :: [SampleType] How do I find for example element A in the sampleTypes list? There have been many useful replies. But since Adam originally announced that this is a beginner question, I

[Haskell-cafe] Re: [ANNOUNCE] git-darcs-import 0.1

2008-06-04 Thread Peter Hercek
Aaron Denney wrote: This is drifting off-topic, but... On 2008-06-03, Peter Hercek [EMAIL PROTECTED] wrote: Aaron Denney wrote: --- cut --- Darcs patches are pretty much an implicit rebase. You cannot push patch B if it depends on patch A without also pushing A. And darcs currently does

Re: [Haskell-cafe] Laziness leaks

2008-06-04 Thread Jules Bean
Ronald Guida wrote: [snip] By default, a lazy language will procrastinate. By default, a strict language will anticrastinate. Either way, I can waste resources by blindly accepting the default time management plan. Nice analysis. Would you like to put that (the whole thing, not just that

RE: [Haskell-cafe] problems with derive/TH

2008-06-04 Thread Simon Peyton-Jones
| World.hs:42:0: |No instances for (Eq (a (M.Map String Player)), | Eq (a (M.Map ItemId Item)), | Eq (a (M.Map PlayerId Player)), | Eq (a (M.Map RoomId Room)), | Eq (a RoomId)) | arising from the

Re: [Haskell-cafe] HDBC-odbc 1.1.4.4 fixes Windows linking problems

2008-06-04 Thread Greg Matheson
On Wed, 04 Jun 2008, Andrew Appleyard wrote: Prelude Database.HDBC Database.HDBC.ODBC handleSqlError $ conn - connectODBC dictation interactive:1:0: Parse error in pattern Try: conn - handleSqlError $ connectODBC dictation C:\cygwin\home\Administratordictation dictation: user error

Re: [Haskell-cafe] More on performance

2008-06-04 Thread Duncan Coutts
On Wed, 2008-06-04 at 09:32 +0200, Henning Thielemann wrote: On Tue, 3 Jun 2008, Don Stewart wrote: I wrote up the second part of the tour of understanding low level performance in GHC here, http://reddit.com/r/programming/info/6lx36/comments/ Follows on from the discussion

Re: [Haskell-cafe] More on performance

2008-06-04 Thread Loup Vaillant
[Forgot to post to the list, sorry] 2008/6/4 Duncan Coutts [EMAIL PROTECTED]: On Wed, 2008-06-04 at 09:32 +0200, Henning Thielemann wrote: On Tue, 3 Jun 2008, Don Stewart wrote: I wrote up the second part of the tour of understanding low level performance in GHC here,

Re: [Haskell-cafe] More on performance

2008-06-04 Thread Ketil Malde
Henning Thielemann [EMAIL PROTECTED] writes: Now the difficult question: How to write the 'mean' function in terms of 'sum' and 'length' while getting the same performance? Write a RULE pragma converting \xs - (foldl' f y0 xs,foldl' g z0 xs) into \xs - foldl' (\(y,z) x - (f y x,g z x))

Re: [Haskell-cafe] More on performance

2008-06-04 Thread Henning Thielemann
On Wed, 4 Jun 2008, Duncan Coutts wrote: On Wed, 2008-06-04 at 09:32 +0200, Henning Thielemann wrote: Now the difficult question: How to write the 'mean' function in terms of 'sum' and 'length' while getting the same performance? There's another rather harder fusion transformation that

[Haskell-cafe] Re: [ANNOUNCE] git-darcs-import 0.1

2008-06-04 Thread apfelmus
Peter Hercek wrote: But what about this git rebasing option? How to do it more easily (than the solution I know and I described it later) in darcs? using git-rebase --onto master next topic to get from: o---o---o---o---o master \ o---o---o---o---o next

[Haskell-cafe] Re: Laziness leaks

2008-06-04 Thread apfelmus
Ronald Guida wrote: So I just thought of something. If laziness leads to laziness leaks, then is there such a thing as a strictness leak? I realized that the answer is yes. A lazy leak is a situation where I'm wasting resources to delay a sequence of calculations instead of just doing them

Re: [Haskell-cafe] More on performance

2008-06-04 Thread Luke Palmer
On Wed, Jun 4, 2008 at 9:48 AM, Loup Vaillant [EMAIL PROTECTED] wrote: I see a problem with this particular fusion, though: It changes the space complexity of the program, from linear to constant. Therefore, with some programs, relying on this optimization can be a matter of correctness, not

[Haskell-cafe] Re: Ubuntu and ghc

2008-06-04 Thread Simon Marlow
Claus Reinke wrote: - i don't want to have to remove anything explicitly, becausethat would mean bypassing the haskell installation managers - i would want to see a single haskell installation manager for each system, I think that's fundamentally the wrong approach. We shouldn't have

[Haskell-cafe] Re: [ANNOUNCE] git-darcs-import 0.1

2008-06-04 Thread Aaron Denney
On 2008-06-04, Peter Hercek [EMAIL PROTECTED] wrote: But what about this git rebasing option? How to do it more easily (than the solution I know and I described it later) in darcs? using git-rebase --onto master next topic to get from: o---o---o---o---o master \

[Haskell-cafe] Re: [ANNOUNCE] git-darcs-import 0.1

2008-06-04 Thread Aaron Denney
On 2008-06-04, apfelmus [EMAIL PROTECTED] wrote: Peter Hercek wrote: But what about this git rebasing option? How to do it more easily (than the solution I know and I described it later) in darcs? using git-rebase --onto master next topic to get from: to: o---o---o---o---o master

RE: [Haskell-cafe] More on performance

2008-06-04 Thread Sittampalam, Ganesh
I wonder what can be said about stable optimizations which are insensitive to their environments in some sense. http://citeseer.ist.psu.edu/veldhuizen02guaranteed.html Ganesh == Please access the attached hyperlink for

Re: [Haskell-cafe] More on performance

2008-06-04 Thread Jon Harrop
On Wednesday 04 June 2008 11:05:52 Luke Palmer wrote: To me, time and space complexity is not about correctness but performance. IRL the specification often dictates the complexity. If your code fails to satisfy the spec then it is wrong. Are you saying that Haskell code can never satisfy any

Re: [Haskell-cafe] More on performance

2008-06-04 Thread Henning Thielemann
On Wed, 4 Jun 2008, Luke Palmer wrote: On Wed, Jun 4, 2008 at 9:48 AM, Loup Vaillant [EMAIL PROTECTED] wrote: I see a problem with this particular fusion, though: It changes the space complexity of the program, from linear to constant. Therefore, with some programs, relying on this

[Haskell-cafe] Re: Ubuntu and ghc

2008-06-04 Thread Achim Schneider
Simon Marlow [EMAIL PROTECTED] wrote: Claus Reinke wrote: - i don't want to have to remove anything explicitly, because that would mean bypassing the haskell installation managers - i would want to see a single haskell installation manager for each system, I think that's

Re: [Haskell-cafe] Re: Ubuntu and ghc

2008-06-04 Thread Ketil Malde
Achim Schneider [EMAIL PROTECTED] writes: Caveat: I have only a vague grasp on what exactly is being criticized here - using a modern Linux distribution, tons of packages are available, and almost all issues Claus point out seem to be taken care of - at least as far as I can see. Well, then

Re: [Haskell-cafe] Re: Ubuntu and ghc

2008-06-04 Thread Duncan Coutts
On Wed, 2008-06-04 at 14:54 +0200, Ketil Malde wrote: You have a point, though, and I wouldn't mind at all cabal-install being integrated into portage, I'm not too familiar with portage, but I think a better solution is to provide tools to automatically generate packages for the various

RE: [Haskell-cafe] Re: Ubuntu and ghc

2008-06-04 Thread Re, Joseph (IT)
Not sure about it's current state, but a friend was working on this until he graduated recently: http://www.acm.uiuc.edu/projects/Wipt -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ketil Malde Aren't there any usable third-party package managers for

Re: [Haskell-cafe] Re: Ubuntu and ghc

2008-06-04 Thread Duncan Coutts
On Wed, 2008-06-04 at 11:33 +0100, Simon Marlow wrote: Claus Reinke wrote: - i don't want to have to remove anything explicitly, becausethat would mean bypassing the haskell installation managers - i would want to see a single haskell installation manager for each system, I

[Haskell-cafe] Re: Ubuntu and ghc

2008-06-04 Thread Achim Schneider
Ketil Malde [EMAIL PROTECTED] wrote: Achim Schneider [EMAIL PROTECTED] writes: Caveat: I have only a vague grasp on what exactly is being criticized here - using a modern Linux distribution, tons of packages are available, and almost all issues Claus point out seem to be taken care of - at

[Haskell-cafe] Installing Haskore under Windows

2008-06-04 Thread David
Hi! I'm currently running ghc under Windows XP and want to play around with Haskore, but I'm a little confused about how to install it, or if it's even possible to use it with ghc. The 'readme' file contains this note: Note that the file ghc_add/IOExtensions.hs is a partial replacement of a

[Haskell-cafe] Re: [ANNOUNCE] git-darcs-import 0.1

2008-06-04 Thread Peter Hercek
Aaron Denney wrote: On 2008-06-04, apfelmus [EMAIL PROTECTED] wrote: -- cut -- Or the next-topic path relies on features from next that are not present in master . But then, you're screwed anyway Yep. Well not really, depends what kind the dependency is, this kind of rebase is useful

[Haskell-cafe] Re: library for drawing charts

2008-06-04 Thread Neal Alexander
Tim Docker wrote: Peter wrote: Has anyone got some code for drawing charts? I don't mean graphs of functions, ala http://dockerz.net/twd/HaskellCharts ... I would like something that can generate PNGs in memory, i.e. not directly to a file. The library at the above URL supports a range of

Re: [Haskell-cafe] Installing Haskore under Windows

2008-06-04 Thread Henning Thielemann
On Wed, 4 Jun 2008, David wrote: I'm currently running ghc under Windows XP and want to play around with Haskore, but I'm a little confused about how to install it, or if it's even possible to use it with ghc. The 'readme' file contains this note: You can also use Haskore with GHC. For an

Re: [Haskell-cafe] Re: Ubuntu and ghc

2008-06-04 Thread Ross Paterson
On Wed, Jun 04, 2008 at 02:22:07PM +0100, Duncan Coutts wrote: As I see it we need both. We need to make it easy to translate cabal packages into distro packages. We do have tools to do that at the moment for Gentoo, Debian and Fedora. I'm sure they could be improved. However we cannot

cabal and platform-independent haskell installation management (again) (Re: [Haskell-cafe] Re: Ubuntu and ghc)

2008-06-04 Thread Claus Reinke
I think that's fundamentally the wrong approach. We shouldn't have to build a Haskell installation manager. Would you also want installation managers for Perl, Python, Ruby, C, C++, etc. each with their own different user interfaces and feature sets? I think not - you want a single package

Re: [Haskell-cafe] Re: Ubuntu and ghc

2008-06-04 Thread Duncan Coutts
On Wed, 2008-06-04 at 15:25 +0200, Achim Schneider wrote: Well, you have a point but still don't have one. Many of gentoo's haskell .ebuilds are seriously outdated, eg. wxhaskell still depends on ghc 6.4. See Damnit, we need a CPAN The haskell overlay features about 240 packages from alex

Re: cabal and platform-independent haskell installation management (again) (Re: [Haskell-cafe] Re: Ubuntu and ghc)

2008-06-04 Thread Duncan Coutts
On Wed, 2008-06-04 at 15:14 +0100, Claus Reinke wrote: I think that's fundamentally the wrong approach. We shouldn't have to build a Haskell installation manager. Would you also want installation managers for Perl, Python, Ruby, C, C++, etc. each with their own different user

Re: cabal and platform-independent haskell installation management (again) (Re: [Haskell-cafe] Re: Ubuntu and ghc)

2008-06-04 Thread Darrin Thompson
On Wed, Jun 4, 2008 at 10:14 AM, Claus Reinke [EMAIL PROTECTED] wrote: - it isn't sufficient to worry about installation management, one has to worry about integration, lifetime and uninstall management as well. in short, maintain the dependency graphs over any of

[Haskell-cafe] Re: cabal and platform-independent haskell installation management (again) (Re: Re: Ubuntu and ghc)

2008-06-04 Thread Achim Schneider
Duncan Coutts [EMAIL PROTECTED] wrote: On Wed, 2008-06-04 at 15:14 +0100, Claus Reinke wrote: I think that's fundamentally the wrong approach. We shouldn't have to build a Haskell installation manager. Would you also want installation managers for Perl, Python, Ruby, C, C++, etc.

Re: [Haskell-cafe] What is the maturity of Haskell Web Frameworks

2008-06-04 Thread John Goerzen
Duncan Coutts wrote: On Tue, 2008-06-03 at 10:23 -0700, Don Stewart wrote: A new version of happs was written on a Monday a couple of months ago, using fastcgi and takusen. We're running it at galois, and you can find the code on code.haskell.org/hpaste. So not quite what you wanted, but

Re: [Haskell-cafe] HDBC-odbc 1.1.4.4 fixes Windows linking problems

2008-06-04 Thread John Goerzen
Greg Matheson wrote: On Tue, 03 Jun 2008, John Goerzen wrote: Hi, HDBC-odbc version 1.1.4.4 has been uploaded to Hackage. It fixes the problems some here have encountered regarding ODBC crashes or other similar odd behavior on Windows. I'm getting a 'Parse error in pattern' error.

Re: [Haskell-cafe] [ANNOUNCE] git-darcs-import 0.1

2008-06-04 Thread John Goerzen
Loup Vaillant wrote: 2008/6/3 Darrin Thompson [EMAIL PROTECTED]: On Sun, Jun 1, 2008 at 2:44 PM, Bertram Felgenhauer [EMAIL PROTECTED] wrote: Hi, I'm pleased to announce yet another tool for importing darcs repositories to git. Unlike darcs2git [1] and darcs-to-git [2], it's written in

[Haskell-cafe] ICFP2008 Call for Poster proposals

2008-06-04 Thread Matthew Fluet (ICFP Publicity Chair)
ICFP 2008 poster session September 21, 2008 Call for presentation proposals ICFP 2008 will feature a poster session for researchers and practitioners, including students. The session will provide friendly feedback for work that is in gestation or ongoing, as well as opportunities to meet each

[Haskell-cafe] [ANN] hs-pgms 0.1 -- Programmer's Minesweeper in Haskell

2008-06-04 Thread Bertram Felgenhauer
Hi, I've just uploaded hs-pgms to hackage. It is a Haskell implementation of Programmer's Minesweeper [1], which allows programmers to implement minesweeper strategies and run them. (Note: ghc = 6.8 is required.) hs-pgms uses MonadPrompt to achieve a clean separation between strategies, game

Re: [Haskell-cafe] More on performance

2008-06-04 Thread Albert Y. C. Lai
Jon Harrop wrote: IRL the specification often dictates the complexity. If your code fails to satisfy the spec then it is wrong. Are you saying that Haskell code can never satisfy any such specification? In addition to RL, it it should and it can in theory too:

Re: [Haskell-cafe] Re: Laziness leaks

2008-06-04 Thread Albert Y. C. Lai
apfelmus wrote: I haven't heard the terms laziness leak and strictness leak before, imho they sound a bit spooky because it's not clear to me what the situation without leak would be. (Time vs Space? Is an O(n) algorithm a strictness leak compared to an O(log n) algorithm?) Leak refers to a

Re: [Haskell-cafe] What is the maturity of Haskell Web Frameworks

2008-06-04 Thread Sterling Clover
hvac sounds interesting but at that time at least it was not clear whether it was stable or would continue to be maintained. xhtml and HStringTemplate were overkill for what I wanted, so I wound up just using the FastCGI and CGI toolkits themselves. They are surprisingly nice, and with a

Re: [Haskell-cafe] More on performance

2008-06-04 Thread Sterling Clover
On Jun 4, 2008, at 5:51 AM, Henning Thielemann wrote: How about assisting the compiler with a helper function named 'parallel' ? parallel :: ([a] - b, [a] - c) - [a] - (b,c) parallel (f,g) xs = (f xs, g xs) mean xs = uncurry (/) $ parallel (sum,length) xs ? We could state RULES in terms

Re: [Haskell-cafe] What is the maturity of Haskell Web Frameworks

2008-06-04 Thread Don Stewart
s.clover: hvac sounds interesting but at that time at least it was not clear whether it was stable or would continue to be maintained. xhtml and HStringTemplate were overkill for what I wanted, so I wound up just using the FastCGI and CGI toolkits themselves. They are surprisingly

[Haskell-cafe] How would you hack it?

2008-06-04 Thread Andrew Coppin
So anyway, today I found myself wanting to build a program that generates some test data. I managed to make it *work* without too much difficulty, but it wasn't exactly elegant. I'm curios to know how higher-order minds would approach this problem. It's not an especially hard problem, and I'm

[Haskell-cafe] very hard to build darcs with win32 ghc-6.8.2!

2008-06-04 Thread Tim Newsham
I built darcs for win32 recently and it was much more difficult than it should be. Probably most of the blame goes to ghc-6.8.2 binary release for win32. Half of the effort is getting the zlib prereq working. Previously to build zlib for win32 ghc I did the following:

Re: [Haskell-cafe] How would you hack it?

2008-06-04 Thread Bulat Ziganshin
Hello Andrew, Wednesday, June 4, 2008, 10:33:00 PM, you wrote: I have a file that contains several thousand words, seperated by white space. [I gather that on Unix there's a standard location for this file?] I want to end up with a file that contains a randomly-chosen selection of words.

Re: [Haskell-cafe] How would you hack it?

2008-06-04 Thread Gregory Collins
Andrew Coppin [EMAIL PROTECTED] writes: Clearly, what I *should* have done is think more about a good abstraction before writing miles of code. ;-) So how would you guys do this? If you want text that roughly resembles English, you're better off getting a corpus of real English text and

[Haskell-cafe] Re: How would you hack it?

2008-06-04 Thread Achim Schneider
Andrew Coppin [EMAIL PROTECTED] wrote: I have a file that contains several thousand words, seperated by white space. [I gather that on Unix there's a standard location for this file?] Looking at /usr/share/dict/words, I'm assured that the proper seperator is \n. Clearly, what I *should*

Re: [Haskell-cafe] What is the maturity of Haskell Web Frameworks

2008-06-04 Thread John Goerzen
Sterling Clover wrote: hvac sounds interesting but at that time at least it was not clear whether it was stable or would continue to be maintained. xhtml and HStringTemplate were overkill for what I wanted, so I wound up just using the FastCGI and CGI toolkits themselves. They are

[Haskell-cafe] Re: How would you hack it?

2008-06-04 Thread Achim Schneider
Gregory Collins [EMAIL PROTECTED] wrote: Andrew Coppin [EMAIL PROTECTED] writes: Clearly, what I *should* have done is think more about a good abstraction before writing miles of code. ;-) So how would you guys do this? If you want text that roughly resembles English, you're better

Re: [Haskell-cafe] How would you hack it?

2008-06-04 Thread Henning Thielemann
On Wed, 4 Jun 2008, Andrew Coppin wrote: How would you do this? The approach I came up with is to slurp up the words like so: raw - readFile words.txt let ws = words raw let n = length ws let wa = listArray (1,n) ws (I actually used lazy ByteStrings of characters.) So now I

Re: [Haskell-cafe] Re: How would you hack it?

2008-06-04 Thread Henning Thielemann
On Wed, 4 Jun 2008, Achim Schneider wrote: Gregory Collins [EMAIL PROTECTED] wrote: Andrew Coppin [EMAIL PROTECTED] writes: Clearly, what I *should* have done is think more about a good abstraction before writing miles of code. ;-) So how would you guys do this? If you want

Re: [Haskell-cafe] How would you hack it?

2008-06-04 Thread Andrew Coppin
Gregory Collins wrote: Andrew Coppin [EMAIL PROTECTED] writes: Clearly, what I *should* have done is think more about a good abstraction before writing miles of code. ;-) So how would you guys do this? If you want text that roughly resembles English, you're better off getting a

Re: [Haskell-cafe] Re: How would you hack it?

2008-06-04 Thread Andrew Coppin
Achim Schneider wrote: Andrew Coppin [EMAIL PROTECTED] wrote: I have a file that contains several thousand words, seperated by white space. [I gather that on Unix there's a standard location for this file?] Looking at /usr/share/dict/words, I'm assured that the proper seperator is \n.

[Haskell-cafe] Re: How would you hack it?

2008-06-04 Thread Achim Schneider
Andrew Coppin [EMAIL PROTECTED] wrote: Achim Schneider wrote: Andrew Coppin [EMAIL PROTECTED] wrote: I have a file that contains several thousand words, seperated by white space. [I gather that on Unix there's a standard location for this file?] Looking at /usr/share/dict/words,

Re: [Haskell-cafe] very hard to build darcs with win32 ghc-6.8.2!

2008-06-04 Thread Daniel Fischer
Am Mittwoch, 4. Juni 2008 22:26 schrieb Tim Newsham: Here's a small test program which uses FFI to SleepEx which I was not able to get working with win32 ghc-6.8.2. -- {-# OPTIONS -fglasgow-exts -fffi #-} module Main where import Foreign.C.Types foreign import ccall SleepEx c_SleepEx

Re: [Haskell-cafe] How would you hack it?

2008-06-04 Thread Andrew Coppin
Henning Thielemann wrote: Sounds like a generator for scientific articles. :-) Maybe http://hackage.haskell.org/cgi-bin/hackage-scripts/package/markov-chain can be of help for you. It's also free of randomIO. That certainly looks interesting. Presumably if I train it right, it'll

Re: [Haskell-cafe] How would you hack it?

2008-06-04 Thread John Melesky
On Jun 4, 2008, at 3:50 PM, Andrew Coppin wrote: However, if you can find me a source that explains what a Markov chain actually *is*, I'd be quite interested. In a non-rigorous nutshell: You have the word star. You want to pick another word to follow it. It turns out that, based on

Re: [Haskell-cafe] How would you hack it?

2008-06-04 Thread Lanny Ripple
You might want to skim Shannon's 'A Mathematical Theory of Communcations'. Part 1, Section 2 and 3 are almost exactly your topic. (Or at least the direction you've headed in. :) http://plan9.bell-labs.com/cm/ms/what/shannonday/shannon1948.pdf -ljr Andrew Coppin wrote: Henning Thielemann

Re: [Haskell-cafe] Re: cabal and platform-independent haskell installation management (again) (Re: Re: Ubuntu and ghc)

2008-06-04 Thread Duncan Coutts
On Wed, 2008-06-04 at 17:22 +0200, Achim Schneider wrote: The question, IMHO, seems to be How would a package manager for a posix-compilant kinetic look like? http://nixos.org/index.html Duncan ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] very hard to build darcs with win32 ghc-6.8.2!

2008-06-04 Thread Duncan Coutts
On Wed, 2008-06-04 at 10:26 -1000, Tim Newsham wrote: I built darcs for win32 recently and it was much more difficult than it should be. Probably most of the blame goes to ghc-6.8.2 binary release for win32. Half of the effort is getting the zlib prereq working. Previously to build zlib

Re: [Haskell-cafe] Re: Laziness leaks

2008-06-04 Thread Ryan Ingram
On 6/4/08, apfelmus [EMAIL PROTECTED] wrote: Note that lazy evaluation never wastes time; evaluating a term with lazy evaluation will always take less reduction steps than doing so eagerly or partly eagerly. True, but you can still have a time leak; this is particularily relevant in

Re: [Haskell-cafe] What is the maturity of Haskell Web Frameworks

2008-06-04 Thread Paul L
Pardon me to hijack this thread, but I have an idea to build a different kind of Web Framework and am not sure if somebody has already done it. The idea is to take REST further: every HTML page you see is a program in its running state (as a continuation monad). Each click on its link or form

[Haskell-cafe] Re: What is the maturity of Haskell Web Frameworks

2008-06-04 Thread Achim Schneider
Paul L [EMAIL PROTECTED] wrote: Does such a beast exist or am I entirely day dreaming? Daydreaming, at least partly: Just consider state that can't be stored client-side at all, e.g. the contents of a wiki page. Networking or HTML as interface isn't the real problem: It's the multi-headedness

Re: [Haskell-cafe] How would you hack it?

2008-06-04 Thread Evan Laforge
On Wed, Jun 4, 2008 at 3:23 PM, Lanny Ripple [EMAIL PROTECTED] wrote: You might want to skim Shannon's 'A Mathematical Theory of Communcations'. Part 1, Section 2 and 3 are almost exactly your topic. (Or at least the direction you've headed in. :)

[Haskell-cafe] Re: Laziness leaks

2008-06-04 Thread Achim Schneider
Ryan Ingram [EMAIL PROTECTED] wrote: On 6/4/08, apfelmus [EMAIL PROTECTED] wrote: Note that lazy evaluation never wastes time; evaluating a term with lazy evaluation will always take less reduction steps than doing so eagerly or partly eagerly. True, but you can still have a time leak;

Re: [Haskell-cafe] What is the maturity of Haskell Web Frameworks

2008-06-04 Thread Brandon S. Allbery KF8NH
On 2008 Jun 4, at 22:30, Paul L wrote: The server is then very much like a VM or an interpreter of an embedded language, with execution stacks entirely encoded and stored in each HTML page sent to the user and back from the user as an encoded URL or form data. So the server is entirely

Re[2]: [Haskell-cafe] How would you hack it?

2008-06-04 Thread Bulat Ziganshin
Hello Henning, Thursday, June 5, 2008, 12:55:19 AM, you wrote: Sounds like a generator for scientific articles. :-) Maybe http://hackage.haskell.org/cgi-bin/hackage-scripts/package/markov-chain can be of help for you. It's also free of randomIO. once i've used something like this to

Re[2]: [Haskell-cafe] How would you hack it?

2008-06-04 Thread Bulat Ziganshin
Hello Andrew, Thursday, June 5, 2008, 12:50:28 AM, you wrote: However, if you can find me a source that explains what a Markov chain actually *is*, I'd be quite interested. *afaik*, the idea is simple: order-1 Markov chain is just text generated with respect of probability of each char, and

Re: [Haskell-cafe] Re: library for drawing charts

2008-06-04 Thread Tim Docker
Neal Alexander wrote: I was using the HaskellCharts library and needed the same two things; so i rolled a quick and dirty pie chart generator (Barchart is on the TODO list). http://72.167.145.184:8000/Screenshot.png http://72.167.145.184:8000/PieChart.hs Nice! Do you mind if I refactor

Re: [Haskell-cafe] How would you hack it?

2008-06-04 Thread Henning Thielemann
On Wed, 4 Jun 2008, Andrew Coppin wrote: Henning Thielemann wrote: Sounds like a generator for scientific articles. :-) Maybe http://hackage.haskell.org/cgi-bin/hackage-scripts/package/markov-chain can be of help for you. It's also free of randomIO. That certainly looks

Re: [Haskell-cafe] How would you hack it?

2008-06-04 Thread Henning Thielemann
On Wed, 4 Jun 2008, John Melesky wrote: So you use those occurrence statistics to pick a feasible next word (let's choose system, since it's the highest probability here -- in practice you'd probably choose one randomly based on a weighted likelihood). Then you look for all the word pairs