Re: Re[2]: [Haskell-cafe] heap lifetime question

2008-08-06 Thread Galchin, Vasili
that is what I thought .. especially after just looking at the implementation for alloca/allocaBytes. For me and others on thie group is there documentation on the ghc run-time model and also the run-time library architecture. Both would help/aid in reading the code and of course educate more peopl

Re[2]: [Haskell-cafe] heap lifetime question

2008-08-06 Thread Henning Thielemann
On Thu, 7 Aug 2008, Bulat Ziganshin wrote: > Hello Vasili, > > Thursday, August 7, 2008, 9:33:32 AM, you wrote: > > oh, it was my mistake. alloca behavior is completely defined by it's > generic implementation: > > allocaBytes :: Int -> (Ptr a -> IO b) -> IO b > allocaBytes size = bracket (

Re: Re[2]: [Haskell-cafe] heap lifetime question

2008-08-06 Thread Galchin, Vasili
ok .. I will take a stab at it ... /ghc-6.8.2/libraries/base/Foreign/Marshal I am not so familiar with the ghc run-time model ... V. On Thu, Aug 7, 2008 at 1:26 AM, Galchin, Vasili <[EMAIL PROTECTED]> wrote: > In which directory are they? > > Vasili > > > On Thu, Aug 7, 2008 at 12:58 AM, Bu

[Haskell-cafe] Last Call for the Italian Haskellers Summer Meeting

2008-08-06 Thread Titto Assini
As usual we will now switch to Dante's "bella lingua". Ottimissimi, mancano pochi giorni al primo incontro estivo/balneare degli haskeller italiani. Per informazioni e registrarsi date uno sguardo a: http://www.haskell.org/haskellwiki/ItaloHaskell/Summer_2008 Oppure contattate il sottoscritto

Re: Re[2]: [Haskell-cafe] heap lifetime question

2008-08-06 Thread Galchin, Vasili
In which directory are they? Vasili On Thu, Aug 7, 2008 at 12:58 AM, Bulat Ziganshin <[EMAIL PROTECTED]>wrote: > Hello Vasili, > > Thursday, August 7, 2008, 9:33:32 AM, you wrote: > > oh, it was my mistake. alloca behavior is completely defined by it's > generic implementation: > > allocaBytes

Re: [Haskell-cafe] adjunction of product and exponentiation

2008-08-06 Thread Jonathan Cast
On Wed, 2008-08-06 at 22:50 -0700, Jason Dusek wrote: > Jonathan Cast <[EMAIL PROTECTED]> wrote: > > Jason Dusek wrote: > > > It is an arrow that takes a C to an arrow that takes an A > > > and makes the product C x A. I want to write curry(C x A) > > > but that is ridiculous looking. What's the ri

Re[2]: [Haskell-cafe] heap lifetime question

2008-08-06 Thread Bulat Ziganshin
Hello Vasili, Thursday, August 7, 2008, 9:33:32 AM, you wrote: oh, it was my mistake. alloca behavior is completely defined by it's generic implementation: allocaBytes :: Int -> (Ptr a -> IO b) -> IO b allocaBytes size = bracket (mallocBytes size) free although GHC implementation is much

Re: [Haskell-cafe] adjunction of product and exponentiation

2008-08-06 Thread Jason Dusek
Jonathan Cast <[EMAIL PROTECTED]> wrote: > Jason Dusek wrote: > > It is an arrow that takes a C to an arrow that takes an A > > and makes the product C x A. I want to write curry(C x A) > > but that is ridiculous looking. What's the right notation > > for this thing? > > It's a curried pairing oper

Re: [Haskell-cafe] heap lifetime question

2008-08-06 Thread Galchin, Vasili
If I am correct, I cannot associate a ForeignPtr with alloca or allocaBytes object via "newForeignPtr" because the alloca/allocaBytes heap object will be GC'd when I leave the function that allocated this object/. I.e. if I have a heap object that I want to live beyond a function invocation, I must

Re: [Haskell-cafe] heap lifetime question

2008-08-06 Thread Galchin, Vasili
so Bulat .. You seem to be saying what I suspect ... i.e. if an allocaBytes call is inside a function, when the function is exited then the said heap object is GC'd?? Regards, Vasili On Thu, Aug 7, 2008 at 12:25 AM, Bulat Ziganshin <[EMAIL PROTECTED]>wrote: > Hello Vasili, > > Thursday, A

Re: [Haskell-cafe] heap lifetime question

