Re: [Haskell-cafe] Re: True Random Numbers

2010-04-09 Thread Gökhan San
+) 0) Using 'sum' turned to be rather misleading (took up to a minute to sum up 'Double's; this problem was less apparent for p1), so I had to use foldl' here to get consistent results between 'Int's and 'Double's. '`using` rnf' produced similar re

Re: [Haskell-cafe] Re: True Random Numbers

2010-04-07 Thread Gökhan San
sing StdGen), I noticed that while performance is comparable, using getRandomRs to get a list of random numbers is a lot faster than replicating uniform (or getRandomR for that matter). I don't know if this kind of speed gain makes sense for random-fu though.

Re: [Haskell-cafe] Re: True Random Numbers

2010-04-03 Thread Gökhan San
rot. Its RandomGen instance lacks the split functionality but I guess it could be used with MonadRandom. -- Gökhan San ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Function to cast types

2009-03-22 Thread Gökhan San
;-' : itos (negate x) | x < 10= "0123456789" !! x : "" | otherwise = let (q, r) = x `quotRem` 10 in itos q ++ itos r -- Gökhan San ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] [ANN] random-stream package

2009-03-19 Thread Gökhan San
Manlio Perillo writes: > Gökhan San ha scritto: >> Manlio Perillo writes: >> >>> The stream generator implements tha RandomGen interface. >> >> This is really cool, though I think 'split' is a must. Maybe all >> instances could share the same

Re: [Haskell-cafe] [ANN] random-stream package

2009-03-19 Thread Gökhan San
my system, it is less than 2 times slower than StdGen. -- Gökhan San ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] nooby question on typing

2008-09-13 Thread Gökhan San
On Saturday September 13 2008, Han Joosten wrote: > >  data Rule = RuRule > >            | SgRule > >            | GcRule > >            | FrRule > >                deriving (Eq,Show) Here, Rule is a type constructor, whereas RuRule and others are data constructors. Just like: > data Bool = Fals

Re: [Haskell-cafe] Inductive graphs memory usage

2008-07-11 Thread Gökhan San
On Friday July 11 2008, Don Stewart wrote: > Do you have the bencmark code? I'd like to try a couple of variants on > the underlying structures. It's not a thorough test but I suppose it gives an impression about performance. -- Gokhan $ ghc -O -prof --make TestGraph $ ./TestGraph +RTS -s -P -R

Re: [Haskell-cafe] Inductive graphs memory usage

2008-07-11 Thread Gökhan San
On Friday July 11 2008, Andre Nathan wrote: > On Thu, 2008-07-10 at 16:52 -0700, Don Stewart wrote: > > Well, they're radically different graph representations, and fgl > > hasn't been designed for large graphs. > > Do you know if King and Launchbury's implementation (Data.Graph) scales > better?

[Haskell-cafe] Dynamic curiosity

2008-06-07 Thread Gökhan San
Hello All, I've recently modified my existing project to support dynamic data (using 'Data.Dynamic'), and despite my earlier benchmarks on 'Dynamic', the program slowed down by a factor of 10. Profiler says that 'fromDynamic' is consuming 60% of the CPU time (with -O2). Using the below functio

Re: [Haskell-cafe] fgl Data.Graph examples

2008-05-16 Thread Gökhan San
Hi, I'm new to this, but I'll give it a shot. > import Data.Graph.Inductive There are several ways to build a graph. Let's say, node labels are 'String's and edge labels are 'Double's. Edge labels would be the weights. > grs :: [Gr String Double] The below four lines generate the same graph.

Re: [Haskell-cafe] Data.Dynamic over the wire

2008-05-14 Thread Gökhan San
Hi, > {-# LANGUAGE ExistentialQuantification, ScopedTypeVariables #-} Following the related discussion on #haskell, I ended up writing the below code (thanks to the suggestions). This is for a genetic programming library, but the usage would be similar. It also (de)serializes TypeRep. I'm a has