[Haskell-cafe] Re: programmatic DB interface?

2010-02-04 Thread Günther Schmidt
Hello Johannes, I think you are looking for HaskellDB, you can find it on hackage. I've been working with it myself and can absolutely recommend it. It is actively maintained by Justin Bailey. It's a EDSL for relational algebra which gets translated into SQL. It can use HDBC for instance as

[Haskell-cafe] Re: programmatic DB interface?

2010-02-04 Thread Johannes Waldmann
I think you are looking for HaskellDB, thanks, I'll look into it. As with LINQ you need to put an initial effort into describing the tables [...] according to the documentation, that's what dbdirect is for? I see the source, but not how to build it. J.

[Haskell-cafe] Re: programmatic DB interface?

2010-02-04 Thread Johannes Waldmann
can use HDBC for instance as its *driver* to databases supported by HDBC. ok, so I guess I need haskelldb-hdbc-postgresql but hdbc-postgresql has build failures http://hackage.haskell.org/package/HDBC-postgresql ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Re: programmatic DB interface?

2010-02-04 Thread Ivan Lazar Miljenovic
Johannes Waldmann waldm...@imn.htwk-leipzig.de writes: ok, so I guess I need haskelldb-hdbc-postgresql but hdbc-postgresql has build failures http://hackage.haskell.org/package/HDBC-postgresql Looks like HDBC-postgresql's Setup.hs needs to be updated to use newer versions of Cabal properly;

[Haskell-cafe] Re: programmatic DB interface?

2010-02-04 Thread Johannes Waldmann
if you're using the latest release of the Haskell Platform [...] but this would not work with ghc-6.12 ... Anyway the trick is to remove AnyVersion from Setup.hs (thanks, Michael!) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Re: GUI programming

2010-02-04 Thread Heinrich Apfelmus
Victor Nazarov wrote: Speaking about packages. What is current community status of monad transformers packages. I'm using MonadIO class and there are mtl, monads-fd, monads-tf packages that provide it. I personally prefer type families to functional dependencies. Should I use monads-tf, or

Re: [Haskell-cafe] Re: programmatic DB interface?

2010-02-04 Thread Felipe Lessa
On Thu, Feb 04, 2010 at 09:26:43AM +0100, Günther Schmidt wrote: I think you are looking for HaskellDB, you can find it on hackage. I've been working with it myself and can absolutely recommend it. It is actively maintained by Justin Bailey. It's been some time since I last tried HaskellDB

Re: [Haskell-cafe] functional references and HList?

2010-02-04 Thread Martijn van Steenbergen
Edward Kmett wrote: Functional references let you both read and write 'attributes' in a structure. These can be chained to access members of members. You can also use them to build bidirectional views on fields (and compose those again as well). Martijn.

Re: [Haskell-cafe] functional references and HList?

2010-02-04 Thread Günther Schmidt
Hi, from all this I'm not so sure that these two techniques do not overlap. I mean HList tries to provide a technique for extensible Records, or composable data structures. So far it is possible in Haskell to extend / compose Data Structures but not at run-time and also rather clumsily.

Re: [Haskell-cafe] programmatic DB interface?

2010-02-04 Thread Alistair Bayley
What is currently the recommended higher level data base interface for Haskell? I want to construct queries in a programmatic/algebraic way, Would takusen help? Where's its home page? this does not work: http://darcs.haskell.org/takusen/ Takusen still requires you to supply queries as

[Haskell-cafe] Nested Types stack size ...

2010-02-04 Thread Günther Schmidt
Hi, I'm using deeply nested types in my app and exceed some stack-size in ghci. I can't remember the runtime option I have to pass to ghci anymore, it's been about a year since I last pursued this approach. Is it also possible to set this stack-size via pragma in the source code? Günther

Re: [Haskell-cafe] Nested Types stack size ...