2008-08-06 Thread Bulat Ziganshin
Hello Vasili, Thursday, August 7, 2008, 9:13:43 AM, you wrote: >     What is the lifetime of various heap objects ... e.g. created by > allocaBytes, alloca, etc? alloca/allocaBytes just mimicks stack allocation but actually allocates buffer in usual heap. this buffer lives while references to i

[Haskell-cafe] heap lifetime question

2008-08-06 Thread Galchin, Vasili
Hello, What is the lifetime of various heap objects ... e.g. created by allocaBytes, alloca, etc? Regards, Vasili ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] DEFUN 2008 (Developer Tracks on Functional Programming): Call for participation

2008-08-06 Thread Matthew Fluet (ICFP Publicity Chair)
ACM SIGPLAN 2008 Developer Tracks on Functional Programming http://www.deinprogramm.de/defun-2008/ Victoria, BC, Canada, 25, 27 September, 2008 Held in conjunction with ICFP 2008: http://www.icfpconference.org/icfp2008/ DEFUN 2008 i

Re: [Haskell-cafe] USB and serial port

2008-08-06 Thread Henk-Jan van Tuyl
On Wed, 06 Aug 2008 23:11:50 +0200, Maurí­cio <[EMAIL PROTECTED]> wrote: Hi, What are the alternatives to read a USB port (actually, a COM serial port with an USB adapter) in Haskell, running in Linux? Have a look at: http://www8.garmin.com/support/commProtocol.html Maybe you can find s

Re: [Haskell-cafe] adjunction of product and exponentiation

2008-08-06 Thread Jonathan Cast
On Wed, 2008-08-06 at 13:56 -0700, Jason Dusek wrote: > The problem as stated is to find the unit for the adjunction: > > ((- x A), (-)^A x A) > > The latter functor takes an arrow f to (f . -) x id_A and does > the obvious thing for objects. The co-unit diagram is given > as: > >

Re: [Haskell-cafe] USB and serial port

2008-08-06 Thread Magnus Therning
Maurí­cio wrote: > Hi, > > What are the alternatives to read > a USB port (actually, a COM serial > port with an USB adapter) in > Haskell, running in Linux? Guessing wildly here... Either as a regular file, or a wrapper around some ioctl calls? /M -- Magnus Therning

[Haskell-cafe] USB and serial port

2008-08-06 Thread Maurí­cio
Hi, What are the alternatives to read a USB port (actually, a COM serial port with an USB adapter) in Haskell, running in Linux? Thanks, Maurício ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-ca

[Haskell-cafe] adjunction of product and exponentiation

2008-08-06 Thread Jason Dusek
The problem as stated is to find the unit for the adjunction: ((- x A), (-)^A x A) The latter functor takes an arrow f to (f . -) x id_A and does the obvious thing for objects. The co-unit diagram is given as: B^A x A eval_AB > B ^

Re: [Haskell-cafe] helping you contribute to darcs (poll results so far)

2008-08-06 Thread Jeremy Shaw
At Wed, 6 Aug 2008 19:59:11 +0100, Ian Lynagh wrote: > > On Wed, Aug 06, 2008 at 11:28:58AM -0700, Jeremy Shaw wrote: > > At Wed, 6 Aug 2008 10:48:03 +0100, > > Ian Lynagh wrote: > > > > > I've just had a quick read of > > > http://citeseer.ist.psu.edu/prakash92undoing.html > > > AFAICS this

Re: [Haskell-cafe] Looking for a more functional way to do this

