[Haskell] Translation of the Gentle Introduction to Haskell 98

2007-05-01 Thread Gorgonite
Hello, I don't know if there are French-speaking people reading this mailing-list, but we at haskell-fr have some great news today ! We didn't find any French translation of the Gentle Introduction to Haskell (version 98), thus we decide to write it. Today, I would like to announce that we

[Haskell] Haskell fast (?) arrays

2007-05-01 Thread Federico Squartini
I was reading an old post where Hal Daume III was analyzing Haskell performance for arrays. He proposed a test program which initializes an array, reverse it a number of times, and sums the contents. So I wrote a c++ reference program, a naive haskell version using lists and I also tweaked a

Re: [Haskell] Haskell fast (?) arrays

2007-05-01 Thread Axel Simon
Frederico, On Tue, 2007-05-01 at 13:59 +0200, Federico Squartini wrote: I was reading an old post where Hal Daume III was analyzing Haskell performance for arrays. He proposed a test program which initializes an array, reverse it a number of times, and sums the contents. So I wrote a c++

Re: [Haskell] Haskell fast (?) arrays

2007-05-01 Thread Stefan O'Rear
On Tue, May 01, 2007 at 01:59:01PM +0200, Federico Squartini wrote: I was reading an old post where Hal Daume III was analyzing Haskell performance for arrays. He proposed a test program which initializes an array, reverse it a number of times, and sums the contents. So I wrote a c++

Re: [Haskell] Haskell fast (?) arrays

2007-05-01 Thread Federico Squartini
Of course I know that the list version is very unfair, but I wanted to see what was the trade off between elegance and speed. Regarding whether low level programming makes sense or not, I was just curious to see what are the limits of Haskell. Moreover there is not much literature on high

Re: [Haskell] Haskell fast (?) arrays

2007-05-01 Thread Donald Bruce Stewart
federico.squartini: Of course I know that the list version is very unfair, but I wanted to see what was the trade off between elegance and speed. Regarding whether low level programming makes sense or not, I was just curious to see what are the limits of Haskell. Moreover

Re: [Haskell] Haskell fast (?) arrays

2007-05-01 Thread Federico Squartini
Sorry, I was very silly! This is the correct version of the program using the doFromto loop. And it runs fast! I hope there are no further mistakes. Thanks Axel. time ./IOMutUnbUnsafe 499 real0m0.708s user0m0.573s sys 0m0.008s

Re: [Haskell] Haskell fast (?) arrays

2007-05-01 Thread Federico Squartini
Thanks for the hints. It's a pity that (as far as I know) no one has written a tutorial on those techniques, because I think it would be appreciated. Some of them are quite involved and learning them just by reading code is very time consuming. Federico

Re: [Haskell] Haskell fast (?) arrays

2007-05-01 Thread Rishiyur Nikhil
I think another interesting data point would be for a C++ version that uses the 'vector' data type from STL (Standard Template Library) and using the vector indexing ops that do bounds-checking. Regards, Nikhil ___ Haskell mailing list

Re: [Haskell] Haskell fast (?) arrays

2007-05-01 Thread Taral
On 5/1/07, Federico Squartini [EMAIL PROTECTED] wrote: Thanks for the hints. It's a pity that (as far as I know) no one has written a tutorial on those techniques, because I think it would be appreciated. Some of them are quite involved and learning them just by reading code is very time

[Haskell] refactoring, catamorphism, termination of programs

2007-05-01 Thread Johannes Waldmann
Dear all, I'm looking for a tool that implements the source code transformation replace recursion by catamorphism (fold etc.). My application is that if the transformation succeeds, it implies that the program terminates. (roughly) I don't want to make a big research project out of this,

Re: [Haskell] Haskell fast (?) arrays

2007-05-01 Thread Bas van Dijk
On 5/1/07, Federico Squartini [EMAIL PROTECTED] wrote: Moreover there is not much literature on high performance Haskell programming (tricks like unsafeWrite), at least organized in a systematic and concise way. Look at: http://haskell.org/haskellwiki/Performance regards, Bas van Dijk