2010-02-04 Thread Ron de Bruijn
Hi, Günther Schmidt schreef: Hi, I'm using deeply nested types in my app and exceed some stack-size in ghci. I can't remember the runtime option I have to pass to ghci anymore, it's been about a year since I last pursued this approach. ghci +RTS --help suggests -Ksize Sets the maximum

[Haskell-cafe] Re: Nested Types stack size ...

2010-02-04 Thread Günther Schmidt
Hello Ron, thank you, but it was not the run-time stack size I meant. It was the stack size for nested types which defaults to 20 or so IIRC. My nested types currently go to about 23 deep. Günther Am 04.02.10 14:46, schrieb Ron de Bruijn: Hi, Günther Schmidt schreef: Hi, I'm using

Re: [Haskell-cafe] Re: Nested Types stack size ...

2010-02-04 Thread Serguey Zefirov
2010/2/4 Günther Schmidt gue.schm...@web.de: Hello Ron, thank you, but it was not the run-time stack size I meant. It was the stack size for nested types which defaults to 20 or so IIRC. My nested types currently go to about 23 deep. -fcontext-stack=100

[Haskell-cafe] Translation of Haskell type classes

2010-02-04 Thread Enrique Martín
Hello all, few days ago I made some experiments with Haskell type classes. I wrote a small Haskell program for searching in sorted lists, defining my own type classes for equality (MyEq) and order (MyOrd) so that they only have one member function:

Re: [Haskell-cafe] Re: Nested Types stack size ...

2010-02-04 Thread Günther Schmidt
Hello Serguey, great, that's the one! Can I set this in the source code itself too? Günther Am 04.02.10 15:26, schrieb Serguey Zefirov: 2010/2/4 Günther Schmidtgue.schm...@web.de: Hello Ron, thank you, but it was not the run-time stack size I meant. It was the stack size for nested

Re: [Haskell-cafe] Re: Nested Types stack size ...

2010-02-04 Thread Serguey Zefirov
2010/2/4 Günther Schmidt gue.schm...@web.de: Hello Serguey, great, that's the one! Can I set this in the source code itself too? No, as far as I know. Last time I tried it on 6.10.1, so it's pretty far from now. ;) ___ Haskell-Cafe mailing list

Re[2]: [Haskell-cafe] Re: Nested Types stack size ...

2010-02-04 Thread Bulat Ziganshin
Hello Günther, Thursday, February 4, 2010, 6:49:05 PM, you wrote: Can I set this in the source code itself too? http://www.haskell.org/ghc/docs/latest/html/users_guide/flag-reference.html says that this option is dynamic so afaik it should work -- Best regards, Bulat

[Haskell-cafe] safe lazy IO or Iteratee?

2010-02-04 Thread David Leimbach
Hi everyone, This is not an attempt to start a flame war. I'm just trying to get a good feel for the advantages and disadvantages of the newer safe lazy io lib available on Hackage vs using Iteratee. It does appear to me that using something like Itereatee gives a bit of room to really tweak

[Haskell-cafe] Sparks created, but not used (par/pseq, ST monad)

2010-02-04 Thread Michael Lesniak
Hello haskell-cafe, I currently have a problem with running par/pseq in the ST monad. The function testST is the minimal counterexample that works -- or, to be more clear, does not work as expected for me. As a remark, the tasks/function calls in my real application are much more computational

[Haskell-cafe] Stack ADT?

2010-02-04 Thread michael rice
Can't find a Stack datatype on Hoogle? Where should I look? Michael ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Stack ADT?

2010-02-04 Thread Sebastian Fischer
On Feb 4, 2010, at 6:07 PM, michael rice wrote: Can't find a Stack datatype on Hoogle? Where should I look? Could not find one on Hackage either. Probably because its so easy to handcraft your own: newtype Stack a = Stack [a] emptyStack = Stack [] isEmptyStack (Stack xs) =

[Haskell-cafe] Re: programmatic DB interface?

