[Haskell-cafe] Installing wx via cabal

2010-02-21 Thread Dušan Kolář
Dear all, Running cabal install --global wx stops very soon with the following error. Building wxcore-0.12.1.2... [ 1 of 22] Compiling Graphics.UI.WXCore.WxcObject ( src/haskell/Graphics/UI/WXCore/WxcObject.hs, dist/build/Graphics/UI/WXCore/WxcObject.o ) [ 2 of 22] Compiling Graphics.UI.WX

[Haskell-cafe] Optimizing hash array mapped tries

2010-02-21 Thread Edward Z. Yang
Hello all, I spent this weekend attempting to impement Phil Bagwell's Hash Array Mapped Tries in Haskell. You can view the fruits of this work at this repository: http://github.com/ezyang/hamt Unfortunately, I'm getting pretty abysmal performance out of the implementation I wrote, so I'm ho

[Haskell-cafe] Some great results on fused code with the LLVM backend

2010-02-21 Thread Don Stewart
I tried out some of the vector and uvector fusion benchmarks with the new LLVM backend http://donsbot.wordpress.com/2010/02/21/smoking-fast-haskell-code-using-ghcs-new-llvm-codegen/ and got some great results for the tight loops generated through fusion. Up to 2x faster than gcc -O3 in some

Re: [Haskell-cafe] Re: sendfile leaking descriptors on Linux?

2010-02-21 Thread Jeremy Shaw
On Sun, Feb 21, 2010 at 6:39 PM, Donn Cave wrote: > Quoth Jeremy Shaw , > ... > > What happens is the PS3 has closed the connection, and if you attempt > > to send any more packets the PS3 will tell you it has closed the > > connection and the write() / sendfile() call will raise SIGPIPE. > ... >

Re: [Haskell-cafe] Re: sendfile leaking descriptors on Linux?

2010-02-21 Thread Donn Cave
Quoth Jeremy Shaw , ... > What happens is the PS3 has closed the connection, and if you attempt > to send any more packets the PS3 will tell you it has closed the > connection and the write() / sendfile() call will raise SIGPIPE. ... > So far there is: > > - no way for anyone besides Bardur t

Re: [Haskell-cafe] Category Theory woes

2010-02-21 Thread Richard O'Keefe
On Feb 21, 2010, at 8:13 AM, Nick Rudnick wrote: Of course a basic point about language is that the association between sounds and meanings is (for the most part) arbitrary. I would rather like to say it is not strictly determined, as an evolutionary tendence towards, say ergonomy, cannot be

Re: [Haskell-cafe] GHC RTS question

