[Haskell-cafe] A yet another question about subtyping and heterogeneous collections

2012-10-18 Thread oleg
First of all, MigMit has probably suggested the parameterization of Like by the constraint, something like the following: data Like ctx = forall a. (ctx a, Typeable a) => Like a instance ALike (Like ALike) where toA (Like x) = toA x instance CLike (Like CLike) where toC (Like x) = toC x

[Haskell-cafe] acid-state audit trail

2012-10-18 Thread Richard Wallace
Hey all, I've been looking at acid-state as a possible storage backend for an application. It looks like it fits my needs pretty damn well, but one thing that I'm curious about is if it is possible to get a list of "update events". You can obviously query for the current state, but it's not imme

Re: [Haskell-cafe] A yet another question about subtyping and heterogeneous collections

2012-10-18 Thread AntC
Roman Cheplyaka ro-che.info> writes: > > * Dmitry Vyal gmail.com> [2012-10-18 17:31:13+0400] > > On 10/18/2012 03:20 PM, MigMit wrote: > > >Why do you need "ALike x", "BLike x" etc.? Why not just "Like u x"? > > > > > > > Hmm, looks like a nice idea. I tried it, unfortunately I can't cope > >

Re: [Haskell-cafe] Getting PID of a child process

2012-10-18 Thread Donn Cave
Quoth Jason Dusek , > Using `System.Process.runInteractiveProcess', I can start a process > and get a handle to it: > > runInteractiveProcess >:: FilePath >-> [String] >-> Maybe FilePath >-> Maybe [(String, String)] >-> IO (Handle, Handle, Handle, ProcessHandle) > > For dia

[Haskell-cafe] ANNOUNCE: apphointments - A simple functional calendar

2012-10-18 Thread Steffen Schuldenzucker
Dear Café, I just wrote myself a small (~ 200 LOC) calendar application today. https://bitbucket.org/rainmaker/apphointments Comments/Patches welcome. From the readme: apphointments - A simple functional calendar This is a "UI = Code" calendar ap

Re: [Haskell-cafe] Getting PID of a child process

2012-10-18 Thread Gwern Branwen
On Thu, Oct 18, 2012 at 5:03 PM, Jason Dusek wrote: > For diagnostic purposes, I'd like to print the PID of the > process attached to this handle -- how best to do that? In Mueval when I wanted the PID (so I could later send sigkills), I did this: hdl <- runProcess "mueval-core" args N

[Haskell-cafe] Getting PID of a child process

2012-10-18 Thread Jason Dusek
Hi All, Using `System.Process.runInteractiveProcess', I can start a process and get a handle to it: runInteractiveProcess :: FilePath -> [String] -> Maybe FilePath -> Maybe [(String, String)] -> IO (Handle, Handle, Handle, ProcessHandle) For diagnostic purposes, I'd like to prin

Re: [Haskell-cafe] How to correctly benchmark code with Criterion?

2012-10-18 Thread Thomas Schilling
On 18 October 2012 13:15, Janek S. wrote: >> Something like this might work, not sure what the canonical way is. >> (...) > > This is basically the same as the answer I was given on SO. My concerns about > this solutions are: > - rnf requires its parameter to belong to NFData type class. This is

Re: [Haskell-cafe] How to correctly benchmark code with Criterion?