2010-02-04 Thread Johannes Waldmann
anyone know what's happening here? I get this when executing a query via haskelldb-hdbc-postgresql-0.12 (The date is actually in the DB, so it's not a connection problem.) Convertible: error converting source data SqlString 2008-10-29 00:00:00 of type SqlValue to type

Re: [Haskell-cafe] Stack ADT?

2010-02-04 Thread michael rice
I was looking here: http://www.haskell.org/haskellwiki/Abstract_data_type I haven't done much with modules so I'm guessing what you've provided is the guts of StackImpl, to hide the implementation? Thanks, Michael --- On Thu, 2/4/10, Sebastian Fischer s...@informatik.uni-kiel.de wrote: From:

Re: [Haskell-cafe] Stack ADT?

2010-02-04 Thread Casey Hawthorne
On Thu, 4 Feb 2010 09:07:28 -0800 (PST), you wrote: Can't find a Stack datatype on Hoogle? Where should I look? Michael From Algorithms: a functional programming approach Second edition Fethi Rabhi Guy Lapalme data Stack a= EmptyStk

Re: [Haskell-cafe] Re: programmatic DB interface?

2010-02-04 Thread Colin Paul Adams
Johannes == Johannes Waldmann waldm...@imn.htwk-leipzig.de writes: Johannes anyone know what's happening here? I get this when Johannes executing a query via haskelldb-hdbc-postgresql-0.12 (The Johannes date is actually in the DB, so it's not a connection Johannes problem.)

Re: [Haskell-cafe] Stack ADT?

2010-02-04 Thread Casey Hawthorne
On Thu, 4 Feb 2010 09:07:28 -0800 (PST), you wrote: Can't find a Stack datatype on Hoogle? Where should I look? Michael From Algorithms: a functional programming approach Second edition Fethi Rabhi Guy Lapalme To be more complete. module Stack(Stack,push,pop,top,emptyStack,stackEmpty)

Re: [Haskell-cafe] Translation of Haskell type classes

2010-02-04 Thread Daniel Fischer
Am Donnerstag 04 Februar 2010 16:32:24 schrieb Enrique Martín: Hello all, few days ago I made some experiments with Haskell type classes. I wrote a small Haskell program for searching in sorted lists, defining my own type classes for equality (MyEq) and order (MyOrd) so that they only have

[Haskell-cafe] Re: Translation of Haskell type classes

2010-02-04 Thread Christian Maeder
try: type DictMyEq a = a - a - Bool -- From the definition of type class MyOrd type DictOrd a = (DictMyEq a, a - a - Bool) data Nat = Z | S Nat -- From the instance MyEq Nat eqNat :: Nat - Nat - Bool eqNat Z Z = True eqNat Z (S x) = False eqNat (S x) Z = False eqNat (S x) (S y)

[Haskell-cafe] ANN: progression-0.1

2010-02-04 Thread Neil Brown
Hi all, I've just uploaded the first release of Progression to Hackage. Progression is a small library that pulls together several other libraries and utilities (particularly Criterion) to support the optimisation of Haskell programs. To use it, you wrap up your benchmarks in a program

Re: [Haskell-cafe] Sparks created, but not used (par/pseq, ST monad)

2010-02-04 Thread Daniel Fischer
Am Donnerstag 04 Februar 2010 17:50:57 schrieb Michael Lesniak: Hello haskell-cafe, I currently have a problem with running par/pseq in the ST monad. The function testST is the minimal counterexample that works -- or, to be more clear, does not work as expected for me. As a remark, the

Re: [Haskell-cafe] Re: programmatic DB interface?

2010-02-04 Thread Michael Snoyman
On Thu, Feb 4, 2010 at 7:38 PM, Colin Paul Adams co...@colina.demon.co.ukwrote: Johannes == Johannes Waldmann waldm...@imn.htwk-leipzig.de writes: Johannes anyone know what's happening here? I get this when Johannes executing a query via haskelldb-hdbc-postgresql-0.12 (The

