Re: [Haskell-cafe] Can't figure out source of race condition when using System.Process

2008-11-02 Thread David Roundy
_ -> return () > > [...] > > Why do you use forkIO here? It's not necessary. The process will run in > background on its own. ? It looks to me like this code requires a forkIO, not in the writing to inp, but rather in the read

Re: [Haskell-cafe] Re: [darcs-users] Poll: Do you need to be able to build darcs from source on GHC 6.6?

2008-10-31 Thread David Roundy
On Thu, Oct 30, 2008 at 03:08:29PM -0700, Don Stewart wrote: > dagit: > > On Thu, Oct 30, 2008 at 1:20 PM, Juliusz Chroboczek > > <[EMAIL PROTECTED]> wrote: > > >> I wanted to know if anyone who is using distros with 6.6 need to be > > >> able to build current releases of darcs from source. > > > >

[Haskell-cafe] Re: [darcs-users] Poll: Do you need to be able to build darcs from source on GHC 6.6?

2008-10-31 Thread David Roundy
On Thu, Oct 30, 2008 at 01:30:51PM -0700, Jason Dagit wrote: > On Thu, Oct 30, 2008 at 1:22 PM, Juliusz Chroboczek > <[EMAIL PROTECTED]> wrote: > >> Also, note that Lenny has 6.8, and it is scheduled to become stable Real > >> Soon Now. > > > > That's irrelevant. Lenny going stable will not cause

Re: [darcs-users] [Haskell-cafe] Poll: Do you need to be able to build darcs from source on GHC 6.6?

2008-10-30 Thread David Roundy
On Thu, Oct 30, 2008 at 12:16:17PM +1100, Trent W. Buck wrote: > David Roundy <[EMAIL PROTECTED]> writes: > > And as far as bundled versions, it's the desire to *remove* a bundled > > version that's apparently at issue. I'm not sure why this is > > consi

Re: [Haskell-cafe] Poll: Do you need to be able to build darcs from source on GHC 6.6?

2008-10-29 Thread David Roundy
On Wed, Oct 29, 2008 at 11:17:35AM -, Mitchell, Neil wrote: > Duncan, > > I believe the major darcs issue is the changed GADT implementation > between 6.6, so that neither 6.6 or 6.8 is a superset/subset of the > other - leading to a situation where they have to use a common subset of > both.

[Haskell-cafe] Re: [darcs-users] Poll: Do you need to be able to build darcs from source on GHC 6.6?

2008-10-28 Thread David Roundy
stable distros worry about telling us if it > breaks against whatever versions they care about. No, in the idea world we'd try to be supportive of our contributors and maintainers by not requiring that they install the latest tools. -- Davi

Re: [Haskell-cafe] [Somewhat OT] Speed

2008-10-28 Thread David Roundy
On Tue, Oct 28, 2008 at 08:55:59PM +0100, Henning Thielemann wrote: >> For example, is integer arithmetic faster or slower than >> floating-point? > > In principle integer arithmetic is simpler and faster. But your > processor may do it in the same time. Indeed. Usually there are more integer ari

Re: [Haskell-cafe] Re: Why 'round' does not just round numbers ?

2008-10-28 Thread David Roundy
On Tue, Oct 28, 2008 at 04:07:12PM +, Bart Massey wrote: > I'm just saying that the name "round" is unfortunate, since > there's no single universally accepted mathematical > definition for it. For this reason many programming > languages either don't provide it or provide a different > version

[Haskell-cafe] Re: [darcs-users] Poll: Do you need to be able to build darcs from source on GHC 6.6?

2008-10-28 Thread David Roundy
Yes, it's important for me to be able to use the latest darcs on my debian stable computers. David On Mon, Oct 27, 2008 at 10:24 PM, Jason Dagit <[EMAIL PROTECTED]> wrote: > Hello, > > I would like to find out if any darcs users who build from the source > are still using ghc 6.6? > > If you are

Re: [Haskell-cafe] Re: Repair to floating point enumerations?

2008-10-16 Thread David Roundy
On Thu, Oct 16, 2008 at 05:36:35PM +0200, Henning Thielemann wrote: > On Wed, 15 Oct 2008, David Roundy wrote: >> On Wed, Oct 15, 2008 at 11:25:57PM +0200, Henning Thielemann wrote: >>> David Roundy schrieb: >>> >>>> Why not look for a heuristic that gets t

Re: [Haskell-cafe] Re: Repair to floating point enumerations?

2008-10-15 Thread David Roundy
On Wed, Oct 15, 2008 at 11:25:57PM +0200, Henning Thielemann wrote: > David Roundy schrieb: > > > Why not look for a heuristic that gets the common cases right, rather > > than going with an elegant wrong solution? After all, these > > enumerations are most often used by

Re: [Haskell-cafe] Linking and unsafePerformIO