2012-10-18 Thread Thomas Schilling
Yes, Criterion always discards the time of the first evaluation. On 18 October 2012 15:06, Janek S. wrote: >> So the evaluation will be included in the benchmark, but if "bench" is >> doing enough trials it will be statistical noise. > When I intentionally delayed my dataBuild function (using del

Re: [Haskell-cafe] Teaching Haskell @ MOOCs like Coursera or Udacity

2012-10-18 Thread Thiago Negri
+1 2012/10/18 niket : > I would love to see Haskell growing on such new platforms! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Teaching Haskell @ MOOCs like Coursera or Udacity

2012-10-18 Thread niket
I am a novice in Haskell but I would love to see the gurus out here teaching Haskell on MOOCs like Coursera or Udacity. Dr Martin Odersky is doing it for Scala here: https://www.coursera.org/course/progfun I would love to see Haskell growing on such new platforms! Regards, Niket

Re: [Haskell-cafe] A yet another question about subtyping and heterogeneous collections

2012-10-18 Thread Roman Cheplyaka
* Dmitry Vyal [2012-10-18 17:31:13+0400] > On 10/18/2012 03:20 PM, MigMit wrote: > >Why do you need "ALike x", "BLike x" etc.? Why not just "Like u x"? > > > > Hmm, looks like a nice idea. I tried it, unfortunately I can't cope > with compiler error messages: > > tst.hs:32:15: > Context redu

Re: [Haskell-cafe] How to correctly benchmark code with Criterion?

2012-10-18 Thread Antoine Latter
On Thu, Oct 18, 2012 at 9:06 AM, Janek S. wrote: >> So the evaluation will be included in the benchmark, but if "bench" is >> doing enough trials it will be statistical noise. > > When I intentionally delayed my dataBuild function (using delayThread > 100) the estimated time > of benchmark wa

Re: [Haskell-cafe] How to correctly benchmark code with Criterion?

2012-10-18 Thread Janek S.
> So the evaluation will be included in the benchmark, but if "bench" is > doing enough trials it will be statistical noise. When I intentionally delayed my dataBuild function (using delayThread 100) the estimated time of benchmark was incorrect, but when I got the final results all runs were

Re: [Haskell-cafe] How to correctly benchmark code with Criterion?

2012-10-18 Thread Antoine Latter
On Thu, Oct 18, 2012 at 4:23 AM, Janek S. wrote: > Dear list, > > during past few days I spent a lot of time trying to figure out how to write > Criterion benchmarks, > so that results don't get skewed by lazy evaluation. I want to benchmark > different versions of an > algorithm doing numerical

Re: [Haskell-cafe] A yet another question about subtyping and heterogeneous collections

2012-10-18 Thread Dmitry Vyal
On 10/18/2012 03:20 PM, MigMit wrote: Why do you need "ALike x", "BLike x" etc.? Why not just "Like u x"? Hmm, looks like a nice idea. I tried it, unfortunately I can't cope with compiler error messages: tst.hs:32:15: Context reduction stack overflow; size = 201 Use -fcontext-stack=

Re: [Haskell-cafe] How to correctly benchmark code with Criterion?

2012-10-18 Thread Janek S.
> Something like this might work, not sure what the canonical way is. > (...) This is basically the same as the answer I was given on SO. My concerns about this solutions are: - rnf requires its parameter to belong to NFData type class. This is not the case for some data structures like Repa ar

Re: [Haskell-cafe] A yet another question about subtyping and heterogeneous collections

2012-10-18 Thread MigMit
Why do you need "ALike x", "BLike x" etc.? Why not just "Like u x"? Отправлено с iPhone Oct 18, 2012, в 14:36, Dmitry Vyal написал(а): > Hello list! > > I've been experimenting with emulating subtyping and heterogeneous > collections in Haskell. I need this to parse a binary representation of

[Haskell-cafe] A yet another question about subtyping and heterogeneous collections

2012-10-18 Thread Dmitry Vyal
Hello list! I've been experimenting with emulating subtyping and heterogeneous collections in Haskell. I need this to parse a binary representation of objects of a class hierarchy in C++ program. So far I implemented upcasting using a chain of type classes and now I'm playing with heterogene

[Haskell-cafe] Fwd: hdbc parametrized select

2012-10-18 Thread Wilfried van Asten
This was not sent to the cafe since I used the wrong from address. -- Forwarded message -- From: Asten, W.G.G. van (Wilfried, Student M-CSC) Date: Thu, Oct 18, 2012 at 12:27 PM Subject: Re: [Haskell-cafe] hdbc parametrized select To: s9gf4...@gmail.com Cc: haskell-cafe@haskell.org

Re: [Haskell-cafe] How to correctly benchmark code with Criterion?

2012-10-18 Thread Alfredo Di Napoli
I don't know if you have already read them, but Tibell's slides on High Performance Haskell are pretty good: http://www.slideshare.net/tibbe/highperformance-haskell There is a section at the end where he runs several tests using Criterion. HTH, A. On 18 October 2012 11:45, Claude Heiland-Allen

Re: [Haskell-cafe] How to correctly benchmark code with Criterion?

2012-10-18 Thread Claude Heiland-Allen
Hi Janek, On 18/10/12 10:23, Janek S. wrote: during past few days I spent a lot of time trying to figure out how to write Criterion benchmarks, so that results don't get skewed by lazy evaluation. I want to benchmark different versions of an algorithm doing numerical computations on a vector.

[Haskell-cafe] How to correctly benchmark code with Criterion?

2012-10-18 Thread Janek S.
Dear list, during past few days I spent a lot of time trying to figure out how to write Criterion benchmarks, so that results don't get skewed by lazy evaluation. I want to benchmark different versions of an algorithm doing numerical computations on a vector. For that I need to create an inpu

Re: [Haskell-cafe] tplot (out of memory)

2012-10-18 Thread malcolm.wallace
Did you ever solve this?  I have a similar message ( user error (out of memory) ) arising from a different app (not tplot) that uses the Haskell Chart library (and cairo underneath).  On some linux machines, it crashes, on others it works fine.  I can find no environment differences between the mac

[Haskell-cafe] hdbc parametrized select

2012-10-18 Thread s9gf4ult
does hdbc have parametrized selects ? There is execute execute :: Statement -> [SqlValue] -> IO Integer and some other functions which get list of parameters but return IO Integer or IO () and there is other couple of functions fetchRow :: Statement -> IO (Maybe [SqlValue]) which return values of