[Haskell-cafe] Re: haskell blas bindings: does iomatrix gemv transposing of matrix a?

2008-09-24 Thread Anatoly Yakovenko
is there anyway the modifyWith functions could work on uboxed types? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: haskell blas bindings: does iomatrix gemv transposing of matrix a?

2008-09-24 Thread Don Stewart
aeyakovenko: is there anyway the modifyWith functions could work on uboxed types? If they're inlined, the modify functions on boxed types may well end up unboxed. What's the particular problem you're having? -- Don ___ Haskell-Cafe mailing list

[Haskell-cafe] Re: [Haskell] Haskell Weekly News: Issue 86 - September 20, 2008

2008-09-24 Thread Benjamin L . Russell
On Tue, 23 Sep 2008 10:34:25 +0200, Wolfgang Jeltsch [EMAIL PROTECTED] wrote: Okay, I was reading the wrong list (haskell instead of haskell-cafe) so the announcement is there in my mail folder. But why doesn’t Mailman contain the message properly in its archive? According to

Re: [Haskell-cafe] Re: haskell blas bindings: does iomatrix gemv transposing of matrix a?

2008-09-24 Thread Anatoly Yakovenko
is there anyway the modifyWith functions could work on uboxed types? If they're inlined, the modify functions on boxed types may well end up unboxed. What's the particular problem you're having? well, after inspecting a little further its not so bad actually. i was comparing module Main

[Haskell-cafe] Re: haskell blas bindings: does iomatrix gemv transposing of matrix a?

2008-09-24 Thread Henning Thielemann
On Wed, 24 Sep 2008, Anatoly Yakovenko wrote: is there anyway the modifyWith functions could work on uboxed types? If they're inlined, the modify functions on boxed types may well end up unboxed. What's the particular problem you're having? well, after inspecting a little further its not

[Haskell-cafe] the way to fail

2008-09-24 Thread Jason Dusek
Whenever `fail` comes up, there are usually remarks to the effect that it doesn't really belong in the definition of `Monad`. Where does `fail` belong? Could it go in `Arrow`? -- _jsn ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Injecting Haskell into C