2008-10-14 Thread David Roundy
On Tue, Oct 14, 2008 at 05:20:35PM +0100, Jules Bean wrote: > David Roundy wrote: >> On Tue, Oct 14, 2008 at 04:05:23PM +0100, Jules Bean wrote: >>> Constants are mathematical and universal, like pi. That is what the >>> semantics of haskell say. >> >> Whe

Re: [Haskell-cafe] Linking and unsafePerformIO

2008-10-14 Thread David Roundy
On Tue, Oct 14, 2008 at 04:39:38PM +0100, Claus Reinke wrote: >> Where do the semantics of haskell say this? How does it interact with >> fixing bugs (which means changing mathematical and universal constant >> functions--since all functions are constants)? > > What semantics of haskell?-) But if t

Re: [Haskell-cafe] Linking and unsafePerformIO

2008-10-14 Thread David Roundy
On Tue, Oct 14, 2008 at 04:05:23PM +0100, Jules Bean wrote: > David Roundy wrote: >>>> (Sure this is a weird situation, but I do like to think about worst >>>> cases.) >>> In practice that is fine, with current RTSes and so on. >>> >>> In pr

Re: [Haskell-cafe] Linking and unsafePerformIO

2008-10-14 Thread David Roundy
On Tue, Oct 14, 2008 at 02:05:02PM +0100, Jules Bean wrote: > Mauricio wrote: > >If I have a Haskell wrapper (with unsafe...) over a function that's > >never going to return different values and is always side-effect free, > >but can change depending on compile time options of its library; my > >p

Re: [Haskell-cafe] System.Process

2008-09-30 Thread David Roundy
On Tue, Sep 30, 2008 at 06:33:52PM +0200, Ketil Malde wrote: > David Roundy <[EMAIL PROTECTED]> writes: > > Actually, it's no problem having any of those characters in your > > arguments, > > My point is that using 'words' on the argument sting to '

Re: [Haskell-cafe] System.Process

2008-09-30 Thread David Roundy
On Tue, Sep 30, 2008 at 10:14:38AM +0200, Ketil Malde wrote: > "Svein Ove Aas" <[EMAIL PROTECTED]> writes: > > All programs want argument arrays, not un-split lines, and if you > > don't have the shell split it you'll have to do it yourself. words > > works fine. > > ...as long as the words don't

[Haskell-cafe] Re: [Haskell] ICFP programming contest results

2008-09-24 Thread David Roundy
On Wed, Sep 24, 2008 at 1:06 AM, Malcolm Wallace <[EMAIL PROTECTED]> wrote: > The ICFP programming contest results presentation: > http://video.google.com/videoplay?docid=-4697764813432201693 > > Feel free to pass on this link to any other appropriate forum. Yikes. Haskell did pretty terribly! An

Re: [Haskell-cafe] readFile and closing a file

2008-09-18 Thread David Roundy
On Thu, Sep 18, 2008 at 05:38:51PM +0200, Henning Thielemann wrote: > On Wed, 17 Sep 2008, Mitchell, Neil wrote: >> I tend to use openFile, hGetContents, hClose - your initial readFile >> like call should be openFile/hGetContents, which gives you a lazy >> stream, and on a parse error call hClose.

Re: [Haskell-cafe] about openTempFile

2008-09-17 Thread David Roundy
On Wed, Sep 17, 2008 at 10:11:28PM +0200, Manlio Perillo wrote: > David Roundy ha scritto: >> [...] >> In particular, the code Don quoted is incorrect depending on which >> import statements are used. If we assume that the default is the >> bracket available in Haskel

Re: [Haskell-cafe] about openTempFile

2008-09-17 Thread David Roundy
On Wed, Sep 17, 2008 at 04:51:07PM +0100, Mitchell, Neil wrote: > > > But since GHC does not implement such a function, I was curious to > > > know why it don't even implement a function that make sure the > > > temporary file is removed. > > > > > > > Because it is two lines to write, so no on

Re: [Haskell-cafe] about openTempFile

2008-09-17 Thread David Roundy
On Wed, Sep 17, 2008 at 02:10:56PM +0100, Dougal Stanton wrote: > On Wed, Sep 17, 2008 at 1:17 PM, Manlio Perillo > <[EMAIL PROTECTED]> wrote: > > The Python tempfile module, as an example, implements a wrapper around > > mkstemp function that does exactly this, and the code is portable; on > > Win

Re: [Haskell-cafe] readFile and closing a file

2008-09-17 Thread David Roundy
On Wed, Sep 17, 2008 at 01:31:26PM +0200, Henning Thielemann wrote: > Say I acquire a text by readFile, feed it to a lazy parser and the parser > stops reading because of a parse error. After the parser error I won't > fetch more characters from the text file, but readFile does not get to > kn

Re: [Haskell-cafe] Can you do everything without shared-memory concurrency?