2008-08-06 Thread Brian Hulley
Jefferson Heard wrote: Adrian, my understanding is that it's not that simple, because I need to preserve the state between calls to GLUT's callbacks, which all return IO (). 2008/8/6 Adrian Neumann <[EMAIL PROTECTED]>: There is the State Monad... >>> data ProgramState = ProgramState { so

Re: [Haskell-cafe] helping you contribute to darcs (poll results so far)

2008-08-06 Thread Ian Lynagh
On Wed, Aug 06, 2008 at 11:28:58AM -0700, Jeremy Shaw wrote: > At Wed, 6 Aug 2008 10:48:03 +0100, > Ian Lynagh wrote: > > > I've just had a quick read of > > http://citeseer.ist.psu.edu/prakash92undoing.html > > AFAICS this only really deals with the case where there are no > > conflicts, and

Re: [Haskell-cafe] Looking for a more functional way to do this

2008-08-06 Thread Claude Heiland-Allen
Jefferson Heard wrote: Adrian, my understanding is that it's not that simple, because I need to preserve the state between calls to GLUT's callbacks, which all return IO (). Then maybe see: http://www.haskell.org/pipermail/haskell-cafe/2007-July/028501.html 2008/8/6 Adrian Neumann <[EMAIL PR

Re: [Haskell-cafe] Looking for a more functional way to do this

2008-08-06 Thread Jefferson Heard
Adrian, my understanding is that it's not that simple, because I need to preserve the state between calls to GLUT's callbacks, which all return IO (). 2008/8/6 Adrian Neumann <[EMAIL PROTECTED]>: > There is the State Monad which is build just for that kind of purpose, I > believe: > > http://www.h

Re: [Haskell-cafe] helping you contribute to darcs (poll results so far)

2008-08-06 Thread Jeremy Shaw
At Wed, 6 Aug 2008 10:48:03 +0100, Ian Lynagh wrote: > I've just had a quick read of > http://citeseer.ist.psu.edu/prakash92undoing.html > AFAICS this only really deals with the case where there are no > conflicts, and doesn't talk about merging. AFAIK, the papers do not talking about merging

Re: [Haskell-cafe] Show me

2008-08-06 Thread Ryan Ingram
You may find this helper function useful: > showAp :: Show a => Int -> String -> a -> ShowS > showAp n f x = showParen (n > ap_prec) inside > where > inside = showString f . showString " " . showsPrec (app_prec+1) x > ap_prec = 10 -- "precedence" of function application; higher than a

Re: [Haskell-cafe] Looking for a more functional way to do this

2008-08-06 Thread Adrian Neumann
There is the State Monad which is build just for that kind of purpose, I believe: http://www.haskell.org/all_about_monads/html/statemonad.html That would safe you from passing around the State Jefferson Heard schrieb: Working with HOpenGL and GLUT, I find myself approaching a common problem w

Re: [Haskell-cafe] the Haskell "with" "pattern"?

2008-08-06 Thread Jonathan Cast
On Wed, 2008-08-06 at 18:21 +0200, Johan Tibell wrote: > On Wed, Aug 6, 2008 at 5:44 PM, Jules Bean <[EMAIL PROTECTED]> wrote: > > Johan Tibell wrote: > >> You probably knew this already but there's nothing in the "with idiom" > >> that prevents the resource to escape. > > > > And, it doesn't alway

Re: [Haskell-cafe] the Haskell "with" "pattern"?

2008-08-06 Thread Johan Tibell
On Wed, Aug 6, 2008 at 5:44 PM, Jules Bean <[EMAIL PROTECTED]> wrote: > Johan Tibell wrote: >> You probably knew this already but there's nothing in the "with idiom" >> that prevents the resource to escape. > > And, it doesn't always matter. Some withs are more unsafe that others :) > > if the 'wit

Re: [Haskell-cafe] the Haskell "with" "pattern"?

2008-08-06 Thread Jules Bean
Johan Tibell wrote: 2008/8/6 Galchin, Vasili <[EMAIL PROTECTED]>: Hello, 1) Is there a common assumed semantics across all of the Haskell "with" things? withString? withData? You probably knew this already but there's nothing in the "with idiom" that prevents the resource to escape. And

[Haskell-cafe] Haskell Weekly News: Issue 80 - August 6, 2008

2008-08-06 Thread Brent Yorgey
--- Haskell Weekly News http://sequence.complete.org/hwn/20080806 Issue 80 - August 6, 2008 --- Welcome to issue 80 of HWN, a newsletter covering

Re: [Haskell-cafe] Re: poll: how can we help you contribute to darcs?

2008-08-06 Thread Brandon S. Allbery KF8NH
On 2008 Aug 6, at 2:02, Ketil Malde wrote: Ben Franksen <[EMAIL PROTECTED]> writes: Can I convert my working repos to darcs-2? No. You cannot push or pull between darcs-2 format repos and darcs-1 or hashed format repos. This might not be optimal but is understandable, since the theory

[Haskell-cafe] Re: GHC Feature or Bug: f x = (`head` x, ())

2008-08-06 Thread Christian Maeder
Jeremy Shaw wrote: Hello, GHC is happy to compile this code: f x = (`head` x, ()) Also (+ x, ()) ((), + x) ((), + x, ()) are accepted by GHC This looks like a bug to me, because (+, ()) ((), x +) are rejected. Sections need to be in parens. If one allows sections as tuple compon

Re: [Haskell-cafe] Re: [haskell-art] Haskore Tutorial

2008-08-06 Thread Tillmann Rendel
Vikrant wrote: I get this error. I think have zlib installed! what package should I install to compile cabal on my machine (ubuntu - 8.04) Configuring cabal-install-0.5.2... Setup: At least the following dependencies are missing: zlib >=0.4 That's the Haskell package zlib, you can get it

