Re: Re[2]: [Haskell-cafe] funct.prog. vs logic prog., practical Haskell

2009-08-03 Thread Bill Wood
On Mon, 2009-08-03 at 00:24 +0400, Bulat Ziganshin wrote: . . . and the primary way to make haskell program faster is to emulate imperative language. and the best way to optimize C program is to use it as cpu-independent assembler. it's all natural in von-Neumann world and i personally

Re: [Haskell-cafe] ANNOUNCE: The Haskell Platform 2009.2.0.2

2009-08-03 Thread Alecs King
On Fri, Jul 31, 2009 at 05:01:07PM -0700, Don Stewart wrote: We're pleased to announce the third release of the Haskell Platform: a single, standard Haskell distribution for everyone. The specification, along with installers (including Windows and Unix installers for a full Haskell

[Haskell-cafe] haskell code pretty printer ?

2009-08-03 Thread Paul . Brauner
Hello, is there a pretty printer for haskell code somewhere ? I've googled and caballisted for this without success. I've written some small script using Language.Haskell.Pretty and Language.Haskell.Parser but the result isn't that 'pretty'. I mean, it outputs readable code but supercombinator's

Re: [Haskell-cafe] ANNOUNCE: The Haskell Platform 2009.2.0.2

2009-08-03 Thread Thomas Davie
I tried the Mac OS X package yesterday, after getting frustrated with random crashes in my broken GHC 6.9 install... It worked flawlessly, and got me set up in minutes. Great job everyone associated with building this installer -- it's now definitely my preferred way of getting GHC on a

Re: [Haskell-cafe] haskell code pretty printer ?

2009-08-03 Thread Niklas Broberg
Hi Paul, is there a pretty printer for haskell code somewhere ? I've googled and caballisted for this without success. I've written some small script using Language.Haskell.Pretty and Language.Haskell.Parser but the result isn't that 'pretty'. I mean, it outputs readable code but

Re: [Haskell-cafe] ANN: yst 0.2.1