2008-09-10 Thread David Roundy
On Wed, Sep 10, 2008 at 03:30:50PM +0200, Jed Brown wrote: > On Wed 2008-09-10 09:05, David Roundy wrote: > > 2008/9/9 Jed Brown <[EMAIL PROTECTED]>: > > > On Tue 2008-09-09 12:30, Bruce Eckel wrote: > > >> So this is the kind of problem I keep running into. Th

Re: [Haskell-cafe] Can you do everything without shared-memory concurrency?

2008-09-10 Thread David Roundy
2008/9/9 Jed Brown <[EMAIL PROTECTED]>: > On Tue 2008-09-09 12:30, Bruce Eckel wrote: >> So this is the kind of problem I keep running into. There will seem to be >> consensus that you can do everything with isolated processes message passing >> (and note here that I include Actors in this scenario

Re: [Haskell-cafe] Consequences of implementing a library in Haskell for C consumption?

2008-09-05 Thread David Roundy
On Thu, Sep 04, 2008 at 08:04:25PM -0500, Austin Seipp wrote: > Excerpts from Justin Bailey's message of Thu Sep 04 17:00:58 -0500 2008: > > > Looking at the package, I think would be pretty painful though. It > > seems I'd have to build the AST by hand, > > The AST Language.C defines for C is actu

Re: [Haskell-cafe] Top Level <-

2008-09-02 Thread David Roundy
On Tue, Sep 02, 2008 at 10:10:31AM +0100, Sittampalam, Ganesh wrote: > > > Contrived example follows: > > > > > module Module1 (mod1) where > > > import Module2 > > > > > > glob1 :: IORef Int > > > glob1 <- mod2 >>= newIORef > > > > > mod1 :: IO Int > > > mod1 = readIORef glob1 > > > > > module

Re: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-28 Thread David Roundy
On Thu, Aug 28, 2008 at 01:17:29PM -0400, Dan Doel wrote: > On Thursday 28 August 2008 12:26:27 pm Adrian Hey wrote: > > As I've pointed out several times already you can find simple examples > > in the standard haskell libs. So far nobody has accepted my challenge to > > re-implement any of these

Re: [Haskell-cafe] Cleaning up the Debian act (report from the trenches)

2008-08-27 Thread David Roundy
On Wed, Aug 27, 2008 at 1:58 AM, Jason Dagit <[EMAIL PROTECTED]> wrote: >> 2) Compile GHC yourself. You can even compile and install GHC (and most >> Haskell software) on a dedicated user account. In this way you avoid >> messing up you Debian installation if something goes wrong. > > I find with D

Re: [Haskell-cafe] Haskell Propeganda

2008-08-26 Thread David Roundy
On Sat, Aug 23, 2008 at 6:15 PM, Daniel Fischer <[EMAIL PROTECTED]> wrote: > Am Samstag, 23. August 2008 23:17 schrieb Thomas Davie: >> >> I'd be interested to see your other examples -- because that error is >> not happening in Haskell! You can't argue that Haskell doesn't give >> you no segfault

Re: [Haskell-cafe] X Haskell Bindings

2008-08-18 Thread David Roundy
On 8/16/08, Antoine Latter <[EMAIL PROTECTED]> wrote: > The following is a summary of my plan so far. I'm interested in > hearing any suggestions or concerns about what a Haskell library for > writing X clients should look like. This is not a release > announcement, and I can't make any promi

Re: [Haskell-cafe] Re: A Monad for on-demand file generation?

2008-07-03 Thread David Roundy
On Thu, Jul 03, 2008 at 07:09:58PM +0100, ChrisK wrote: > Joachim Breitner wrote: > > * The 5th line does not have this effect. Because this gets desugared > >to (>>), the special implementation of (>>) means that the next line > >still sees the same dependency state as the before the call to liftI

Re: [Haskell-cafe] A Monad for on-demand file generation?

2008-07-01 Thread David Roundy
On Tue, Jul 01, 2008 at 10:22:35AM +, Joachim Breitner wrote: > Hi, > > Am Dienstag, den 01.07.2008, 11:53 +0200 schrieb Ketil Malde: > > Joachim Breitner <[EMAIL PROTECTED]> writes: > > > > >> 1) unsafeInterleaveIO seems like a big hammer to use for this problem, > > >> and there are a lot o

Re: [Haskell-cafe] history of tuples vs pairs

2008-06-25 Thread David Roundy
o corresponding three-element list. However, you're > right in noting the similarity between lists and nested tuples -- in > fact, this is exactly how lists are implemented in lisp (which is > where we get the tern 'cons'). The other difference is that nested tuples have t

Re: [Haskell-cafe] Re: "C" buffer suggestions??

2008-06-23 Thread David Roundy
See the Data.ByteString.Internal docs: http://www.haskell.org/ghc/docs/latest/html/libraries/bytestring/Data-ByteString-Internal.html#v%3AtoForeignPtr Of course, you'd better not write to the contents of that pointer, or bad things could happen... David On Mon, Jun 23, 2008 at 08:18:23PM -0500,

Re: [Haskell-cafe] blas bindings, why are they so much slower the C?