Re: [Haskell] Haskell fast (?) arrays

2007-05-01 Thread Stephan Herhut
While scanning my Inbox I read 'fast' and 'array' in the context of functional programming. Well, of course SaC instantly came to my mind (what a surprise ;) ). So I did some measurements myself. I used your programs, except that I increased the array size by a factor of 10. For the C++ version I

[Haskell] Re: refactoring, catamorphism, termination of programs

2007-05-01 Thread Stefan Monnier
I'm looking for a tool that implements the source code transformation replace recursion by catamorphism (fold etc.). My application is that if the transformation succeeds, it implies that the program terminates. (roughly) I don't want to make a big research project out of this, rather I

[Haskell] ANNOUNCE: rsa-haskell 2.0.1

2007-05-01 Thread David Sankel
RSA-Haskell is a collection of command-line cryptography tools and a cryptography library written in Haskell. It is intended to be useful to anyone who wants to secure files or communications or who wants to incorporate cryptography in their Haskell application. Download and documentation are

Re: [Haskell] refactoring, catamorphism, termination of programs

2007-05-01 Thread José Pedro Correia
Hi Maybe this link is of interest to you: http://wiki.di.uminho.pt/twiki/bin/view/Research/PURe/WebHome. A tool called DrHylo, developed in the context of this project is available, altough I don't know how suitable it could be for you:

[Haskell] ANNOUNCE: Atom 2007.05

2007-05-01 Thread Tom Hawkins
Atom, a high-level hardware description language embedded in Haskell, compiles conditional term rewriting systems into conventional HDL. New in this release: - VHDL code generation (synthesis only, simulation directives not supported). - Improved rule mutual exclusion analysis. Now, mutual

Re: [Haskell] Haskell fast (?) arrays

2007-05-01 Thread Donald Bruce Stewart
federico.squartini: Sorry, I was very silly! This is the correct version of the program using the doFromto loop. And it runs fast! I hope there are no further mistakes. Thanks Axel. time ./IOMutUnbUnsafe 499 real 0m0.708s user 0m0.573s sys 0m0.008s Here's an improved version,

[GHC] #1315: System.Process.runInteractiveProcess needs a way to pipe just some handles

2007-05-01 Thread GHC
#1315: System.Process.runInteractiveProcess needs a way to pipe just some handles ---+ Reporter: simonmar | Owner: Type: task | Status: new Priority: normal

Re: [GHC] #1292: -Wall doesn't include all warnings

2007-05-01 Thread GHC
#1292: -Wall doesn't include all warnings -+-- Reporter: guest |Owner: Type: bug | Status: closed Priority: normal|Milestone: Component: Compiler |

groupBy

2007-05-01 Thread Frederik Eaton
Hello, My copy of the library documentation says: groupBy :: (a - a - Bool) - [a] - [[a]] The groupBy function is the non-overloaded version of group. User-supplied comparison (replacing an Ord context) The function is assumed to define a total ordering. But group has an Eq

[GHC] #1316: add warning for local type signatures that use the same type variable names as outer type signatures

2007-05-01 Thread GHC
#1316: add warning for local type signatures that use the same type variable names as outer type signatures --+- Reporter: Isaac Dupree | Owner: Type: feature request | Status: new

[GHC] #1317: add warning for the Prelude being imported implicitly

2007-05-01 Thread GHC
#1317: add warning for the Prelude being imported implicitly --+- Reporter: Isaac Dupree | Owner: Type: feature request | Status: new Priority: normal |

[GHC] #1318: add warning for prefix negate operator and flag to replace it with negative numeric literals

2007-05-01 Thread GHC
#1318: add warning for prefix negate operator and flag to replace it with negative numeric literals +--- Reporter: Isaac Dupree | Owner: Isaac Dupree Type: feature request| Status: new

[GHC] #1319: grammatical mistake in user's guide description of -fwarn-name-shadowing