[Haskell-cafe] sendfile leaking descriptors on Linux?

2010-02-04 Thread Bardur Arantsson
Hi all, I've been using the sendfile package off Hackage, but it seems to be leaking file descriptors when using the Linux-native build. What's happening in my specific case is the following: 1) client requests a range of a file 2) server starts sending the range 3) client

[Haskell-cafe] Re: GUI programming

2010-02-04 Thread Maurí­cio CA
The problem is that the GUI code has become very ugly and I'm tempted to rewrite it totally. I've been looking forward to the FRP stuff, but I've never seen a single definition of the term. Conal Eliot's denotational programming is too general to be definition. I want to try Grapefruit, but

Re: [Haskell-cafe] setNonBlockingFD?

2010-02-04 Thread Taru Karttunen
Excerpts from Magnus Therning's message of Wed Feb 03 21:51:34 +0200 2010: Thanks. That pointed me in the right direction. I've posted the attached patch as a suggested fix to the developer. Hopefully there'll be a compilable version on Hackage soon. There is now 0.1.5 on Hackage with GHC

Re: [Haskell-cafe] safe lazy IO or Iteratee?

2010-02-04 Thread John Millikin
Both have advantages and disadvantages. The primary advantage of lazy IO over iteratees is that it's much, *much* easier to understand -- existing experience with monads can be used immediately. The downsides of lazy IO, of course, are well documented[1][2][3]. Some are fixed by the safe/strict

Re: [Haskell-cafe] safe lazy IO or Iteratee?

2010-02-04 Thread David Leimbach
Thanks for the detailed response below... I must be able to understand how the resources will be used in my system for mission-critical, long-running applications. Dave On Thu, Feb 4, 2010 at 12:51 PM, John Millikin jmilli...@gmail.com wrote: Both have advantages and disadvantages. The

Re[2]: [Haskell-cafe] safe lazy IO or Iteratee?

2010-02-04 Thread Bulat Ziganshin
Hello John, Thursday, February 4, 2010, 11:51:59 PM, you wrote: tl;dr: Lots of smart people, with a history of being right about this sort of thing, say iteratees are better. Evidence suggests iteratee-based IO is faster and more predictable than lazy IO. Iteratees are really hard to

Re: [Haskell-cafe] Anyone up for Google SoC 2010?

2010-02-04 Thread Gwern Branwen
On Wed, Feb 3, 2010 at 8:14 PM, Henk-Jan van Tuyl hjgt...@chello.nl wrote: On Wed, 03 Feb 2010 23:34:34 +0100, Neil Mitchell ndmitch...@gmail.com wrote: Hi Gwern, Please update: haskell-src-exts - haskell-src **Unknown** This project was an unqualified success.  haskell-src-exts is now one

Re: [Haskell-cafe] Stack ADT?

2010-02-04 Thread Daniel Peebles
data Stack a = EmptyStk | Stk a (Stack a) I find it amusing that the book defined a type that is exactly isomorphic to the standard list (EmptyStk === [] and Stk === (:)). I guess it's just for clarity? On Thu, Feb 4, 2010 at 12:29 PM, Casey Hawthorne cas...@istar.ca wrote: On Thu, 4 Feb

Re: Re[2]: [Haskell-cafe] safe lazy IO or Iteratee?

2010-02-04 Thread David Leimbach
On Thu, Feb 4, 2010 at 1:26 PM, Bulat Ziganshin bulat.zigans...@gmail.comwrote: Hello John, Thursday, February 4, 2010, 11:51:59 PM, you wrote: tl;dr: Lots of smart people, with a history of being right about this sort of thing, say iteratees are better. Evidence suggests iteratee-based

Re: [Haskell-cafe] Stack ADT?

2010-02-04 Thread Daniel Fischer
Am Donnerstag 04 Februar 2010 23:18:34 schrieb Daniel Peebles: data Stack a   = EmptyStk | Stk a (Stack a) I find it amusing that the book defined a type that is exactly isomorphic to the standard list (EmptyStk === [] and Stk === (:)). I guess it's just for clarity? Also type safety, I