2008-06-18 Thread David Roundy
On Wed, Jun 18, 2008 at 06:03:42PM +0100, Jules Bean wrote: > Anatoly Yakovenko wrote: > >>>#include > >>>#include > >>> > >>>int main() { > >>> int size = 1024; > >>> int ii = 0; > >>> double* v1 = malloc(sizeof(double) * (size)); > >>> double* v2 = malloc(sizeof(double) * (size)); > >>> fo

Re: [Haskell-cafe] blas bindings, why are they so much slower the C?

2008-06-18 Thread David Roundy
On Wed, Jun 18, 2008 at 09:16:24AM -0700, Anatoly Yakovenko wrote: > >> #include > >> #include > >> > >> int main() { > >> int size = 1024; > >> int ii = 0; > >> double* v1 = malloc(sizeof(double) * (size)); > >> double* v2 = malloc(sizeof(double) * (size)); > >> for(ii = 0; ii < size*s

Re: 答复 : [Haskell-cafe] How to do this in FP way?

2008-06-17 Thread David Roundy
On Tue, Jun 17, 2008 at 08:56:31AM -0700, Don Stewart wrote: > dons: > > magicloud.magiclouds: > > > OK. Here it is. > > > I want to make a monitor tool for linux. It runs for a long time, and give > > > out a certain process's io stat per second. The way I get io stat is to > > > read > > > from

Re: [Haskell-cafe] Suggestion for implementation of vector library

2008-06-17 Thread David Roundy
On Tue, Jun 17, 2008 at 08:24:58AM -0700, John Meacham wrote: > You can also create helper functions like > > v3 = Vector3 > > so you can do (v3 1 2 3 <+> v3 4 5 6) Or just use data Vector3 = V3 !Float !Float !Float and you've got compact pattern matching as well as constructing. David __

Re: [Haskell-cafe] Design suggestion for Data.Binary.Defer

2008-06-17 Thread David Roundy
On Tue, Jun 17, 2008 at 07:55:51AM +0100, Neil Mitchell wrote: > Hi, Hello! > David: > > Is there any reason not to just write all lazy fields of variable size > > in a deferred manner? > > I completely hadn't though of this! You will loose a bit of time, for > example reading fields which were

Re: [Haskell-cafe] 1/0

2008-06-16 Thread David Roundy
On Mon, Jun 16, 2008 at 05:39:39PM -0700, Don Stewart wrote: > > decodeFloat really ought to be a partial function, and this should > > be a crashing bug, if the standard libraries were better-written. > > It's a bug in the H98 report then: > > Section 6.4.6: > > "The function decodeFloa

Re: [Haskell-cafe] 1/0

2008-06-16 Thread David Roundy
On Mon, Jun 16, 2008 at 05:08:36PM -0700, Don Stewart wrote: > droundy: > > On Mon, Jun 16, 2008 at 04:50:05PM -0700, John Meacham wrote: > > > On Mon, Jun 16, 2008 at 04:41:23PM -0700, Evan Laforge wrote: > > > > But what about that NaN->Integer conversion thing? > > > > > > I think that may be a

Re: [Haskell-cafe] 1/0

2008-06-16 Thread David Roundy
On Mon, Jun 16, 2008 at 04:50:05PM -0700, John Meacham wrote: > On Mon, Jun 16, 2008 at 04:41:23PM -0700, Evan Laforge wrote: > > But what about that NaN->Integer conversion thing? > > I think that may be a bug or at least a misfeature. The standard is > somewhat vauge on a lot of issues dealing w

Re: [Haskell-cafe] 1/0

2008-06-16 Thread David Roundy
On Mon, Jun 16, 2008 at 4:18 PM, David Roundy <[EMAIL PROTECTED]> wrote: > On Mon, Jun 16, 2008 at 4:07 PM, Evan Laforge <[EMAIL PROTECTED]> wrote: >> Every other language throws an exception, even C will crash the >> program, so I'm guessing it's telling the

Re: [Haskell-cafe] 1/0

2008-06-16 Thread David Roundy
On Mon, Jun 16, 2008 at 4:07 PM, Evan Laforge <[EMAIL PROTECTED]> wrote: > So, I know this has been discussed before, but: > >> 1/0 > Infinity >> 0/0 > NaN > > ... so I see from the archives that Infinity is mandated by ieee754 > even though my intuition says both should be NaN. There is a good re

Re: [Haskell-cafe] Design suggestion for Data.Binary.Defer

2008-06-16 Thread David Roundy
On Mon, Jun 16, 2008 at 9:43 AM, Neil Mitchell <[EMAIL PROTECTED]> wrote: > == The Question == > > Is there a simple way of tagging fields in a constructor as deferred, > just once for reading and writing, and ideally outside the instance > definition and not requiring additional code to unwrap? I

Re: [Haskell-cafe] How to do this in FP way?