2010-02-21 Thread Ivan Miljenovic
On 22 February 2010 10:55, Lennart Augustsson wrote: > Supply a fix for the problem, and it will probably get included. > There has probably been little demand for this feature so far. But it is a little bit weird where if you have an application that you release into production (which, admittedl

Re: [Haskell-cafe] GHC RTS question

2010-02-21 Thread Lennart Augustsson
Supply a fix for the problem, and it will probably get included. There has probably been little demand for this feature so far. -- Lennart On Sun, Feb 21, 2010 at 10:21 PM, Ben Millwood wrote: > On Sun, Feb 21, 2010 at 7:10 PM, Max Bolingbroke > wrote: >> >> You might be able to get somewhere

Re: [Haskell-cafe] Re: Re[2]: Threading and FFI

2010-02-21 Thread Lars Viklund
On 02/21/2010 09:51 PM, Ben Franksen wrote: Yves Parès wrote: Just one last remark: when I moved all my OpenGL calls from the main thread to an unbound thread. I thought it'd not work -- because I assumed I would have to launch it in a bound thread -- and however it went right... You were just

Re: [Haskell-cafe] GHC RTS question

2010-02-21 Thread Ben Millwood
On Sun, Feb 21, 2010 at 7:10 PM, Max Bolingbroke wrote: > > You might be able to get somewhere by writing a custom "main" function > in C and linking it in. According to > http://haskell.org/ghc/docs/latest/html/users_guide/options-phases.html > if a lib specified with the -l option during compila

Re: [Haskell-cafe] games of chance

2010-02-21 Thread Dupont Corentin
Thanks a lot Mark. Corentin On Sat, Feb 20, 2010 at 4:26 AM, Mark Wassell wrote: > Take a look at: > > http://hackage.haskell.org/package/probability > > and > > http://web.engr.oregonstate.edu/~erwig/pfp/ > > Mark > > > Dupont Corentin wrote: > >> >

Re: [Haskell-cafe] grapefruit on windows or osX

2010-02-21 Thread Yuras Shumovich
If you are using binary gtk2hs installer for windows, then you have to install the same ghc version the installer was built for. As I know there are no gtk2hs build for ghc-6.10.4. You can build it manually (using msys), but it is complicated task. 2010/2/21 : > I'm unable to get grapefruit going

[Haskell-cafe] Re: Parsing of bytestrings with non-String errors?

2010-02-21 Thread Permjacov Evgeniy
On 02/21/2010 11:57 PM, haskell-cafe-requ...@haskell.org wrote: > Message: 2 > Date: Sun, 21 Feb 2010 12:36:21 + > From: Magnus Therning > Subject: [Haskell-cafe] Parsing of bytestrings with non-String errors? > To: haskell-cafe > Message-ID: <4b8128c5.6030...@therning.org> > Content-Type: te

[Haskell-cafe] Re: Re[2]: Threading and FFI

2010-02-21 Thread Ben Franksen
Yves Parès wrote: > Just one last remark: when I moved all my OpenGL calls from the main > thread to an unbound thread. I thought it'd not work -- because I assumed > I would have to launch it in a bound thread -- and however it went > right... You were just lucky the RTS accidentally delegated al

Re: [Haskell-cafe] Re: sendfile leaking descriptors on Linux?

2010-02-21 Thread Jeremy Shaw
On Feb 21, 2010, at 11:50 AM, Donn Cave wrote: The problem is that this definition of `closed' is, precisely, `failed to respond within 2 seconds.' If there is no observable difference between a connection that has been abandoned by the PS3, and a connection that just suffered a momentary laps

Re: [Haskell-cafe] Profiling

2010-02-21 Thread Stephen Tetley
Hi Andrew It needs installing. Its well worth it though, an invaluable tool. Thanks Malcolm and Bjorn! On 21 February 2010 21:27, Andrew Coppin wrote: > I'm presuming this only works if hs-colour is installed first though? Or is > it statically linked into the Haddock binary? ___

[Haskell-cafe] Re: darcs 2.4 release candidate 2

2010-02-21 Thread Ben Franksen
Ben Franksen wrote: > The situation with record is similar. > > I admit that the huge RTEMS tree with over 7000 changes between the two > releases is challenging. However, earlier releases can do it (though it > takes long, much longer than with, say, mercurial). Just for comparison, here are the

Re: [Haskell-cafe] Profiling

2010-02-21 Thread Andrew Coppin
What does the --hyperlink-source bit do? Hello Andrew It generates marked up source code via hs-colour. I'm presuming this only works if hs-colour is installed first though? Or is it statically linked into the Haddock binary? ___ Haskel

Re: [Haskell-cafe] Profiling

2010-02-21 Thread Daniel Fischer
Am Sonntag 21 Februar 2010 21:44:57 schrieb Andrew Coppin: > Daniel Fischer wrote: > > Am Sonntag 21 Februar 2010 18:22:07 schrieb Andrew Coppin: > >> Oh, right. So I actually need cabal.exe to do this then? > > > > No, you can also > > > > $ ./runghc ./Setup.[l]hs configure --enable-library-profil

[Haskell-cafe] Re: darcs 2.4 release candidate 2

2010-02-21 Thread Ben Franksen
And here are the numbers for record -lam: b...@sarun[1]: .../rtems/rtems-4.9.0 > darcs --version 2.3.1 (release) b...@sarun[1]: .../rtems/rtems-4.9.0 > time darcs record -lam'import release 4.9.0' Finished recording patch 'import release 4.9.0' darcs record -lam'import release 4.9.0' 143,33s user

Re: [Haskell-cafe] STArray newListArray

2010-02-21 Thread Daniel Fischer
Am Sonntag 21 Februar 2010 21:26:31 schrieb Vojtěch Knyttl: > Ok, the problem was the Monad, which I still don't get completely, > because I continue like this: > > data Field = W|B|H|D deriving (Eq,Show) > > pas :: ST s (STArray s (Int, Int) Field) -> ST s (STArray s (Int, Int) > Field) pas b = do

[Haskell-cafe] grapefruit on windows or osX

2010-02-21 Thread gladstein
I'm unable to get grapefruit going on osx or windows because (I think) I can't get the underlying GTK installed. Most recently I can't install gtk2hs over 6.10.4 because the installer tells me my haskell install isn't working and I should reinstall 6.10.1. It invites me to continue anyway and fix

Re: [Haskell-cafe] Profiling

2010-02-21 Thread Stephen Tetley
2010/2/21 Andrew Coppin : > Daniel Fischer wrote: > > What does the --hyperlink-source bit do? Hello Andrew It generates marked up source code via hs-colour. Best wishes Stephen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskel

Re: [Haskell-cafe] Profiling

2010-02-21 Thread Andrew Coppin
Daniel Fischer wrote: Am Sonntag 21 Februar 2010 18:22:07 schrieb Andrew Coppin: Oh, right. So I actually need cabal.exe to do this then? No, you can also $ ./runghc ./Setup.[l]hs configure --enable-library-profiling --user -- prefix=$HOME/.cabal $ ./runghc ./Setup.[l]hs build $ ./runghc .

Re: [Haskell-cafe] STArray newListArray

2010-02-21 Thread Vojtěch Knyttl
Ok, the problem was the Monad, which I still don't get completely, because I continue like this: data Field = W|B|H|D deriving (Eq,Show) pas :: ST s (STArray s (Int, Int) Field) -> ST s (STArray s (Int, Int) Field) pas b = do writeArray b (1,1) W And still getting: Couldn't match expected t

Re: [Haskell-cafe] GHC RTS question

2010-02-21 Thread Daniel Fischer
Am Sonntag 21 Februar 2010 19:58:12 schrieb Artyom Kazak: > 2010/2/21 Daniel Fischer : > > Am Sonntag 21 Februar 2010 18:20:43 schrieb Artyom Kazak: > >> > Enclose it in double quotes (perhaps single quotes would also work) > >> > >> No, I want my program to work the same way as UNIX "echo" does. >

Re: [Haskell-cafe] GHC RTS question

2010-02-21 Thread Anthony Cowley
On Sun, Feb 21, 2010 at 1:58 PM, Artyom Kazak wrote: > So, if I type "./prog +RTS --RTS +RTS", the output will be "+RTS". But > I want the output to be equal to the input IN ALL CASES, without any > quotes, additional options, etc. I want all the command line to go to > my program. How can I do it

Re: [Haskell-cafe] GHC RTS question

2010-02-21 Thread Max Bolingbroke
On 21 February 2010 18:58, Artyom Kazak wrote: > So, if I type "./prog +RTS --RTS +RTS", the output will be "+RTS". But > I want the output to be equal to the input IN ALL CASES, without any > quotes, additional options, etc. I want all the command line to go to > my program. How can I do it? (The

Re: [Haskell-cafe] GHC RTS question

2010-02-21 Thread Artyom Kazak
2010/2/21 Daniel Fischer : > Am Sonntag 21 Februar 2010 18:20:43 schrieb Artyom Kazak: >> > Enclose it in double quotes (perhaps single quotes would also work) >> >> No, I want my program to work the same way as UNIX "echo" does. >> Without any double quotes. > > Okay, what about > > "If you absolu

Re: [Haskell-cafe] Profiling

2010-02-21 Thread Daniel Fischer
Am Sonntag 21 Februar 2010 18:22:07 schrieb Andrew Coppin: > Patai Gergely wrote: > >> I tried to compile my program with -prof, but GHC just whines at me > >> that the packages I'm using haven't been compiled for profiling. Do I > >> really need to go recompile every single package I'm using with

Re: [Haskell-cafe] GHC RTS question

2010-02-21 Thread Daniel Fischer
Am Sonntag 21 Februar 2010 18:20:43 schrieb Artyom Kazak: > > Enclose it in double quotes (perhaps single quotes would also work) > > No, I want my program to work the same way as UNIX "echo" does. > Without any double quotes. Okay, what about "If you absolutely positively want all the rest of th

Re: [Haskell-cafe] Restricted categories

2010-02-21 Thread Sjoerd Visscher
Ok, I've got product categories working: > {-# LANGUAGE TypeOperators, TypeFamilies, MultiParamTypeClasses, > ScopedTypeVariables, FlexibleContexts, FlexibleInstances, GADTs, RankNTypes, > UndecidableInstances #-} > import Prelude hiding ((.), id, fst, snd) > import qualified Prelude Suitable2

Re: [Haskell-cafe] Re: sendfile leaking descriptors on Linux?

2010-02-21 Thread Donn Cave
Quoth Bardur Arantsson , > Taru Karttunen wrote: >> Excerpts from Bardur Arantsson's message of Wed Feb 17 21:27:07 +0200 2010: >>> For sendfile, a timeout of 1 second would probably be fine. The *ONLY* >>> purpose of threadWaitWrite in the sendfile code is to avoid busy-waiting >>> on EAGAIN fr

Re: [Haskell-cafe] Profiling

2010-02-21 Thread Andrew Coppin
Patai Gergely wrote: I tried to compile my program with -prof, but GHC just whines at me that the packages I'm using haven't been compiled for profiling. Do I really need to go recompile every single package I'm using with profiling support before I can profile my program? How do I tell Cabal

Re: [Haskell-cafe] GHC RTS question

2010-02-21 Thread Artyom Kazak
> Enclose it in double quotes (perhaps single quotes would also work) No, I want my program to work the same way as UNIX "echo" does. Without any double quotes. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo

Re: [Haskell-cafe] Profiling

2010-02-21 Thread Thomas DuBuisson
> How do I tell Cabal to install the necessary code? set: "library-profiling: True" in your ~/.cabal/config file and never deal with this again (for any new packages you install). use --reinstall -p to updat existing packages. Thomas ___ Haskell-Cafe

Re: [Haskell-cafe] Profiling

2010-02-21 Thread Patai Gergely
> I tried to compile my program with -prof, but GHC just whines at me > that the packages I'm using haven't been compiled for profiling. Do I > really need to go recompile every single package I'm using with > profiling support before I can profile my program? How do I tell Cabal > to install t

Re: [Haskell-cafe] STArray newListArray

2010-02-21 Thread Ben Millwood
2010/2/21 Vojtěch Knyttl : > Hello, > > I am trying to create STArray with newListArray like this: > la x y = newListArray ((1,1),(x,y)) [(x'+y') | x' <- [1..x], y' <- [1..y]] > > – but it does not work: > No instance for (MArray a Field m) Notice that newListArray has a monadic return type: newL

Re: [Haskell-cafe] GHC RTS question

2010-02-21 Thread Daniel Fischer
Am Sonntag 21 Februar 2010 16:45:22 schrieb Artyom Kazak: > Hello everybody! > I want to write a little program, that will receive a string as > command-line argument and write it in the file. But if this string > contains '+RTS', GHC runtime won't pass the rest of the string to my > program. > Wha

Re: [Haskell-cafe] STArray newListArray

2010-02-21 Thread Daniel Fischer
Am Sonntag 21 Februar 2010 16:30:00 schrieb Vojtěch Knyttl: > Hello, > > I am trying to create STArray with newListArray like this: > la x y = newListArray ((1,1),(x,y)) [(x'+y') | x' <- [1..x], y' <- > [1..y]] > > – but it does not work: > No instance for (MArray a Field m) > > I tried to define t

Re: [Haskell-cafe] GHC RTS question

2010-02-21 Thread Felipe Lessa
On Sun, Feb 21, 2010 at 05:45:22PM +0200, Artyom Kazak wrote: > Hello everybody! > I want to write a little program, that will receive a string as command-line > argument and write it in the file. But if this string contains '+RTS', GHC > runtime won't pass the rest of the string to my program. > W

[Haskell-cafe] Profiling

2010-02-21 Thread Andrew Coppin
Two small questions: 1. Is Thread Scope any use for profiling single-threaded programs? 2. I tried to compile my program with -prof, but GHC just whines at me that the packages I'm using haven't been compiled for profiling. Do I really need to go recompile every single package I'm using with

[Haskell-cafe] GHC RTS question

2010-02-21 Thread Artyom Kazak
Hello everybody! I want to write a little program, that will receive a string as command-line argument and write it in the file. But if this string contains '+RTS', GHC runtime won't pass the rest of the string to my program. What can I do to avoid this?

[Haskell-cafe] STArray newListArray

2010-02-21 Thread Vojtěch Knyttl
Hello, I am trying to create STArray with newListArray like this: la x y = newListArray ((1,1),(x,y)) [(x'+y') | x' <- [1..x], y' <- [1..y]] – but it does not work: No instance for (MArray a Field m) I tried to define the type like this, but it would not work either: la :: Int -> Int -> STArray

Re: [Haskell-cafe] Parsing of bytestrings with non-String errors?

2010-02-21 Thread Malcolm Wallace
Is there a parser combinator library out there that works on bytestrings and allows using a custom error type? The HuttonMeijerWallace combinators (distributed with polyparse) have the custom error type, but not the bytestrings. Or maybe there's some very basic reason why String is so comm

Re: [Haskell-cafe] Linux ghci vs Windows ghci

2010-02-21 Thread Ketil Malde
Donghee Nah writes: > I feel that ghci code executing speed in guest os is 1.5~2x faster than host > os > > The code: > let t n = do {if n `mod` 10 == 0 then print n else return ()} >> t (n+1) > t 1 > > any clue? Speed of the terminal? Cost of syscalls (user/kernel transitions)? -k -- If

[Haskell-cafe] Parsing of bytestrings with non-String errors?

2010-02-21 Thread Magnus Therning
I've looked at polyparse and attoparsec and they seem to have in common that the error always is a String. My current ideas for a project would be a lot easier if I could just return some other type, something that I can pattern match on. Is there a parser combinator library out there that works

[Haskell-cafe] Linux ghci vs Windows ghci

2010-02-21 Thread Donghee Nah
I'm using Windows 7 32bit Host OS(ghc 6.8.3) and Virtualbox Archlinux Guest OS(ghc 6.8.4) I feel that ghci code executing speed in guest os is 1.5~2x faster than host os The code: let t n = do {if n `mod` 10 == 0 then print n else return ()} >> t (n+1) t 1 any clue? _

[Haskell-cafe] Re: sendfile leaking descriptors on Linux?

2010-02-21 Thread Bardur Arantsson
Taru Karttunen wrote: Excerpts from Bardur Arantsson's message of Wed Feb 17 21:27:07 +0200 2010: For sendfile, a timeout of 1 second would probably be fine. The *ONLY* purpose of threadWaitWrite in the sendfile code is to avoid busy-waiting on EAGAIN from the native sendfile. Of course this

[Haskell-cafe] Re: sendfile leaking descriptors on Linux?

2010-02-21 Thread Bardur Arantsson
Jeremy Shaw wrote: Hello, I think to make progress on this bug we really need a failing test case that other people can reproduce. I have hacked up small server that should reproduce the error (using fdWrite instead of sendfile). And a small C client which is intended to reproduce the error --