2009-08-03 Thread Robert Wills
I had a play with this yesterday and thought it looked very useful (like all of John MacFarlane's tools). I'm probably going to use it for a site I'm working on. -Rob ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Writing a pnm file

2009-08-03 Thread Sebastian Sylvan
On Mon, Aug 3, 2009 at 6:38 AM, CK Kashyap ck_kash...@yahoo.com wrote: Thanks Sebastian, ppm module is indeed very useful. So, I guess my question then just boils down to, how can I write a function to mimic the setPixel function - Basically, a blank white image would look like this (as

Re: [Haskell-cafe] ANN: yst 0.2.1

2009-08-03 Thread Jinjing Wang
It's possible to serve the generated site with maid, in case apache is not available: cabal update cabal install maid yst create testsite cd testsite yst cd site maid now goto http://localhost:3000/ On Mon, Aug 3, 2009 at 9:05 AM, John MacFarlanej...@berkeley.edu wrote: I'm pleased to

[Haskell-cafe] FastCGI error handling

2009-08-03 Thread Victor Nazarov
I've been trying to write some simple web application in haskell using FastCGI, HDBC and HStringTemplate. I've got stuck with the following problem. HDBC throws some exceptions and I wanted them to be caught and logged. The code was: -- Main.hs module Main (main) where ... import

[Haskell-cafe] Re: FastCGI error handling

2009-08-03 Thread Victor Nazarov
On Mon, Aug 3, 2009 at 4:32 PM, Victor Nazarovasviraspossi...@gmail.com wrote: I've been trying to write some simple web application in haskell using FastCGI, HDBC and HStringTemplate. I've got stuck with the following problem. [snip] main :: IO () -- main = runFastCGIConcurrent' forkIO 10

Re: [Haskell-cafe] ANNOUNCE: The Haskell Platform 2009.2.0.2

2009-08-03 Thread Paulo Tanimoto
Hi Alecs, On Mon, Aug 3, 2009 at 1:27 AM, Alecs Kingale...@gmail.com wrote: Thanks for the hard work. But there's a problem of the source tarball.  scripts/build.sh skips building already-installed pkgs -- but scripts/install.sh does not skip installing them.  So 'make install' fails (err:

[Haskell-cafe] Re: ANN: yst 0.2.1

2009-08-03 Thread John MacFarlane
Thanks. I'll put a note to this effect in the README. John +++ Jinjing Wang [Aug 03 09 18:17 ]: It's possible to serve the generated site with maid, in case apache is not available: cabal update cabal install maid yst create testsite cd testsite yst cd site maid now goto

[Haskell-cafe] [Haskell Cafe] Troubles with StateT and Parsec

2009-08-03 Thread Paul Sujkov
Hi haskellers, I have a few problems using monad transformers. I have such two functions: parseSyslog :: StateT Integer Parser TimeStamp parseString :: StateT Integer Parser LogString and the following code: parseString = do -- string parse here, all in the form of lift $ parser stamp

Re: [Haskell-cafe] [Haskell Cafe] Troubles with StateT and Parsec

2009-08-03 Thread Daniel van den Eijkel
Hi Paul, the expression (lift parse $ parseSyslog message) has the same meaning as (lift parse (parseSyslog message)), so you are indeed applying lift to two arguments, while it expects one. Probably you forgot the $ after lift? Best regards, Daniel Paul Sujkov schrieb: Hi haskellers,

Re: [Haskell-cafe] Re: ANN: yst 0.2.1

2009-08-03 Thread Michael Snoyman
Hey John, I noticed that your code is using the Syck library for Yaml. How were you able to get it to deal with Unicode characters? I just wrote a new yaml library based on libyaml if you want to give it a shot (yaml on hackage). It doesn't support aliases, but is otherwise feature complete.

Re: [Haskell-cafe] Hackage and version control

2009-08-03 Thread Henning Thielemann
Robin Green schrieb: Yes, and darcs repos can also be hosted on patch-tag.com. community.haskell.org requires you to wait for a volunteer to review every new project request. Although, you don't need to make a project request if you only want a 1-developer repository. And by the way, it only

Re: [Haskell-cafe] [Haskell Cafe] Troubles with StateT and Parsec

2009-08-03 Thread Bryan O'Sullivan
On Mon, Aug 3, 2009 at 10:46 AM, Paul Sujkov psuj...@gmail.com wrote: parseSyslog :: StateT Integer Parser TimeStamp parseString :: StateT Integer Parser LogString and the following code: parseString = do [...] Without real code to look at, it's impossible to properly debug the errors in

Re: [Haskell-cafe] [Haskell Cafe] Troubles with StateT and Parsec

2009-08-03 Thread Luke Palmer
On Mon, Aug 3, 2009 at 11:46 AM, Paul Sujkovpsuj...@gmail.com wrote: 2) too many lifts in the code. I have only one function that really affects state, but code is filled with lifts from StateT to underlying Parser You do know you can do this, right? do x - get put (x + 1) lift $ do

Re: [Haskell-cafe] ANN: yst 0.2.1

2009-08-03 Thread Nicolas Pouillard
Excerpts from John MacFarlane's message of Mon Aug 03 03:05:00 +0200 2009: I'm pleased to announce the release of yst, now available on HackageDB. Great! I've used it for a web site of mine today with success. -- Nicolas Pouillard http://nicolaspouillard.fr

Re: [Haskell-cafe] Writing a pnm file

2009-08-03 Thread Sebastian Sylvan
On Mon, Aug 3, 2009 at 11:17 AM, CK Kashyap ck_kash...@yahoo.com wrote: Thanks Sebastian, Array/accumArray sounds like what I am looking for. Int - ( a - a ) - [a] - [a] approach, would it not be expensive on memory as well? Or is it just speed? Well memory will be garbage collected fairly

[Haskell-cafe] Re: ANN: yst 0.2.1

2009-08-03 Thread John MacFarlane
+++ Michael Snoyman [Aug 03 09 22:20 ]: Hey John, I noticed that your code is using the Syck library for Yaml. How were you able to get it to deal with Unicode characters? I just wrote a new yaml library based on libyaml if you want to give it a shot (yaml on hackage). It

Re: [Haskell-cafe] Re: Simple quirk in behavior of `mod`

2009-08-03 Thread Henning Thielemann
Matthias Görgens schrieb: Round-to-even means x.5 gets rounded to x if x is even and x+1 if x is odd. This is sometimes known as banker's rounding. OK. That's slightly unusual indeed. Modula-3 makes it too. Accidentally, I recently had a case where this rounding mode was really bad. I

[Haskell-cafe] Re: ANN: yst 0.2.1

2009-08-03 Thread John MacFarlane
+++ John MacFarlane [Aug 03 09 13:23 ]: +++ Michael Snoyman [Aug 03 09 22:20 ]: Hey John, I noticed that your code is using the Syck library for Yaml. How were you able to get it to deal with Unicode characters? I just wrote a new yaml library based on libyaml if you want

Re: [Haskell-cafe] Re: Cyclic data declarations

2009-08-03 Thread Job Vranish
I ran into exactly the same problem while working on my own toy language :) I used a fixed point datatype to solve it as well. This is really the best way, as it lets your expression (or statment) type be a member of functor/foldable/traversable, which is super handy. I made a graph module that