2008-06-16 Thread David Roundy
2008/6/15 Magicloud Magiclouds <[EMAIL PROTECTED]>: > Hello, > I am getting familiar with FP now, and I have a "program design" kind of > question. > Say I have something like this in C: > static int old; > int diff (int now) { /* this would be called once a second */ > int ret = now - ol

Re: [Haskell-cafe] elem of infinite set of tuple

2008-05-16 Thread David Roundy
On Fri, May 16, 2008 at 07:58:40AM -0400, Dan Doel wrote: > On Friday 16 May 2008, leledumbo wrote: > > I don't know how Haskell should behave on this. Consider this function: > > elemOf (x,y) = (x,y) `elem` [ (a,b) | a <- [0..], b <- [0..] ] > > FYI: The control-monad-omega package on hackage.has

Re: [Haskell-cafe] elem of infinite set of tuple

2008-05-16 Thread David Roundy
inish since the limit of the second element is > infinite. Didn't you just answer your own question? -- David Roundy Department of Physics Oregon State University ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Fun with Darcs

2008-05-14 Thread David Roundy
On Wed, May 14, 2008 at 08:37:53PM +0100, Andrew Coppin wrote: > Andrew Coppin wrote: > >Henning Thielemann wrote: > >> > >>As said, the IDE Leksah can display code exactly like this ... > >> > > > >I noticed the first time. Clearly this is another toy I'm going to > >have to try out sometime... >

Re: [Haskell-cafe] GHC predictability

2008-05-09 Thread David Roundy
olding them in memory. It's beautiful, and it's wonderful, but it's also really easy for someone to add a second consumer of the same object, and send performance through the floor. Of course, one can avoid this particular pattern, but then you lose some of the very nice abstractions

Re: [Haskell-cafe] MonadPlus

2008-05-09 Thread David Roundy
ven though there should be one. I can > see Functor (Either a), but not Monad (Either a) or even Monad (Either > String)...] I am pretty certain that there is a monad instance for Either, but also don't know where it's defined. -- David Roundy Department of Physics Oregon St

Re: [Haskell-cafe] Re: Interesting critique of Haskell

2008-05-09 Thread David Roundy
On Fri, May 09, 2008 at 05:19:05PM +0100, Andrew Coppin wrote: > Brent Yorgey wrote: > > > >On Fri, May 9, 2008 at 10:02 AM, Andrew Coppin > ><[EMAIL PROTECTED] > wrote: > > > >While I'm here - I'm aware of how you control importing [or not] > >from the Prelude. I

Re: [Haskell-cafe] Re: Interesting critique of Haskell

2008-05-09 Thread David Roundy
's a Hard Problem, as far as I can tell. And, of course, "only" is quite an understatement here. -- David Roundy Department of Physics Oregon State University ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] runInteractiveProcess and hGetLine on Windows

2008-05-07 Thread David Roundy
On Wed, May 07, 2008 at 09:24:46PM +0100, Duncan Coutts wrote: > On Wed, 2008-05-07 at 08:46 -0700, David Roundy wrote: > > On Wed, May 07, 2008 at 08:33:23AM -0700, Bryan O'Sullivan wrote: > > > David Roundy wrote: > > > > This is the correct behavior (althou

Re: [Haskell-cafe] runInteractiveProcess and hGetLine on Windows

2008-05-07 Thread David Roundy
On Wed, May 7, 2008 at 9:12 AM, Donn Cave <[EMAIL PROTECTED]> wrote: > Doesn't hGetLine imply text mode? What does "Line" mean, otherwise? On normal operating systems, "line" means until you reach a '\n' character. In fact, that's also what it means when reading in text mode, it's just that whe

Re: [Haskell-cafe] runInteractiveProcess and hGetLine on Windows

2008-05-07 Thread David Roundy
On Wed, May 07, 2008 at 07:48:45PM +0400, Bulat Ziganshin wrote: > Hello David, Hi Bulat! > Wednesday, May 7, 2008, 7:46:11 PM, you wrote: > > I don't see any reason to support text mode. It's easy to filter by hand > > if you absolutely have to deal with ugly applications on ugly platforms. >

Re: [Haskell-cafe] runInteractiveProcess and hGetLine on Windows

2008-05-07 Thread David Roundy
On Wed, May 07, 2008 at 08:33:23AM -0700, Bryan O'Sullivan wrote: > David Roundy wrote: > > This is the correct behavior (although it's debatable whether kpsewhich > > should be outputting in text mode). > > I think it would be more accurate to say that runInterac

Re: [Haskell-cafe] runInteractiveProcess and hGetLine on Windows

2008-05-07 Thread David Roundy
certainly not the correct behavior for runInteractiveProcess, which has no knowledge about the particular behavior of the program it's running. "\r\n" as newline should die a rapid death... windows is hard enough without maintaining this sort of stupidity. -- David Roundy Department

Re: [Haskell-cafe] approximating pi