2008-09-24 Thread Roman Cheplyaka
I have a C function whose behaviour is customized by user-supplied function (think of libc qsort). Typically these user-supplied functions are written in C, but I'd like to use FFI to write them in Haskell. Precisely, I'd like to write high-order function which will generate these functions (e.g.

Re: [Haskell-cafe] the way to fail

2008-09-24 Thread Wolfgang Jeltsch
Am Mittwoch, 24. September 2008 11:36 schrieb Jason Dusek: Whenever `fail` comes up, there are usually remarks to the effect that it doesn't really belong in the definition of `Monad`. Where does `fail` belong? Could it go in `Arrow`? -- _jsn In my opinion, fail s should be somehow

Re: [Haskell-cafe] Injecting Haskell into C

2008-09-24 Thread Bulat Ziganshin
Hello Roman, Wednesday, September 24, 2008, 2:04:38 PM, you wrote: As I understand, there are two ways to do that. Either Haskell code is called from C, or C code is called for Haskell. So my questions are: 1. Are they both possible? yes. foreign export exports Haskell functions to C world,

[Haskell-cafe] Re: [Haskell] ICFP programming contest results

2008-09-24 Thread David Roundy
On Wed, Sep 24, 2008 at 1:06 AM, Malcolm Wallace [EMAIL PROTECTED] wrote: The ICFP programming contest results presentation: http://video.google.com/videoplay?docid=-4697764813432201693 Feel free to pass on this link to any other appropriate forum. Yikes. Haskell did pretty terribly! Anyone

[Haskell-cafe] Re: Line noise

2008-09-24 Thread Stefan Monnier
qsort [] = [] qsort (x:xs) = qsort (filter (x ) xs) ++ [x] ++ qsort (filter (x =) xs) Note that you can help the reader by making the precedence a bit more obvious: qsort [] = [] qsort (x:xs) = qsort (filter (x ) xs) ++ [x] ++ qsort (filter (x =) xs) I find

Re: [Haskell-cafe] Re: [Haskell] ICFP programming contest results

2008-09-24 Thread Don Stewart
daveroundy: On Wed, Sep 24, 2008 at 1:06 AM, Malcolm Wallace [EMAIL PROTECTED] wrote: The ICFP programming contest results presentation: http://video.google.com/videoplay?docid=-4697764813432201693 Feel free to pass on this link to any other appropriate forum. Yikes. Haskell did

[Haskell-cafe] Re: Line noise

2008-09-24 Thread Stefan Monnier
I believe this was voiced as an SML issue more than an OCaml issue, though honestly I don't know enough of the differences to distinguish them. Before I mentioned that function/prefix application always binds tighter than operator/infix application, he was using many redundant parentheses,

Re: [Haskell-cafe] Re: [Haskell] ICFP programming contest results

2008-09-24 Thread Rafael Gustavo da Cunha Pereira Pinto
Is the report available yet? Regards On Wed, Sep 24, 2008 at 13:06, Don Stewart [EMAIL PROTECTED] wrote: daveroundy: On Wed, Sep 24, 2008 at 1:06 AM, Malcolm Wallace [EMAIL PROTECTED] wrote: The ICFP programming contest results presentation:

Re: [Haskell-cafe] Re: [Haskell] ICFP programming contest results

2008-09-24 Thread Ryan Ingram
I've posted a summary of the results on my blog at http://ryani.livejournal.com/18287.html -- ryan 2008/9/24 Rafael Gustavo da Cunha Pereira Pinto [EMAIL PROTECTED]: Is the report available yet? Regards On Wed, Sep 24, 2008 at 13:06, Don Stewart [EMAIL PROTECTED] wrote: daveroundy: On

[Haskell-cafe] Re: Climbing up the shootout...

2008-09-24 Thread Simon Marlow
Manlio Perillo wrote: Don Stewart ha scritto: [...] Ok. So I'll just say: high level, efficient code is an overriding theme of many individuals working on Haskell. Things are better and better each year. We do not stand still. Any roadmap for improve support in intensive IO multiplexing? Or,

Re[8]: [Haskell-cafe] Climbing up the shootout...

2008-09-24 Thread Bulat Ziganshin
Hello Brandon, Wednesday, September 24, 2008, 9:36:56 PM, you wrote: Because he's convinced himself it's pointless because Haskell will never be able to run faster than C taking into account that C compilers are very close to maximum speed possible, and this required many years of developemnt

[Haskell-cafe] Re: Line noise

2008-09-24 Thread Achim Schneider
Mads Lindstrøm [EMAIL PROTECTED] wrote: qsort (x:xs) = ... what would you propose to call the elements? (car:cdar:cddar:cdddr) no discussion. -- (c) this sig last receiving data processing entity. Inspect headers for copyright history. All rights reserved. Copying, hiring, renting,

[Haskell-cafe] Re: Line noise

2008-09-24 Thread Achim Schneider
donn cave [EMAIL PROTECTED] wrote: Quoth Andrew Coppin [EMAIL PROTECTED]: ... | As one experienced C++ programmer put it, there is no clear flow from | left to right or right to left. Personally I found that a little ironic | comming from the language that gave us | | while (*x++ = *y++)

Re: Re[8]: [Haskell-cafe] Climbing up the shootout...

2008-09-24 Thread Brandon S. Allbery KF8NH
On Sep 24, 2008, at 13:44 , Bulat Ziganshin wrote: (note how he keeps trying to run dons out of the discussion because he has proof to the contrary). Don os free to present such examples. unfortunately all examples i've seen was due to use of slow C code which easily can be made faster. in

Re: [Haskell-cafe] Am I doing it right?

2008-09-24 Thread Luke Palmer
On Wed, Sep 24, 2008 at 1:14 PM, Creighton Hogg [EMAIL PROTECTED] wrote: Hi Haskellers, So as another step in my education, I wanted to ask if the following code at least feels 'morally' correct as a find/replace function, replacing each occurrence of the sub-list before with after in the

Re[10]: [Haskell-cafe] Climbing up the shootout...

2008-09-24 Thread Bulat Ziganshin
Hello Brandon, Wednesday, September 24, 2008, 11:13:14 PM, you wrote: can come up with, including amorphous and vacuous ones (you can almost always write something faster, but with how much effort?) as i said, eddorts to optimize Haskell code is several times larger while the result is

[Haskell-cafe] Doing something constructive. [Was: Climbing up the shootout...]

2008-09-24 Thread Don Stewart
manlio_perillo: However I'm looking for a good environment for implementing generic internet servers, or web applications with special needs. As an example one of my maybe future tasks is to write a simple BitTorrent tracker + seeder. You could look at conjure, the bitorrent client that

Re: Re[10]: [Haskell-cafe] Climbing up the shootout...

2008-09-24 Thread Brandon S. Allbery KF8NH
On Sep 24, 2008, at 15:20 , Bulat Ziganshin wrote: Wednesday, September 24, 2008, 11:13:14 PM, you wrote: can come up with, including amorphous and vacuous ones (you can almost always write something faster, but with how much effort?) as i said, eddorts to optimize Haskell code is several

[Haskell-cafe] Random question

2008-09-24 Thread Iain Barnett
Hi, I have a function, that produces a random number between two given numbers rand :: Int - Int - IO Int rand low high = getStdRandom (randomR (low,high)) (Naively) I'd like to write something like take (rand 1 10 ) [1..10] and see [1,2,3,4] ... or anything but nasty type-error

Re: [Haskell-cafe] Random question

2008-09-24 Thread Lev Walkin
Iain Barnett wrote: Hi, I have a function, that produces a random number between two given numbers rand :: Int - Int - IO Int rand low high = getStdRandom (randomR (low,high)) (Naively) I'd like to write something like take (rand 1 10 ) [1..10] and see [1,2,3,4] ... or anything but nasty

Re: [Haskell-cafe] Random question

2008-09-24 Thread Lev Walkin
forgot return, of course: myTake :: IO [Int] myTake = do n - rand 1 10 return $ take n [1..10] Lev Walkin wrote: Iain Barnett wrote: Hi, I have a function, that produces a random number between two given numbers rand :: Int - Int - IO Int rand low high = getStdRandom (randomR

Re: [Haskell-cafe] Random question

2008-09-24 Thread Evan Laforge
On Wed, Sep 24, 2008 at 2:03 PM, Iain Barnett [EMAIL PROTECTED] wrote: Hi, I have a function, that produces a random number between two given numbers rand :: Int - Int - IO Int rand low high = getStdRandom (randomR (low,high)) (Naively) I'd like to write something like take (rand 1 10 )

Re: [Haskell-cafe] Random question

2008-09-24 Thread John Van Enk
And the one liner: (rand 1 10) = return . (\v - take v [1..10]) On Wed, Sep 24, 2008 at 5:10 PM, Lev Walkin [EMAIL PROTECTED] wrote: forgot return, of course: myTake :: IO [Int] myTake = do n - rand 1 10 return $ take n [1..10] Lev Walkin wrote: Iain Barnett wrote: Hi,

[Haskell-cafe] pure Haskell database

2008-09-24 Thread Manlio Perillo
Hi. I need a simple, concurrent safe, database, written in Haskell. A database with the interface of Data.Map would be great, since what I need to to is atomically increment some integer values, and I would like to avoid to use SQLite. Thanks Manlio Perillo

Re: [Haskell-cafe] Random question

2008-09-24 Thread Iain Barnett
Your forgetfulness boosted my ego for a few seconds - I wasn't the only one! :) Thanks very much, that's a big help. Iain On 24 Sep 2008, at 10:10 pm, Lev Walkin wrote: forgot return, of course: myTake :: IO [Int] myTake = do n - rand 1 10 return $ take n [1..10] Lev Walkin

Re[12]: [Haskell-cafe] Climbing up the shootout...

2008-09-24 Thread Bulat Ziganshin
Hello Brandon, Thursday, September 25, 2008, 12:43:55 AM, you wrote: as i said, eddorts to optimize Haskell code is several times larger while the result is several times slower ...and we're back to dons demonstrated otherwise, so you have to please show me example that you mean and i

Re: [Haskell-cafe] pure Haskell database

2008-09-24 Thread Rich Neswold
On Wed, Sep 24, 2008 at 4:17 PM, Manlio Perillo [EMAIL PROTECTED]wrote: I need a simple, concurrent safe, database, written in Haskell. A database with the interface of Data.Map would be great, since what I need to to is atomically increment some integer values, and I would like to avoid to

Re: [Haskell-cafe] Random question

2008-09-24 Thread Henning Thielemann
On Wed, 24 Sep 2008, Iain Barnett wrote: Hi, I have a function, that produces a random number between two given numbers rand :: Int - Int - IO Int rand low high = getStdRandom (randomR (low,high)) If you only need arbitrary numbers, not really random ones, you should stay away from IO:

Re[12]: [Haskell-cafe] Climbing up the shootout...

2008-09-24 Thread Bulat Ziganshin
Hello Brandon, Thursday, September 25, 2008, 12:43:55 AM, you wrote: as i said, eddorts to optimize Haskell code is several times larger while the result is several times slower ...and we're back to dons demonstrated otherwise, so you have to invent reasons to disqualify him. If all you

Re: Re[12]: [Haskell-cafe] Climbing up the shootout...

2008-09-24 Thread david48
On Wed, Sep 24, 2008 at 11:20 PM, Bulat Ziganshin [EMAIL PROTECTED] wrote: please show me example that you mean and i will show exact reasons why this Haskell code wasn't compared to the best C code The shootout seems pretty popular, and there's still a lot of C programmers around, so I wonder

Re: [Haskell-cafe] Injecting Haskell into C

2008-09-24 Thread Anatoly Yakovenko
you'll find this example really helpfull -- Forwarded message -- From: Claude Heiland-Allen [EMAIL PROTECTED] Date: 2008/6/5 Subject: Re: [Haskell-cafe] example of FFI FunPtr To: Galchin, Vasili [EMAIL PROTECTED] Cc: haskell haskell-cafe@haskell.org Galchin, Vasili wrote:

Re: [Haskell-cafe] Random question

2008-09-24 Thread Iain Barnett
On 24 Sep 2008, at 10:13 pm, Evan Laforge wrote: For one approach, check out 'replicate' to make copies of something, and then 'sequence' to run them and return a list. Thanks, I haven't found anything that explains 'sequence' well yet, but I'll keep looking. On 24 Sep 2008, at 10:13 pm,

Re[14]: [Haskell-cafe] Climbing up the shootout...

2008-09-24 Thread Bulat Ziganshin
Hello david48, Thursday, September 25, 2008, 1:38:55 AM, you wrote: please show me example that you mean and i will show exact reasons why this Haskell code wasn't compared to the best C code The shootout seems pretty popular, and there's still a lot of C programmers around, so I wonder why

Re: [Haskell-cafe] Random question

2008-09-24 Thread Henning Thielemann
On Wed, 24 Sep 2008, Iain Barnett wrote: On 24 Sep 2008, at 10:13 pm, Evan Laforge wrote: For one approach, check out 'replicate' to make copies of something, and then 'sequence' to run them and return a list. Thanks, I haven't found anything that explains 'sequence' well yet, but I'll

Re: Re[14]: [Haskell-cafe] Climbing up the shootout...

2008-09-24 Thread John Van Enk
I'm going to have to agree with David... even if you ignore the multi-threaded projects, why couldn't the C programs just implement very specific version of the third party library inside their code? Is there anything stopping them? On Wed, Sep 24, 2008 at 5:50 PM, Bulat Ziganshin [EMAIL

Re: [Haskell-cafe] Climbing up the shootout...

2008-09-24 Thread Alex Sandro Queiroz e Silva
Hallo, John Van Enk wrote: I'm going to have to agree with David... even if you ignore the multi-threaded projects, why couldn't the C programs just implement very specific version of the third party library inside their code? Is there anything stopping them? Maybe they don't care

Re: [Haskell-cafe] pure Haskell database

2008-09-24 Thread Marc Weber
On Wed, Sep 24, 2008 at 11:17:01PM +0200, Manlio Perillo wrote: Hi. I need a simple, concurrent safe, database, written in Haskell. A database with the interface of Data.Map would be great, since what I need to to is atomically increment some integer values, and I would like to avoid

Re: [Haskell-cafe] Random question

2008-09-24 Thread Jonathan Cast
On Wed, 2008-09-24 at 22:44 +0100, Iain Barnett wrote: On 24 Sep 2008, at 10:13 pm, Evan Laforge wrote: For one approach, check out 'replicate' to make copies of something, and then 'sequence' to run them and return a list. Thanks, I haven't found anything that explains 'sequence' well

Re: [Haskell-cafe] Injecting Haskell into C

2008-09-24 Thread Evan Laforge
As I understand, there are two ways to do that. Either Haskell code is called from C, or C code is called for Haskell. So my questions are: 1. Are they both possible? Yep. 2. If yes, which is better performance-wise? (C function is performance-critical). If generated function is called

[Haskell-cafe] Re: Am I doing it right?

2008-09-24 Thread Achim Schneider
Creighton Hogg [EMAIL PROTECTED] wrote: So as another step in my education, I wanted to ask if the following code at least feels 'morally' correct as a find/replace function, replacing each occurrence of the sub-list before with after in the list. Besides not using head, tail and

[Haskell-cafe] Re: Am I doing it right?

2008-09-24 Thread Achim Schneider
Achim Schneider [EMAIL PROTECTED] wrote: Creighton Hogg [EMAIL PROTECTED] wrote: So as another step in my education, I wanted to ask if the following code at least feels 'morally' correct as a find/replace function, replacing each occurrence of the sub-list before with after in the

Re: [Haskell-cafe] Random question

2008-09-24 Thread Brandon S. Allbery KF8NH
On 2008 Sep 24, at 17:44, Iain Barnett wrote: On 24 Sep 2008, at 10:13 pm, Evan Laforge wrote: For one approach, check out 'replicate' to make copies of something, and then 'sequence' to run them and return a list. Thanks, I haven't found anything that explains 'sequence' well yet, but

Re: [Haskell-cafe] Re: Am I doing it right?

2008-09-24 Thread Daniel Fischer
Am Donnerstag, 25. September 2008 00:39 schrieb Achim Schneider: Creighton Hogg [EMAIL PROTECTED] wrote: So as another step in my education, I wanted to ask if the following code at least feels 'morally' correct as a find/replace function, replacing each occurrence of the sub-list before

[Haskell-cafe] [Streams] Couldn't match expected type ?`Distribution.Verbosity.Verbosity'

2008-09-24 Thread Stephane Bortzmeyer
I cannot compile Streams 0.1: % darcs pull Pulling from http://software.pupeno.com/Streams-0.1;... No remote changes to pull in! % make runhaskell Setup.lhs configure Setup.lhs:11:53: Couldn't match expected type `Distribution.Verbosity.Verbosity' against inferred type `IO

Re: [Haskell-cafe] [Streams] Couldn't match expected type ?`Distribution.Verbosity.Verbosity'

2008-09-24 Thread Brandon S. Allbery KF8NH
On 2008 Sep 24, at 20:14, Stephane Bortzmeyer wrote: % ghc --version The Glorious Glasgow Haskell Compilation System, version 6.8.2 You probably have 6.8.2's Cabal (in the 1.2 series), while the package requires 1.4 (and 1.2 isn't smart enough to check versions). -- brandon s. allbery

[Haskell-cafe] Re: [Streams] Couldn't match expected type ?`Distribution.Verbosity.Verbosity'

2008-09-24 Thread Stephane Bortzmeyer
On Wed, Sep 24, 2008 at 08:24:09PM -0400, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote a message of 13 lines which said: You probably have 6.8.2's Cabal (in the 1.2 series), while the package requires 1.4 (and 1.2 isn't smart enough to check versions). How can you check that it

[Haskell-cafe] Re: [Streams] Couldn't match expected type ?`Distribution.Verbosity.Verbosity'

2008-09-24 Thread Brandon S. Allbery KF8NH
On 2008 Sep 24, at 20:30, Stephane Bortzmeyer wrote: On Wed, Sep 24, 2008 at 08:24:09PM -0400, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote a message of 13 lines which said: You probably have 6.8.2's Cabal (in the 1.2 series), while the package requires 1.4 (and 1.2 isn't smart enough to

[Haskell-cafe] Distributing Haskell binaries as OSX App Bundles

2008-09-24 Thread Stephen
I wrote a command-line program recently for a friend in haskell. However, he's far away and not particularly computer literate. I sent him the raw binaries, but they came up with errors about not being able to find libgmp stuff. So then I thought I should probably be able to somehow distribute

[Haskell-cafe] Haskell board game

2008-09-24 Thread Rafael C. de Almeida
Hello, I'm interested in doing a simple board game on haskell. For that I want to be able to draw stuff like the possible player movements and I want to be able to display very simple animations. I want to know what graphical interface library you suggest to me. I have almost no prior experience

Re: [Haskell-cafe] Haskell board game

2008-09-24 Thread Daryoush Mehrtash
check out http://www.haskell.org/soe/ On Wed, Sep 24, 2008 at 7:23 PM, Tim Docker [EMAIL PROTECTED] wrote: I'm interested in doing a simple board game on haskell. For that I want to be able to draw stuff like the possible player movements and I want to be able to display very simple

[Haskell-cafe] need help making sense of the type ...

2008-09-24 Thread Daryoush Mehrtash
I am having hard time making sense of the types in the following example from the Applicative Programming paper: http://www.cs.nott.ac.uk/~ctm/IdiomLite.pdf ap :: Monad m ⇒ m (a → b ) → m a → m b ap mf mx = do f ← mf x ← mx return (f x ) Using this function we could rewrite sequence

Re: [Haskell-cafe] need help making sense of the type ...

2008-09-24 Thread Brandon S. Allbery KF8NH
On 2008 Sep 24, at 22:51, Daryoush Mehrtash wrote: I am having hard time making sense of the types in the following example from the Applicative Programming paper: http://www.cs.nott.ac.uk/~ctm/IdiomLite.pdf ap :: Monad m ⇒ m (a → b ) → m a → m b ap mf mx = do f ← mf x ← mx return

[Haskell-cafe] Red-Blue Stack

2008-09-24 Thread Matthew Eastman
Hey guys, This is probably more of a question about functional programming than it is about Haskell, but hopefully you can help me out. I'm new to thinking about things in a functional way so I'm not sure what the best way to do some things are. I'm in a data structures course right now,

Re: [Haskell-cafe] Doing something constructive. [Was: Climbing up the shootout...]

2008-09-24 Thread Bryan O'Sullivan
On Wed, Sep 24, 2008 at 12:31 PM, Don Stewart [EMAIL PROTECTED] wrote: Twisted (a Python asynchronous framework) is a confortable environment, but I feel concurrent Haskell is superior. Should be a lot faster, given there's compiled native code, and no global locks. The concurrent Haskell

[Haskell-cafe] if - then - else layout

2008-09-24 Thread leledumbo
consider this partial program: if n5 then putStrLn big else putStrLn small this works fine in hugs, but in ghc I must change it to: if n5 then putStrLn big else putStrLn small -- View this message in context:

Re: [Haskell-cafe] Red-Blue Stack

2008-09-24 Thread Jamie Brandon
Try writing data RBStack = RBS [RBSItem] [RBSItem] where the first list are all the same colour and the start of the second list is a different colour. The rest should follow naturally and you will get amortised O(1) push and pop (you occasionally have to juggle the lists). By the way, for this

Re: [Haskell-cafe] if - then - else layout

2008-09-24 Thread Brandon S. Allbery KF8NH
On 2008 Sep 25, at 0:47, leledumbo wrote: consider this partial program: if n5 then putStrLn big else putStrLn small this works fine in hugs, but in ghc I must change it to: if n5 then putStrLn big else putStrLn small Actually, this also works: if n 5 then putStrLn big

Re: [Haskell-cafe] if - then - else layout

2008-09-24 Thread Fraser Wilson
I think you mean in a do. There is a proposal to fix this in Haskell' cheers, Fraser On Sep 25, 2008, at 6:59, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: On 2008 Sep 25, at 0:47, leledumbo wrote: consider this partial program: if n5 then putStrLn big else putStrLn small this works

[Haskell-cafe] Google Android

2008-09-24 Thread Galchin, Vasili
Hello, Do there currently (or in the works) exist FFI bindings for Google's Android API? Kind regards, Vasili ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe