Re: "let" vs. "where" [was: Re: more unsafePerformIO questions (is it safe to use with ReadMode Handles)?]

2003-08-19 Thread Andrew J Bromage
G'day all. On Wed, Aug 20, 2003 at 07:42:59AM +0200, Jan Scheffczyk wrote: > I always thought that there is a tiny difference between "let" and "where": They're semantically equivalent. See, for example: http://haskell.org/onlinereport/decls.html#sect4.4.3.2 Cheers, Andrew Bromage ___

"let" vs. "where" [was: Re: more unsafePerformIO questions (is it safe to use with ReadMode Handles)?]

2003-08-19 Thread Jan Scheffczyk
Hi Andrew, > let x = expensiveComputation foo in x + x > > I would certainly hope that expensiveComputation wasn't called twice, > and even though the language doesn't guarantee it, I have already > written code that assumed it. I always thought that there is a tiny difference between "let"

ANNOUNCE: New Chameleon version (03-08)

2003-08-19 Thread Martin Sulzmann
Latest version can be downloaded via http://www.comp.nus.edu.sg/~sulzmann/chameleon/ You might also want to check out http://www.comp.nus.edu.sg/~sulzmann/chr/publications.html - The Chameleon Type Debugger (Tool Demonstration) - Interactive Type Debugging in Haskell Martin

Re: more unsafePerformIO questions (is it safe to use with ReadMode Handles)?

2003-08-19 Thread Andrew J Bromage
G'day all. On Tue, Aug 19, 2003 at 11:11:23AM +0100, Ganesh Sittampalam wrote: > I was thinking of a situation like > > let x = unsafePerformIO readFooFromDB in x+x > > I see from your "Secrets of the GHC inliner" paper that x wouldn't be > inlined by GHC, but it seems to me like a serious abu

Announce: HWordNet - A Haskell Interface to WordNet

2003-08-19 Thread Hal Daume III
Briefly, http://www.isi.edu/~hdaume/HWordNet/ HWordNet is a Haskell binding to the WordNet database. You will actually need to have WordNet installed to use the Haskell interface, but you won't need any of the source (the Haskell interface is 100% pure Haskell; no crummy FFI bindings here!). H

RE: more unsafePerformIO questions ([...])

2003-08-19 Thread Simon Marlow
> On Tuesday, 2003-08-19, 13:18, Simon Marlow wrote: > > [...] > > > Yes, I agree that one shouldn't rely on the "no duplication of work" > > property. However, folloing this argument we arrive at the > conclusion that > > hGetContents is an invalid use of unsafePerformIO. (which > is someth

Re: more unsafePerformIO questions ([...])

2003-08-19 Thread Wolfgang Jeltsch
On Tuesday, 2003-08-19, 13:18, Simon Marlow wrote: > [...] > Yes, I agree that one shouldn't rely on the "no duplication of work" > property. However, folloing this argument we arrive at the conclusion that > hGetContents is an invalid use of unsafePerformIO. (which is something I've > been sayi

RE: more unsafePerformIO questions (is it safe to use with ReadMode Handles)?

2003-08-19 Thread Simon Marlow
> >> Isn't there the possibility of inlining causing a read to > >> happen twice even if it only appears to happen once? > > > >In theory that would be a valid transformation, but in practice no > >compiler would duplicate arbitrary computations. GHC > certainly doesn't. > > I was thinking of

Re: more unsafePerformIO questions (is it safe to use with ReadMode Handles)?

2003-08-19 Thread Ganesh Sittampalam
On Tue, 19 Aug 2003 10:52:57 +0100, "Simon Marlow" <[EMAIL PROTECTED]> wrote: >> Isn't there the possibility of inlining causing a read to >> happen twice even if it only appears to happen once? > >In theory that would be a valid transformation, but in practice no >compiler would duplicate arbitr

RE: more unsafePerformIO questions (is it safe to use with ReadMode Handles)?

2003-08-19 Thread Simon Marlow
> >If the databases *do* change over time, then there are two > >possibilities: > > > > 1. the contents change due to external factors only > > 2. the contents change because this program doing the writing > > > >in (1), you can still pretend the interface is pure, by > imagining that > >all t

Re: more unsafePerformIO questions (is it safe to use with ReadMode Handles)?

2003-08-19 Thread Ganesh Sittampalam
On Tue, 19 Aug 2003 10:27:23 +0100, "Simon Marlow" <[EMAIL PROTECTED]> wrote: >If the databases *do* change over time, then there are two >possibilities: > > 1. the contents change due to external factors only > 2. the contents change because this program doing the writing > >in (1), you can sti

Re: overlapping instances and functional dependencies

2003-08-19 Thread Wolfgang Jeltsch
Hello, I think, I realized now what my mistake was. The handling of overlapping instances comes into play when the compiler has to decide which method definition to choose for a specific instance. It is not for choosing one of more possible instances. In my example, C Int (Int,Char,Bool) Int a

RE: more unsafePerformIO questions (is it safe to use with ReadMode Handles)?

2003-08-19 Thread Simon Marlow
> I'm finishing up my Haskell interface to WordNet > (http://www.cogsci.princeton.edu/~wn/) and have a standard > unsafePerformIO question :). > > Basically, the interface functions by first calling an initialization > function, 'initializeWordNet :: IO WordNetEnv'. WordNetEnv is > essentially

2nd CfP: SNPD'03 Workshop on High-Level Approaches to Parallel and Distributed Computing

2003-08-19 Thread Clemens Grelck
Please apologize in case you receive multiple copies of this information. == 2nd CALL FOR PAPERS Workshop on High-Level Approaches to Parallel and Distributed Computing held in the context of the