[Haskell-cafe] Array Binary IO molecular simulation

2009-05-01 Thread Grigory Sarnitskiy
Hello!I'm interested in computer simulation of molecular systems, especially liquids. Maybe some would say Haskell is far from best choice in the case, but I really like the ease of writing programs in Haskell.So I wonder of existing projects of such type, both Molecular dynamics and Monte Carlo

[Haskell-cafe] ANNOUNCE: graphviz-2009.5.1

2009-05-01 Thread Ivan Lazar Miljenovic
I'd like to announce version 2009.5.1[1] of the graphviz[2] library, less than a week since Matthew Sackman passed maintainership onto me[3]. The graphviz library provides a Haskell interface to the GraphViz[4] program. [1]

Re: [Haskell-cafe] Few Alex questions

2009-05-01 Thread Bernie Pope
2009/5/1 Dimitry Golubovsky golubov...@gmail.com snip Can beginning of line (caret) be recognized by Alex? You can match the start of a line using a (left) context on a rule. See the docs here: http://www.haskell.org/alex/doc/html/alex-files.html#contexts Where it says: The left context

Re: [Haskell-cafe] Thread priority?

2009-05-01 Thread maarten
Hi all, Some two year I wrote a library to change thread priorities in Windows, including another library that allows real time processing. With this you can play midi files real time and without interruption from the OS. (Manipulating thread priorities is really easy in Windows, real time

Re: [Haskell-cafe] [tryReadAdvChan :: AdvChan a - IO (Maybe a)] problems

2009-05-01 Thread Neil Davies
Belka You've described what you don't want - what do you want? Given that the fundamental premise of a DDoS attack is to saturate resources so that legitimate activity is curtailed - ultimately the only response has to be to discard load, preferably not the legitimate load (and therein

[Haskell-cafe] Estimating the time to garbage collect

2009-05-01 Thread Neil Davies
Hi With the discussion on threads and priority, and given that (in Stats.c) there are lots of useful pieces of information that the run time system is collecting, some of which is already visible (like the total amount of memory mutated) and it is easy to make other measures available -

Re: [Haskell-cafe] chr/ord?

2009-05-01 Thread michael rice
Understood. Thanks. A little further on in the tutorial they define a parent function. The mplus operator is used to combine monadic values from separate computations into a single monadic value. Within the context of our sheep-cloning example, we could use Maybe's mplus to define a function,

Re: [Haskell-cafe] chr/ord?

2009-05-01 Thread michael rice
Thank you. I assumed when I saw this:   we could use Maybe's mplus to define a function, parent s = (mother s) `mplus` (father s) that mplus was *already* present in Maybe. Michael --- On Fri, 5/1/09, Neil Mitchell ndmitch...@gmail.com wrote: From: Neil Mitchell ndmitch...@gmail.com Subject:

Re: [Haskell-cafe] Array Binary IO molecular simulation

2009-05-01 Thread Claus Reinke
So I wonder of existing projects of such type, both Molecular dynamics and Monte Carlo methods. The fastest Haskell Monte Carlo code I've seen in action is Simon's port of a Monte Carlo Go engine: http://www.haskell.org/pipermail/haskell-cafe/2009-March/057982.html

Re: [Haskell-cafe] chr/ord?

2009-05-01 Thread Neil Mitchell
Hi But I get this when I try to use it: sheep.hs:30:22: Not in scope: `mplus' [mich...@localhost ~]$ You need to import Control.Monad. You can find answers to these sorts of questions with Hoogle: http://haskell.org/hoogle/?hoogle=mplus Thanks Neil

Re: [Haskell-cafe] swish - semantic web in Haskell

2009-05-01 Thread Doug Burke
--- On Thu, 4/30/09, Vasili I. Galchin vigalc...@gmail.com wrote: From: Vasili I. Galchin vigalc...@gmail.com Subject: [Haskell-cafe] swish - semantic web in Haskell To: haskell-cafe@haskell.org haskell-cafe@haskell.org Cc: Galchin Vasili vigalc...@gmail.com Date: Thursday, April 30, 2009,

Re: [Haskell-cafe] Estimating the time to garbage collect

2009-05-01 Thread John Van Enk
I think the problem becomes slightly easier if you can provide an upper bound on the time GC will take. If I understand your problem domain, Neil, you're most concerned with holding up other processes/partitions who are expecting to have a certain amount of processing time per frame. If we can

[Haskell-cafe] Re: Estimating the time to garbage collect

2009-05-01 Thread Achim Schneider
Neil Davies semanticphilosop...@googlemail.com wrote: Ignoring, at least for the moment, all the issues of paging, processor cache occupancy etc, what are the complexity drivers for the time to GC? It largely depends on the GC implementation, especially when you interpret time to GC as time

[Haskell-cafe] ANN: Takusen 0.8.4

2009-05-01 Thread Alistair Bayley
ANN: Takusen 0.8.4 This is mainly a get it working with ghc-6.10 release. Changes since 0.8.3: - ODBC support: some bug fixes, and basic support for Out-parameters. There is at least one major outstanding bug with Out-parameters, where marshalling a String output bind-variable doesn't

[Haskell-cafe] Generating random enums

2009-05-01 Thread michael rice
I'm using the code below to generate random days of the week [Monday..Sunday]. Is there a better/shorter way to do this? Michael == [mich...@localhost ~]$ ghci dow GHCi, version 6.10.1: http://www.haskell.org/ghc/  :? for help Loading package ghc-prim ... linking ... done. Loading

Re: [Haskell-cafe] Generating random enums

2009-05-01 Thread John Van Enk
When you derive Enum, you get fromEnum and toEnum for free. You don't need your dow2Int stuff or int2Dow. Replace those with fromEnum and toEnum respectively. /jve On Fri, May 1, 2009 at 12:26 PM, michael rice nowg...@yahoo.com wrote: I'm using the code below to generate random days of the

Re: [Haskell-cafe] Generating random enums

2009-05-01 Thread Thomas Hartman
see http://www.mail-archive.com/haskell-cafe@haskell.org/msg38528.html for some ideas, particularly antoine latter's answer. 2009/5/1 michael rice nowg...@yahoo.com: I'm using the code below to generate random days of the week [Monday..Sunday]. Is there a better/shorter way to do this?

Re: [Haskell-cafe] Generating random enums

2009-05-01 Thread Thomas Hartman
So... I must say I am rather pleased with the following code. It allows you to use any value of type Bounded and Enum as a member of Random, or Arbitrary, which means you can quickCheck properties on it as well. For quickchecking, the code below cheats by not defining the coarbitrary funciton,

Re: [Haskell-cafe] Generating random enums

2009-05-01 Thread Felipe Lessa
On Fri, May 01, 2009 at 01:08:26PM -0500, Thomas Hartman wrote: For quickchecking, the code below cheats by not defining the coarbitrary funciton, which I confess I don't really understand and never use. FWIW, QuickCheck 2 separates 'coarbitrary' in a different class. -- Felipe.

[Haskell-cafe] fromInteger for Lists

2009-05-01 Thread Paul Keir
There's nothing better than making a data type an instance of Num. In particular, fromInteger is a joy. But how about lists? For example, if I have data Foo a = F [a] I can create a fromInteger such as fromInteger i = F [fromInteger i] and then a 19::(Foo Int), could become F [19]. Is it

[Haskell-cafe] What to do when cabal dependencies are not your friend.

2009-05-01 Thread Thomas Hartman
I did a little write-up on an annoyance I frequently have when developing patch-tag, a happs application that has a lot of dependencies. Basically, on a virgin linux environment with the same cabal and ghc version as before, a cabal install that had previously worked, didn't work anymore. I

Re: [Haskell-cafe] Thread priority?

2009-05-01 Thread Henning Thielemann
On Fri, 1 May 2009, maarten wrote: Actually, I thought this problem was already resolved (haskore-realtime), I haven't done anything advanced in that package. I have e.g. not touched any priority. ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Generating random enums

2009-05-01 Thread Ryan Ingram
On Fri, May 1, 2009 at 11:08 AM, Thomas Hartman tphya...@gmail.com wrote: For quickchecking, the code below cheats by not defining the coarbitrary funciton, which I confess I don't really understand and never use. coarbitrary is simple; it's used for generating arbitrary functions. If you

Re: [Haskell-cafe] What to do when cabal dependencies are not your friend.

2009-05-01 Thread Duncan Coutts
On Fri, 2009-05-01 at 16:55 -0500, Thomas Hartman wrote: I did a little write-up on an annoyance I frequently have when developing patch-tag, a happs application that has a lot of dependencies. Basically, on a virgin linux environment with the same cabal and ghc version as before, a cabal

Re: [Haskell-cafe] fromInteger for Lists

2009-05-01 Thread John Dorsey
Paul, There's nothing better than making a data type an instance of Num. In particular, fromInteger is a joy. But how about lists? Do you mean something like Blargh below, only useful? John dor...@elwood:~/src/scratch$ cat list.hs class Blargh f where fromList :: [a] - f a data Foo a =

Re: [Haskell-cafe] fromInteger for Lists

2009-05-01 Thread andy morris
2009/5/1 Paul Keir pk...@dcs.gla.ac.uk: There's nothing better than making a data type an instance of Num. In particular, fromInteger is a joy. But how about lists? For example, if I have data Foo a = F [a] I can create a fromInteger such as fromInteger i = F [fromInteger i] and then a

[Haskell-cafe] Re: [Haskell] ANN: Takusen 0.8.4

2009-05-01 Thread Duncan Coutts
On Fri, 2009-05-01 at 16:16 +0100, Alistair Bayley wrote: ANN: Takusen 0.8.4 The release bundle: http://hackage.haskell.org/packages/archive/Takusen/0.8.4/Takusen-0.8.4.tar.gz If you have cabal-install, then this command should work: cabal install Takusen --flags=sqlite odbc oracle

Re: [Haskell-cafe] fromInteger for Lists

2009-05-01 Thread Ryan Ingram
I wish for a language extension OverloadedLiterals that includes all of these: 1 = fromInteger 1 hello = fromString hello ['a', 'b', 'c'] = cons 'a' (cons 'b' (cons 'c' nil)) [ ord x | x - ['a', 'b', 'c'], ok x ] = cons 'a' (cons 'b' (cons 'c' nil)) = \x - guard (ok x) return (ord x) Maybe

Re: [Haskell-cafe] fromInteger for Lists

2009-05-01 Thread Henning Thielemann
Paul Keir schrieb: There's nothing better than making a data type an instance of Num. In particular, fromInteger is a joy. But how about lists? http://www.haskell.org/haskellwiki/Num_instance_for_functions http://www.haskell.org/haskellwiki/Type_classes_are_for_reusability

[Haskell-cafe] gcd

2009-05-01 Thread Steve
[Question moved over from Haskell-Beginners] I had a look at the gcd definition in GHC 6.10.1 ghc-6.10.1/libraries/base/GHC/Real.lhs -- | @'gcd' x y@ is the greatest (positive) integer that divides both @x@ -- and @y@; for example @'gcd' (-3) 6@ = @3@, @'gcd' (-3) (-6)@ = @3@, -- @'gcd' 0 4@ =

Re: [Haskell-cafe] The Haskell Reddit is 1 year old

2009-05-01 Thread Jason Dusek
Happy Birthday! -- Jason Dusek ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] traversing a tree using monad.cont

2009-05-01 Thread Anatoly Yakovenko
So I am trying to traverse a tree in a specific order, but i have no idea where the things that i am looking for are located, and i want to avoid explicit backtracking. I was thinking i could do it with the continuation monad. Here is what i have module TestCont where import Control.Monad.Cont

Re: [Haskell-cafe] swish - semantic web in Haskell

2009-05-01 Thread John Lask
you might like to change the name of the package slightly and thereby avoid confusion with swish the text indexing engine. jvl - Original Message - From: Doug Burke doug_j_bu...@yahoo.com To: Vasili I. Galchin vigalc...@gmail.com Cc: haskell-cafe@haskell.org Sent: Friday, May 01,

Re: [Haskell-cafe] traversing a tree using monad.cont

2009-05-01 Thread Luke Palmer
On Fri, May 1, 2009 at 8:47 PM, Anatoly Yakovenko aeyakove...@gmail.comwrote: So I am trying to traverse a tree in a specific order, but i have no idea where the things that i am looking for are located, and i want to avoid explicit backtracking. Though I don't fully understand what you are

Re: [Haskell-cafe] swish - semantic web in Haskell

2009-05-01 Thread Vasili I. Galchin
Hi John, I am not the author of Swish so I have absolutely no control ... I sympathize with you and I can bring up with the author ...In any case,I have read through a lot of the code and Swish/swish is pervasive .. so that may prove a readability problem. Kind regards, Vasili On Fri, May 1,

Re: [Haskell-cafe] [tryReadAdvChan :: AdvChan a - IO (Maybe a)] problems

2009-05-01 Thread Belka
Thanks, Niel. :) You actually motivated me to determine/specify defense requirements - that I should have done long before writing here. Now I'm not experienced in DDoSs defending, so my reasoning here might be a bit voulnerable. Few basic requirements: 1. Server has services that shouldn't be