2008-04-28 Thread David Roundy
;t matter much, but it's quite a big deal when considering methods such as Quantum Monte Carlo (although, alas the fermion problem means that for most QMC calculations one *doesn't* get a rigorous error bar on the calculation... it's just better than almost any other method, and for b

Re: [Haskell-cafe] Re: [Haskell] How to define tail function for Even/Odd GADT lists?

2008-04-23 Thread David Roundy
se here but you could also do the following: > > data EvenList a = Nil > | ConsE a (OddList a) > > data OddList a = ConsO a (EvenList a) > > This does not use any type system extensions. > > -Iavor > > > > On Wed, Apr 23, 2008 at 4:46 PM,

[Haskell-cafe] Re: [Haskell] How to define tail function for Even/Odd GADT lists?

2008-04-23 Thread David Roundy
2008/4/23 Martijn Schrage <[EMAIL PROTECTED]>: > It depends a bit on what you want to use these lists for, but the following > encoding works for your examples and doesn't need the type class. > > data E > data O > > type Even = (E,O) > type Odd = (O,E) That's a nice little trick! I like how

Re: [Haskell-cafe] Stronger STM primitives needed? Or am I just doing it wrong?

2008-04-23 Thread David Roundy
On Wed, Apr 23, 2008 at 01:46:53PM -0700, Ryan Ingram wrote: > On 4/23/08, David Roundy <[EMAIL PROTECTED]> wrote: > > I'm confused as to how your retryUntil gains you anything. If any of the > > TVars used in the expensive_computation change while waiting

Re: [Haskell-cafe] Cabalizing darcs

2008-04-23 Thread David Roundy
t the > latest, and copy the files into it, the usual autoconf, and it should > then work as normal; if this doesn't work for you, I'd appreciate > knowing). It certainly doesn't work for me. -- David Roundy Department of Physics Oregon State University s

Re: [Haskell-cafe] Stronger STM primitives needed? Or am I just doing it wrong?

2008-04-23 Thread David Roundy
does your broken function using retryUntil differ from the following? broken = atomically $ do v <- expensive_computation :: STM (TVar Int) vv <- readTVar v unless (vv > 50) retry -- David Roundy Department of Physics Oregon State University _

[Haskell-cafe] Re: [darcs-devel] announcing franchise 0.0

2008-04-23 Thread David Roundy
On Wed, Apr 23, 2008 at 06:43:42PM +0200, Marc Weber wrote: > On Fri, Apr 18, 2008 at 08:37:06AM -0700, David Roundy wrote: > > I'm pleased to announce the existence (not release, properly) of > > franchise, a new configuration/build system for Haskell programs and > > pa

Re: [Haskell-cafe] Re: [Haskell] Matrix multiplication

2008-04-23 Thread David Roundy
h a challenging data type! (I wonder if this may be due to inefficiencies in the C code, although I haven't looked at it.) -- David Roundy Department of Physics Oregon State University ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: Laziness and Either

2008-04-23 Thread David Roundy
e a nice Error message (assuming fail = Error). Of course, you could take the silly metaphor even further data Creek a = a :< (Creek a) | Ocean | Drought String :) -- David Roundy Department of Physics Oregon State University ___ Haskell

Re: [Haskell-cafe] Glome.hs-0.3 and other things

2008-04-21 Thread David Roundy
On Mon, Apr 21, 2008 at 11:54 AM, Andrew Coppin <[EMAIL PROTECTED]> wrote: > I suppose the idea is that Haskell is supposed to help you work at a higher > level of abstraction, so you can concentrate on building better *algorithms* > which require less work in the first place. Surely using an algo

Re: [Haskell-cafe] announce: Glome.hs-0.3 (Haskell raytracer)

2008-04-18 Thread David Roundy
tter if you could manage to use unboxed arrays, so that your memory accesses really would be localized (assuming that you actually do have localize memory-access patterns). Of course, also ask yourself how much memory your program is using in total. If it's not much more than 512kB, for insta

Re: [Haskell-cafe] announce: Glome.hs-0.3 (Haskell raytracer)

2008-04-18 Thread David Roundy
only gets about five times the throughput of a job, meaning that each core is running at something like 60% of it's CPU capacity due to memory contention. It's possible that your system is comparably limited, although I'd be suprised, somehow it seems unlikely that your ray tracer is

[Haskell-cafe] announcing franchise 0.0

2008-04-18 Thread David Roundy
nchise (note that this will require darcs 2.0.0) To build and install franchise, simply execute runghc Setup.hs install --user --prefix=$HOME if you don't want to actually install it, just run runghc Setup.hs build I think that's all (and obviously, in no particular order). I hope you e

Re: [Haskell-cafe] announcing the darcs 2.0.0 release

2008-04-07 Thread David Roundy
it and you can see whether you like it more. There's also the factor that darcs 1.0.x isn't going to see another release. If you don't want to switch to eventually darcs 2.0, then I would strongly recommend that you switch to some other revision constr