2007-05-01 Thread GHC
#1319: grammatical mistake in user's guide description of -fwarn-name-shadowing +--- Reporter: Isaac Dupree | Owner: Type: bug| Status: new Priority: normal |

Re: [GHC] #1319: grammatical mistake in user's guide description of -fwarn-name-shadowing

2007-05-01 Thread GHC
#1319: grammatical mistake in user's guide description of -fwarn-name-shadowing --+- Reporter: Isaac Dupree |Owner: Type: bug| Status: closed Priority: normal |

Re: ghc configure

2007-05-01 Thread Simon Marlow
C.M.Brown wrote: I've noticed that when you run ./configure on a ghc build lot's of repetition occurs. A lot of the time the same checks are being performed for each configure file in the ghc hierarchy. Could it be possible if some of these checks could be done once at a high level and then

Re: ghc configure

2007-05-01 Thread C.M.Brown
Hi Simon, Mainly this is due to modularity: many of the library packages can be built entirely separately from GHC, so their configure scripts are designed to be standalone. Yes, I guess it would be a fair bit of work to have it check that you are building the whole of GHC as opposed to

Re: ghc configure

2007-05-01 Thread Claus Reinke
Mainly this is due to modularity: many of the library packages can be built entirely separately from GHC, so their configure scripts are designed to be standalone. library packages are haskell packages, and much of the configuration data should be common (plus a few package-specific checks).

RE: recent Windows installer for ghc head?

2007-05-01 Thread Simon Peyton-Jones
Following the snapshot distribution link on GHC's download page yields this http://www.haskell.org/ghc/dist/current/dist/ghc-6.7.20070404-i386-unknown-mingw32.tar.bz2 That seems to be a tar bundle for Windows; it's not an msi but if you unpack it you should be able to run it

Re: More speed please!

2007-05-01 Thread Josef Svenningsson
I'm replying to a rather old thread here, about unboxing in functions. Duncan had a continuation monad which passed around some data type that would be nice to unbox. You discussed strictness annotations in function types as a potential solution. I have a different tack on the problem which seems

Re: Error compiling GHC/Num.lhs

2007-05-01 Thread Bas van Dijk
On 4/29/07, Ian Lynagh [EMAIL PROTECTED] wrote: Hi Bas, On Sun, Apr 29, 2007 at 11:54:35AM +, Bas van Dijk wrote: I'm trying to build GHC from darcs. Unfortunately compilation fails with the following error: ... cpphs: #error Please define LEFTMOST_BIT to be 2^(SIZEOF_HSWORD*8-1) in

Re: Wanted: warning option for usages of unary minus

2007-05-01 Thread Isaac Dupree
Okay, first steps: 1. A Trac ticket (#1318, http://hackage.haskell.org/trac/ghc/ticket/1318) (is feature request a good category, versus task?) 2. A test-case to make sure I don't break anything with existing '-' syntax. I'm guessing it should go in testsuite/tests/ghc-regress/parser/should_run/,

Re: Polymorphic strict fields

2007-05-01 Thread Duncan Coutts
On Mon, 2007-04-30 at 19:47 -0700, Iavor Diatchki wrote: All of this leads me to think that perhaps we should not allow strictness annotations on polymorphic fields. Would people find this too restrictive? Yes. Our current implementation of stream fusion relies on this: data Stream a =

[Haskell-cafe] Cabal, lib and exe in one

2007-05-01 Thread Magnus Therning
I'm trying to create a single cabal file containing specs for both a library and an executable using that library. I'm not having much luck though :( This is what I have so far: name: foo version: 0.1 exposed-modules: Foo.Bar other-modules: Foo.Qux Foo.C2HS hs-source-dirs: src

RE: [Haskell-cafe] FIT for Haskell

2007-05-01 Thread Bayley, Alistair
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Philipp Volgger Who wrote FIT for Haskell on http://darcs.haskell.org/FIT/? Does anybody know if the version is stable? Hello Philipp, That would be me. It's not finished or stable, and I don't think it'll work with GHC-6.6

[Haskell-cafe] Re: 'Proper' use of the State monad

2007-05-01 Thread DavidA
1) Using State GameState r and then call execState for each game event (i.e. user input) so I can do IO 2) Using StateT GameState IO () and have the entire game live in one big execStateT call. (I note XMonad does something similar.) I'm also interested in the answer to this question. One