[Haskell-cafe] Re: [haskell-art] Haskore Tutorial

2008-08-06 Thread Vikrant
Hi, I get this error. I think have zlib installed! what package should I install to compile cabal on my machine (ubuntu - 8.04) Configuring cabal-install-0.5.2... Setup: At least the following dependencies are missing: zlib >=0.4 status of zlib on my machine is as following bahs$ aptitude se

Re: [Haskell-cafe] the Haskell "with" "pattern"?

2008-08-06 Thread Luke Palmer
2008/8/6 Galchin, Vasili <[EMAIL PROTECTED]> > Hi Jeremy and the haskell community, > > I think now my question is why isn't there a higher-order "with" > function in the Haskell Prelude? > There is. Well, not in the prelude, but in the base package at least. It's called "bracket". But I t

Re: [Haskell-cafe] Haskell garbage collector notes?

2008-08-06 Thread Austin Seipp
Excerpts from Galchin, Vasili's message of Wed Aug 06 04:09:58 -0500 2008: > Is http://hackage.haskell.org/trac/ghc/wiki/GarbageCollectorNotes a > reliable source of info on the ghc garbage collector? The page seems to be a little light for the most part, and it does not seem to take into acc

RE: [Haskell-cafe] Haskell garbage collector notes?

2008-08-06 Thread Bayley, Alistair
> From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Galchin, Vasili > > Is > http://hackage.haskell.org/trac/ghc/wiki/GarbageCollectorNotes > a reliable source of info on the ghc garbage collector? Depends which version of GHC... the next release (6.10) will include the ne

Re: [Haskell-cafe] helping you contribute to darcs (poll results so far)

2008-08-06 Thread Ian Lynagh
On Wed, Aug 06, 2008 at 12:20:17AM -0700, Jeremy Shaw wrote: > > Are the darcs developers familiar with these papers (available on citeseer): > > Undo Actions in Collaborative Work, Prakash & Knister 1992 > Undoing Actions in Collaborative Work: Framework and Experience, Prakash & > Knister 19

[Haskell-cafe] Haskell garbage collector notes?

2008-08-06 Thread Galchin, Vasili
hello, Is http://hackage.haskell.org/trac/ghc/wiki/GarbageCollectorNotes a reliable source of info on the ghc garbage collector? thx, vasili ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] the Haskell "with" "pattern"?

2008-08-06 Thread Johan Tibell
2008/8/6 Galchin, Vasili <[EMAIL PROTECTED]>: > Hello, > > 1) Is there a common assumed semantics across all of the Haskell "with" > things? withString? withData? You probably knew this already but there's nothing in the "with idiom" that prevents the resource to escape. Oleg recently wrote ab

Re: [Haskell-cafe] the Haskell "with" "pattern"?

2008-08-06 Thread Galchin, Vasili
Hi Jeremy and the haskell community, I think now my question is why isn't there a higher-order "with" function in the Haskell Prelude? Regards, Vasili On Wed, Aug 6, 2008 at 2:25 AM, Jeremy Shaw <[EMAIL PROTECTED]> wrote: > At Wed, 6 Aug 2008 00:43:55 -0500, > Galchin, Vasili wrote: > > > >

Re: [Haskell-cafe] the Haskell "with" "pattern"?

2008-08-06 Thread Galchin, Vasili
hmmm .. Jeremy http://notes-on-haskell.blogspot.com/2007/03/design-patterns-in-haskell-bracket.html thx, vasili On Wed, Aug 6, 2008 at 2:25 AM, Jeremy Shaw <[EMAIL PROTECTED]> wrote: > At Wed, 6 Aug 2008 00:43:55 -0500, > Galchin, Vasili wrote: > > > > [1 ] > > [1.1 ] > > Hello, > >

Re: [Haskell-cafe] the Haskell "with" "pattern"?

2008-08-06 Thread Jeremy Shaw
At Wed, 6 Aug 2008 00:43:55 -0500, Galchin, Vasili wrote: > > [1 ] > [1.1 ] > Hello, > > 1) Is there a common assumed semantics across all of the Haskell "with" > things? withString? withData? A vague semantic is that some resource is acquired, used, and then released. > 2) If the ans

Re: [Haskell-cafe] helping you contribute to darcs (poll results so far)

2008-08-06 Thread Jeremy Shaw
At Wed, 6 Aug 2008 06:29:32 +0100, Eric Y. Kow wrote: > > Dear Haskellers, > > patch theory is still not defined clearly or rigorously enough for Haskellers Are the darcs developers familiar with these papers (available on citeseer): Undo Actions in Collaborative Work, Prakash & Knister 1992