Re: [Haskell-cafe] Stack ADT?

2010-02-04 Thread Sebastian Fischer
On Feb 4, 2010, at 6:27 PM, michael rice wrote: I haven't done much with modules so I'm guessing what you've provided is the guts of StackImpl, to hide the implementation? Right. In order to make the Stack type abstract, you can hide the Stack data (that is, newtype) constructor and only

[Haskell-cafe] Re: Anyone up for Google SoC 2010?

2010-02-04 Thread Eric Y. Kow
On 31 Jan 2010, Malcolm Wallace pointed out: Google has announced that the Summer of Code programme will be running again this year. If haskell.org people would like to take part again this year, then we need volunteers: The Darcs Team would certainly be delighted to participate in GSoC

[Haskell-cafe] Re: Anyone up for Google SoC 2010?

2010-02-04 Thread Petr Rockai
Hello! [snip] We're particularly interested in three things: (i) making Darcs faster (ii) building nice GUI tools and (iii) working seamlessly with SVN/Git repositories [snip] Both of these roles are called mentor in the Google system. Putting together a good team of mentors before

Re: [Haskell-cafe] safe lazy IO or Iteratee?

2010-02-04 Thread John Lato
Hello, From: David Leimbach leim...@gmail.com Hi everyone, Yet at the same time, I'm quite enamored with the beauty of interact and functions of that sort.  I realize mixing the effects of the lazy IO and pure code may not be the clearest way to write code for everyone, but there is

Re: [Haskell-cafe] Stack ADT?

2010-02-04 Thread Richard O'Keefe
On Feb 5, 2010, at 6:38 AM, Casey Hawthorne wrote: On Thu, 4 Feb 2010 09:07:28 -0800 (PST), you wrote: Can't find a Stack datatype on Hoogle? Where should I look? Michael module Stack(Stack,push,pop,top,emptyStack,stackEmpty) where ... Or just use a list. A more Haskellish approach to

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

2010-02-04 Thread Thomas Hartman
Do you have a test script to reproduce the behavior? I am interested in this patch-tag uses sendfile (via happstack) to serve static data, and I'd like to know if I'm affected by this. 2010/2/4 Bardur Arantsson s...@scientician.net: Hi all, I've been using the sendfile package off Hackage,

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

2010-02-04 Thread Jeremy Shaw
Well, that's not good. I wonder how we are supposed to know that the client has disconnected... We use withBinaryFile to open the file, so if an uncaught except is being thrown then that should close the file handle.. If you look in Network.Socket.SendFile.Linux, you will see that when the C

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

2010-02-04 Thread Jeremy Shaw
Actually, We should start by testing if native sendfile leaks file descriptors even when the whole file is sent. We have a test suite, but I am not sure if it tests for file handle leaking... - jeremy On Thu, Feb 4, 2010 at 7:58 PM, Jeremy Shaw jer...@n-heptane.com wrote: Well, that's not

Re: [Haskell-cafe] Re: programmatic DB interface?

2010-02-04 Thread Johannes Waldmann
Johannes Data.Time.LocalTime.LocalTime.LocalTime: Cannot parse Johannes using default format string %Y-%m-%dT%T%Q this actually comes from the default format string that is defined in old-locale:System.Locale? iso8601DateFormat :: Maybe String - String iso8601DateFormat mTimeFmt

Re: [Haskell-cafe] Re: programmatic DB interface?

2010-02-04 Thread Magnus Therning
On 05/02/10 07:04, Johannes Waldmann wrote: Johannes Data.Time.LocalTime.LocalTime.LocalTime: Cannot parse Johannes using default format string %Y-%m-%dT%T%Q this actually comes from the default format string that is defined in old-locale:System.Locale? iso8601DateFormat