[Haskell-cafe] what exactly does deriving (Functor, Monad, MonadIO) do?

2007-05-01 Thread Thomas Hartman
I was trying to follow the reasoning in Don's article on using haskell for shell scripting http://cgi.cse.unsw.edu.au/~dons/blog/2007/03/10 In the source listing at the end we is newtype Shell a = Shell { runShell :: ErrorT String IO a } deriving (Functor, Monad, MonadIO) and I

Re: [Haskell-cafe] what exactly does deriving (Functor, Monad, MonadIO) do?

2007-05-01 Thread Donald Bruce Stewart
tphyahoo: I was trying to follow the reasoning in Don's article on using haskell for shell scripting http://cgi.cse.unsw.edu.au/~dons/blog/2007/03/10 In the source listing at the end we is newtype Shell a = Shell { runShell :: ErrorT String IO a } deriving (Functor, Monad,

[Haskell-cafe] Re: Poor first impression

2007-05-01 Thread Simon Marlow
brad clawsie wrote: On Mon, Apr 30, 2007 at 09:53:06PM +0100, Andrew Coppin wrote: brad clawsie wrote: installing a modern linux on this box is a thirty minute exercise. Ah - a volunteer! :-) absolutely! for the low cost of one round-trip business-class seat from san jose to wherever this

Re: [Haskell-cafe] what exactly does deriving (Functor, Monad, MonadIO) do?

2007-05-01 Thread Thomas Hartman
Thanks Dons. There's also a short and sweet explanation here. http://hackage.haskell.org/trac/haskell-prime/wiki/NewtypeDeriving I am going to try and wrap my head around this, as I am very interested in solutions for haskell / shell interaction. Are there are any good examples of code

Re: [Haskell-cafe] Bloom Filter

2007-05-01 Thread Josef Svenningsson
Hi, Just a small comment on one of the comments. On 5/1/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Also, rather than this: add :: Bloom a - a - Bloom a a better argument order is this: insert :: a - Bloom a - Bloom a That way, you can use it with foldr. Hmmm. If you want to

Re: [Haskell-cafe] Cabal, lib and exe in one

2007-05-01 Thread Duncan Coutts
On Tue, 2007-05-01 at 09:34 +0100, Magnus Therning wrote: I'm trying to create a single cabal file containing specs for both a library and an executable using that library. I'm not having much luck though :( This is what I have so far: name: foo version: 0.1 exposed-modules:

Re: [Haskell-cafe] Re: 'Proper' use of the State monad

2007-05-01 Thread Sebastian Sylvan
On 5/1/07, DavidA [EMAIL PROTECTED] wrote: 1) Using State GameState r and then call execState for each game event (i.e. user input) so I can do IO 2) Using StateT GameState IO () and have the entire game live in one big execStateT call. (I note XMonad does something similar.) I'm also

Re: [Haskell-cafe] what exactly does deriving (Functor, Monad, MonadIO) do?

2007-05-01 Thread Brandon S. Allbery KF8NH
On May 1, 2007, at 6:05 , Thomas Hartman wrote: Are there are any good examples of code written without this extension, alongside code condensed by using this extension. That would be helpful for understanding what's going on. I think all this does is save you from having to write a bunch of

Re: [Haskell-cafe] what exactly does deriving (Functor, Monad, MonadIO) do?

2007-05-01 Thread David House
On 01/05/07, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: I think all this does is save you from having to write a bunch of wrappers that unwrap the contained value, do something to it, and rewrap the result. Exactly. Basically what newtype deriving does is if you have a declaration like

RE: [Haskell-cafe] Displaying infered type signature of 'offside' functions