[Haskell-cafe] announcing the darcs 2.0.0 release

2008-04-07 Thread David Roundy
ch of darcs and only one maintainer: for now this is me, David Roundy. Moreover, I will be attempting to act as a much lower-profile maintainer than we've had previously. I will not be reading bug reports, reading the darcs-users email list or even the darcs-devel mailing list. I will only be

Re: [Haskell-cafe] Re: Shouldn't this loop indefinitely => take (last [0..]) [0..]

2008-04-07 Thread David Roundy
On Mon, Apr 07, 2008 at 04:52:51AM -0700, John Meacham wrote: > On Mon, Apr 07, 2008 at 04:45:31AM -0700, David Roundy wrote: > > I wonder about the efficiency of this implementation. It seems that for > > most uses the result is that the size of a Nat n is O(n), which means that

Re: [Haskell-cafe] Re: Shouldn't this loop indefinitely => take (last [0..]) [0..]

2008-04-07 Thread David Roundy
onable default, since poor space use is often far more devastating then simple inefficiency. And of course it is also not always more efficient than strict numbers. -- David Roundy Department of Physics Oregon State University ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: Shouldn't this loop indefinitely => take (last [0..]) [0..]

2008-04-04 Thread David Roundy
azy-by-default language. It's a place where Haskell decided > to remove mathematical elegance for pragmatic speed... > > (Not that it isn't a worthwhile trade off, but it is still loosing > something to gain something else) Personally, I like Ints. -- David

Re: [Haskell-cafe] Re: Role based access control via monads or arrows or... something

2008-04-03 Thread David Roundy
On Thu, Apr 03, 2008 at 05:31:16PM +0200, apfelmus wrote: > David Roundy wrote: > >Luke Palmer wrote: > >>porrifolius wrote: > >>> (7) ideally required permissions would appear (and accumulate) in > >>> type signatures via inference so application co

Re: [Haskell-cafe] Role based access control via monads or arrows or... something

2008-04-03 Thread David Roundy
permissions could access the data (and this could be done at runtime). But this is far from an elegant or satisfactory (or complete) solution. -- David Roundy Department of Physics Oregon State University ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] announce: Glome.hs raytracer

2008-03-26 Thread David Roundy
. HPC at least will tell you > how many times top level things are called, and print pretty graphs > about it. It depends what the point is. I've found traces to be very helpful at times when debugging (for instance, to get values as well as c

Re: [Haskell-cafe] announce: Glome.hs raytracer

2008-03-26 Thread David Roundy
The point of putting traces into the code is precisely to figure out how many times it is called. The only trouble is that unsafePerformIO (I believe) can inhibit optimizations, since there are certain transformations that ghc won't do to unsafePerformIO code

Re: [Haskell-cafe] floating point operations and representation

2008-03-17 Thread David Roundy
On Wed, Mar 12, 2008 at 9:27 PM, Don Stewart <[EMAIL PROTECTED]> wrote: > You could consider binding directly to the C functions, if needed, > > {-# OPTIONS -fffi -#include "math.h" #-} > > import Foreign.C.Types > > foreign import ccall unsafe "math.h log10" > c_log10 :: CDoub

Re: [Haskell-cafe] Re: Small displeasure with associated type synonyms

2008-03-07 Thread David Roundy
al :: T a > > Yes, you are. Associate data type constructors (as well as ordinary > algebraic data constructors) are injective. So we have: Yay, that's what I though! (but was hesitant to suggest anything, since I've never actually used associated anything...) It's nice to hear

Re: [Haskell-cafe] Re: The Proliferation of List-Like Types

2008-02-20 Thread David Roundy
ly overlooked something important here... The problem is that while this would change the kind of ByteString to the same as the kind expected by Functor, you still couldn't define a proper Functor instance, since only ByteString' Word8 can ever actually be created. i.e. how could you implement

Re: [Haskell-cafe] Re: threads + IORefs = Segmentation fault?

2008-02-08 Thread David Roundy
modifying the IORef from > more than one thread you would need to use atomicallyModifyIORef, or MVars. If I did modify the IORef from more than one thread (e.g. if a bug were introduced), would this cause any trouble other than occasional missed updates or reads of wrong data? -- David Rou

[Haskell-cafe] Re: [darcs-devel] announcing darcs 2.0.0pre3

2008-01-31 Thread David Roundy
On Thu, Jan 31, 2008 at 11:51:10AM -0700, zooko wrote: > I would suggest that strict get should be the default and lazy is a > command-line option. Okay. I'm convinced, and am pushing a patch to do this. -- David Roundy Department of Physics Oregon State

[Haskell-cafe] Re: [darcs-devel] announcing darcs 2.0.0pre3

2008-01-31 Thread David Roundy
On Thu, Jan 31, 2008 at 09:47:06AM -0600, John Goerzen wrote: > On 2008-01-22, David Roundy <[EMAIL PROTECTED]> wrote: > > We are happy to announce the third prerelease version of darcs 2! Darcs 2 > > I'm very happy to see this, and will be trying it out today! Great! I