Fwd: [Haskell-cafe] funct.prog. vs logic prog., practical Haskell

2009-08-03 Thread Alberto G. Corona
The middle road could be Curry http://en.wikipedia.org/wiki/Curry, sorry, this Curry http://www.informatik.uni-kiel.de/~curry/, a functional-logic language. I know that curry has gained a lot of interest from prolog programmers. There are compilers from Curry to Prolog. It is a haskell 98

Re: [Haskell-cafe] Re: Proposal: TypeDirectedNameResolution

2009-08-03 Thread Henning Thielemann
Heinrich Apfelmus schrieb: Sure, overloading is useful. But to avoid headache in a polymorphic language, I'd prefer a principled approach to it. Hence, I'm convinced that there should be only one mechanism for overloading in Haskell; which is type classes at the moment. It appears that

Re: [Haskell-cafe] Re: Proposal: TypeDirectedNameResolution

2009-08-03 Thread Henning Thielemann
Heinrich Apfelmus schrieb: Note that there are alternative solution for this particular problem. For instance, a version of qualified with different semantics will do; something like this import Data.List import sometimes qualified Data.Map as Map Isn't that quite the same as

Re: [Haskell-cafe] [Haskell Cafe] Troubles with StateT and Parsec

2009-08-03 Thread Paul Sujkov
Hi Bryan, GHC 6.10.1, Parsec 3.0.0 and type signatures are right from the code: they are actually real (except the ones with the shortcuts). I see now that it is really a better idea to use internal Parser state to collect the data I need to carry through, so in any case thank you I've sent two

[Haskell-cafe] C2HS issues on Hackage

2009-08-03 Thread Michael Snoyman
Hi all, I've written a Yaml library built on top of libyaml (the same C library at the core of Python's yaml library). All is well on my local system and my server; I'm currently using it in production. However, the build is failing on Hackage with the following build log:

[Haskell-cafe] Haskell interface files: Why used? What about same data in object files?

2009-08-03 Thread Howard B. Golden
Hi, I am trying to understand the design of the Haskell interface files. Why are they a separate file rather than having the same data in the object file generated by the compiler? (Naively, it seems to me this would work also. Am I missing something?) Thanks. Howard B. Golden Northridge,

[Haskell-cafe] Re: Thinking about what's missing in our library coverage

2009-08-03 Thread Alexander Dunlap
On Mon, Aug 3, 2009 at 4:44 PM, Don Stewartd...@galois.com wrote: Following Simon M's advice, I look over the typical batteries categories, using Python as input:    http://docs.python.org/library/index.html The following things were missing from the current Platform. There are many. How

[Haskell-cafe] Re: Thinking about what's missing in our library coverage

2009-08-03 Thread Don Stewart
alexander.dunlap:          o pandoc — markdown, reStructuredText, HTML, LaTeX, ConTeXt, Docbook, OpenDocument, ODT, RTF, MediaWiki, groff No. Pandoc is too actively developed to go into the HP. It's also much more of an end-user application than a standard library - it's applications are