2007-05-01 Thread Simon Peyton-Jones
| I like the strong static type system of Haskell for various | reasons. One reason is, that it makes easier to understand new | code. I.e. when I read code I type ':t foo' in ghci/hugs from | time to time, to check my own idea of the type signature, if it | is not included in the source code.

[Haskell-cafe] Re: Type-level programming problem

2007-05-01 Thread Thomas Schilling
On 1 maj 2007, at 06.12, [EMAIL PROTECTED] wrote: We see it is a value polymorphic over four type variables: ns, a, b, and c. The type variable 'a' is also the type of the value, so we have a way to instantiate it. There is no direct way to instantiate the remaining three. If there were a

[Haskell-cafe] Hugs/nhc getting progressively slower

2007-05-01 Thread Neil Mitchell
Hi, I like to develop on Hugs, because its a nice platform to work with, and provides WinHugs, auto-reloading, sub-second compilation etc. Unfortunately some of the newer libraries (ByteString/Binary in particular) have been optimised to within an inch of their lives on GHC, at the cost of being

[Haskell-cafe] Is Hs-Plugins dead?

2007-05-01 Thread Philipp Volgger
Is Hs-Plugins still under develeopment; is there still somebody who is updating it? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Bloom Filter

2007-05-01 Thread Dom
Reminds me of this code from Data.Binary: unroll :: Integer - [Word8] unroll = unfoldr step where step 0 = Nothing step i = Just (fromIntegral i, i `shiftR` 8) roll :: [Word8] - Integer roll = foldr unstep 0 where unstep b a = a

Re: [Haskell-cafe] Hugs/nhc getting progressively slower

2007-05-01 Thread Duncan Coutts
On Tue, 2007-05-01 at 20:37 +0100, Neil Mitchell wrote: Hi, I like to develop on Hugs, because its a nice platform to work with, and provides WinHugs, auto-reloading, sub-second compilation etc. Unfortunately some of the newer libraries (ByteString/Binary in particular) have been optimised

Re: [Haskell-cafe] Cabal, lib and exe in one

2007-05-01 Thread Magnus Therning
On Tue, May 01, 2007 at 12:02:18 +0100, Duncan Coutts wrote: On Tue, 2007-05-01 at 09:34 +0100, Magnus Therning wrote: I'm trying to create a single cabal file containing specs for both a library and an executable using that library. I'm not having much luck though :( This is what I have so

Re: [Haskell-cafe] Re: 'Proper' use of the State monad

2007-05-01 Thread Yitzchak Gale
DavidA wrote: What I mean is, it seems like good design would mean that you could write and test the game logic totally independently of any IO. Game functions such as makeMove ought to have type signatures that don't involve any IO. Can this be achieved in option 2? Here is one way: For

Re: [Haskell-cafe] Is Hs-Plugins dead?

2007-05-01 Thread Stefan O'Rear
On Tue, May 01, 2007 at 09:51:37PM +0200, Philipp Volgger wrote: Is Hs-Plugins still under develeopment; is there still somebody who is updating it? Not really. It works perfectly and fills its niche. Mature software is not under development! It is still maintained by Don Stewart. Stefan

Re: [Haskell-cafe] Cabal, lib and exe in one

2007-05-01 Thread Duncan Coutts
On Tue, 2007-05-01 at 22:29 +0100, Magnus Therning wrote: So if foo.hs is in test-src and Foo/Bar.hs is in src then I think you just need: hs-source-dirs: test-src, src No, that's not enough, I also have to add the following lines to make the executable compile and link: extensions:

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

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 right that

Re: [Haskell-cafe] Is Hs-Plugins dead?

2007-05-01 Thread Donald Bruce Stewart
pvolgger: Is Hs-Plugins still under develeopment; is there still somebody who is updating it? It's in stasis. It will likely get a little bit more updating when I finish my phd. It's needed for lambdabot in #haskell, so that's enough pressure to keep it working :-) For the longer term, a