[Haskell-cafe] Re: [darcs-devel] announcing darcs 2.0.0pre3

2008-01-25 Thread David Roundy
from you where the pain is before going ahead, since I've got more work right now than I can handle. Also, if you want (way!) more information when tracking down timings, the progress reporting now interacts with the --debug flag to generate enough data to kill a horse. You could also ad

Re: [darcs-devel] [Haskell-cafe] Re: announcing darcs 2.0.0pre3

2008-01-24 Thread David Roundy
On Jan 23, 2008 5:47 PM, zooko <[EMAIL PROTECTED]> wrote: > > In principle it is good to provide a cryptographically secure hash, as > > this allows users to sign their repositories by signing a single file, > > which seems like it's potentially quite a useful feature. > > Can you be more specific

Re: [darcs-devel] [Haskell-cafe] Re: announcing darcs 2.0.0pre3

2008-01-23 Thread David Roundy
eems like it's potentially quite a useful feature. On the other hand, using sha2, which is twice as expensive (and twice as large, right) would perhaps be too costly. I don't know. SHA-2 would cost more in disk space and network bandwidth, as well as in CPU time. Is SHA-1 optimal? I don

Re: [Haskell-cafe] Re: [darcs-devel] announcing darcs 2.0.0pre3

2008-01-23 Thread David Roundy
4.x). I've come across the gnulib sha1 routine, which is adequately-licensed, and is fast enough to give us a 10% speedup in my obliterate test (beyond which we probably hit diminishing returns--we're probably no longer spending much time in sha1 at all). -- David Roundy Department of Phys

[Haskell-cafe] Re: [darcs-devel] announcing darcs 2.0.0pre3

2008-01-23 Thread David Roundy
15s for me. This makes me wonder whether it's worth looking into a faster sha1 implementation. -- David Roundy Department of Physics Oregon State University ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: [darcs-devel] announcing darcs 2.0.0pre3

2008-01-23 Thread David Roundy
On Wed, Jan 23, 2008 at 03:26:51PM +, Simon Marlow wrote: > David Roundy wrote: > > We are happy to announce the third prerelease version of darcs 2! Darcs 2 > > features numerous improvements, and it seems that we have fixed most of the > > regressions, so we're lo

Re: [Haskell-cafe] announcing darcs 2.0.0pre3

2008-01-23 Thread David Roundy
ogress is output be separate thread each 0.1 > second. operating threads just update global var with current state. > of course when operating thread need to interact with user, it just > sts another global var to False which prevents progress indicator > thread from showing anyt

[Haskell-cafe] announcing darcs 2.0.0pre3

2008-01-22 Thread David Roundy
We are happy to announce the third prerelease version of darcs 2! Darcs 2 features numerous improvements, and it seems that we have fixed most of the regressions, so we're looking for help, from users willing to try this release out. Read below, to see how you can benefit from this new release, and

Re: [Haskell-cafe] threads + IORefs = Segmentation fault?

2008-01-21 Thread David Roundy
On Sat, Jan 19, 2008 at 08:36:55PM +0100, Alfonso Acosta wrote: > On Jan 19, 2008 2:36 PM, David Roundy <[EMAIL PROTECTED]> wrote: > > Using ghc 6.6, but I've since isolated the bug as being unrelated to the > > IORefs and threading, it was in an FFI binding that somehow

Re: [Haskell-cafe] threads + IORefs = Segmentation fault?

2008-01-19 Thread David Roundy
; Peter > > > On Fri, 2008-01-18 at 18:22 -0500, David Roundy wrote: > > Hi all, > > > > I'm working on some new progress-reporting code for darcs, and am getting > > segmentation faults! :( The code uses threads + an IORef global variable > > to do thi

[Haskell-cafe] threads + IORefs = Segmentation fault?

2008-01-18 Thread David Roundy
scratch! Is this in fact that unsafe? Do I really need to switch to MVars, even though no locking is required? -- David Roundy Department of Physics Oregon State University ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: [darcs-devel] announcing darcs 2.0.0pre2

2008-01-16 Thread David Roundy
ze (width) of the repository, not with the number of patches (which had been the obvious suspect), which was causing trouble when applying to the pristine cache. At this point, darcs-2 outperforms darcs-1 on most tests that I've tried, so it'd be a good time to find some more per

Re: [Haskell-cafe] Re: 0/0 > 1 == False

2008-01-14 Thread David Roundy
On Fri, Jan 11, 2008 at 07:10:20PM -0800, Jonathan Cast wrote: > On 11 Jan 2008, at 10:12 AM, Achim Schneider wrote: > > >David Roundy <[EMAIL PROTECTED]> wrote: > > > >>Prelude> let x=1e-300/1e300 > >>Prelude> x > >>0.0 > >>Prelu

  1   2   3   4   5   >