[Haskell-cafe] Is lazyness make big difference?

2007-02-15 Thread Nick
Hi all, (Another topic stolen from a Russian forum discussion). As everyone know, there are lot of strict languages, that have possibilities to switch on lazy evaluation when needed. But the examples that I saw on Haskell, there was not much use of lazy evaluation, often there were just

Re: [Haskell-cafe] Is lazyness make big difference?

2007-02-15 Thread Allan Clark
Nick wrote: Hi all, (Another topic stolen from a Russian forum discussion). As everyone know, there are lot of strict languages, that have possibilities to switch on lazy evaluation when needed. But the examples that I saw on Haskell, there was not much use of lazy evaluation, often there

Re: [Haskell-cafe] Is lazyness make big difference?

2007-02-15 Thread Dougal Stanton
Quoth Nick, nevermore, According to one guy's analogy: the Real World is strict - in order to drink tea, you have to put the cattle on the fire, wait until water boils, brew tea and then drink. Not the cattle is put on the fire, water boils and the tea is brewed when you take the empty cup

Re: [Haskell-cafe] Summer of Code

2007-02-15 Thread Chris Kuklewicz
This project may be a success: 4. Project: Fast Mutable Collection Types for Haskell Caio Marcelo de Oliveira Filho Completed, and part of pugs. http://perlcabal.org/~audreyt/darcs/pugs/third-party/HsJudy/ But there is no way to pull this out of pugs and install it as a

Re: [Haskell-cafe] Programming an Evaluation Context

2007-02-15 Thread Claus Reinke
in structural operational semantics, an evaluation context is often used to decompose an expression into a redex and its context. In a formal semantics on paper, an expression can just be pattern matched over the grammar of an evaluation context. If one wants to implement such a semantics in

Re: [Haskell-cafe] Summer of Code

2007-02-15 Thread Donald Bruce Stewart
haskell: This project may be a success: 4. Project: Fast Mutable Collection Types for Haskell Caio Marcelo de Oliveira Filho Completed, and part of pugs. http://perlcabal.org/~audreyt/darcs/pugs/third-party/HsJudy/ But there is no way to pull this out of

[Haskell-cafe] Re: Implementation of scaled integers

2007-02-15 Thread Stefan Heinzmann
Stefan Heinzmann wrote: is there a library for Haskell that implements scaled integers, i.e. integers with a fixed scale factor so that the scale factor does not need to be stored, but is part of the type? In particular it would be useful (i.e. for signal processing) to have numbers based

Re: [Haskell-cafe] Is lazyness make big difference?

2007-02-15 Thread Kurt Schelfthout
2007/2/15, Dougal Stanton [EMAIL PROTECTED]: Quoth Nick, nevermore, According to one guy's analogy: the Real World is strict - in order to drink tea, you have to put the cattle on the fire, wait until water boils, brew tea and then drink. Not the cattle is put on the fire, water boils and

Re: [Haskell-cafe] Summer of Code

2007-02-15 Thread Chris Kuklewicz
Donald Bruce Stewart wrote: If anyone *can* make HsJudy install and work, could you put this information on the haskell wiki? -- Chris I'd just ping the auhtor, host the repo on darcs.haskell.org, and then fix it until it builds like any normal cabalised repo. It really could be a

[Haskell-cafe] Re: Is lazyness make big difference?

2007-02-15 Thread Gleb
Nick wrote: /* Lazily compute the logger. The computation will not start running until the value of 'logger' is actually requested. */ var logger = lazy({ Logging.getLogger() }) /* This will start the computation */ logger.debug(medved) /* No delay to compute the

[Haskell-cafe] Re: Is lazyness make big difference?

2007-02-15 Thread apfelmus
Allan Clark wrote: For me one of the best examples of this is that of logging within a compiler. Consider a compiler which operates roughly as such compileProgram :: String - IO () compileProgram program = let (log, abstract) = parse program (log2, typedProgram) = typeCheck

Re: [Haskell-cafe] Re: Is lazyness make big difference?

2007-02-15 Thread Allan Clark
i.e. to use Monad.Writer in stead of Monad.State. The point is that for example 'typedProgram' does not really depend on the contents of 'log', but the dependencies in your code don't express this. One should switch from Log - (a, Log) to (a, Log - Log) or even (a, Log) if Log

[Haskell-cafe] Re: Is lazyness make big difference?

2007-02-15 Thread apfelmus
Nick wrote: The question is the following: how big the gap between strict languages with lazy constructs and Haskell? Does the default lazyness have irrefutable advantage over default strictness? Laziness is needed to achieve true compositionality. This point is elaborated in John Hughes.

Re: [Haskell-cafe] LugRadio talk

2007-02-15 Thread Magnus Therning
On Wed, Feb 14, 2007 at 18:52:51 +, Dougal Stanton wrote: So which one of you wonderful people volunteered to give a talk on Haskell at the coming LugRadio Live? I'm afraid I didn't catch the name, though it might have been a Magnus something? It might be enough to make me go if I knew there

Re: [Haskell-cafe] FFI basics

2007-02-15 Thread Magnus Therning
On Fri, Feb 09, 2007 at 14:23:53 +0200, Yitzchak Gale wrote: Hi, I would like to use FFI for the first time. Can someone give me a really, really simple complete example? I want to be able to take a simple C program and access a function from it in Haskell. A simple example of the other way

Re: [Haskell-cafe] LugRadio talk

2007-02-15 Thread Dougal Stanton
Quoth Magnus Therning, nevermore, Ah, damn it, I knew I shouldn't have put that in my mail to them. I just couldn't let them get away with complaining so much about Haskell though. I'm glad you did. I was getting a bit annoyed as well. One of the presenters also stresses his hate of Haskell

[Haskell-cafe] Re: LugRadio talk

2007-02-15 Thread Simon Marlow
Dougal Stanton wrote: Quoth Magnus Therning, nevermore, Ah, damn it, I knew I shouldn't have put that in my mail to them. I just couldn't let them get away with complaining so much about Haskell though. I'm glad you did. I was getting a bit annoyed as well. One of the presenters also

Re: [Haskell-cafe] Programming an Evaluation Context

2007-02-15 Thread Claus Reinke
-- evaluation contexts, parameterized by rule to apply ctxt rule e = rule e `mplus` left (ctxt rule) e `mplus` right (ctxt rule) e left act e = do { (Plus l r) - return e; lv - act l; return (Plus lv r) } right act e = do { (Plus lv@(Val _) r) - return e; rv - act r; return (Plus lv

Re: [Haskell-cafe] Re: LugRadio talk

2007-02-15 Thread Kirsten Chevalier
So which date was this infamous show where they talked trash about Haskell, anyway? I want to hear this firsthand, but the tables of contents given on their web sites don't seem to list talking trash about Haskell as an item :-) Cheers, Kirsten -- Kirsten Chevalier* [EMAIL PROTECTED] *Often in

[Haskell-cafe] Re: Lambada and connecting Haskell to a Weblogic server

2007-02-15 Thread Adam Megacz
You should check out Brian Alliet's LambdaVM: http://www.cs.rit.edu/~bja8464/lambdavm/ - a Joel Reymont [EMAIL PROTECTED] writes: Folks, Where can I find Lambada these days and would it be of any use to me in trying to connect to a Weblogic server? To make the long story short, my

Re: [Haskell-cafe] SoC: Port Haddock to use GHC

2007-02-15 Thread David Waern
15 feb 2007 kl. 18.19 skrev Nicolas Frisby: I am very ready for a Haddock that can swallow infix typenames. Yes, Haddock-GHC can do that. In dons's recent overview of the last SoC, a darcs repo for Waern's project was listed. I jumped at the link but couldn't find much documentation (i.e.

Re: [Haskell-cafe] A voice in the desert... (Was: Is lazyness make big difference?)

2007-02-15 Thread Dan Weston
Kudos to you for invoking Plato. This forum could use a bit of epistemological levity. Your passionate and quirky style reminds me of the Laws of Form by G. Spencer-Brown (http://en.wikipedia.org/wiki/Laws_of_form). One quibble: I work for a one of the world's largest 3-D visual effects

Re: [Haskell-cafe] Re: Lambada and connecting Haskell to a Weblogic server

2007-02-15 Thread Mark T.B. Carroll
Adam Megacz [EMAIL PROTECTED] writes: You should check out Brian Alliet's LambdaVM: http://www.cs.rit.edu/~bja8464/lambdavm/ That looks very interesting. We'd been wondering if there was some route from GHC core to Scheme through Bigloo or Kawa to the JVM, but something more direct is

[Haskell-cafe] Re: Lambada and connecting Haskell to a Weblogic server

2007-02-15 Thread Brian Alliet
On Thu, Feb 15, 2007 at 11:24:31AM -0800, Adam Megacz wrote: You should check out Brian Alliet's LambdaVM: http://www.cs.rit.edu/~bja8464/lambdavm/ I think what is in darcs is actually broken right now (the base repo is out of sync with the ghc repo), but thanks for giving me a big

[Haskell-cafe] Re: Lambada and connecting Haskell to a Weblogic server

2007-02-15 Thread Adam Megacz
[EMAIL PROTECTED] (Mark T.B. Carroll) writes: Is it easy to create Haskell stubs (in the IO monad, presumably) for standard Java libraries so that your compiled-to-JVM Haskell code can easily use the usual Java APIs like Swing? One source of vexation for us is mapping between Java types and

[Haskell-cafe] LambdaVM (was Re: Lambada and connecting Haskell to a Weblogic server)

2007-02-15 Thread Brian Alliet
On Thu, Feb 15, 2007 at 02:53:47PM -0500, Mark T.B. Carroll wrote: Is it easy to create Haskell stubs (in the IO monad, presumably) for standard Java libraries so that your compiled-to-JVM Haskell code can easily use the usual Java APIs like Swing? One source of vexation for us is mapping

Re: [Haskell-cafe] How to solve this problem?It's quite easy in PHP.

2007-02-15 Thread Gene A
On 2/13/07, keepbal [EMAIL PROTECTED] wrote: For example, (... $arr['a']='1'; $arr['b']='2'; $arr['c']='3'; ...) result: a = 1 b = 2 c = 3 - Haskell solution: build the array of all lower case with corresponding numbers starting with 1 Prelude let lowerCaseTable = zip

Re: [Haskell-cafe] How to solve this problem?It's quite easy in PHP.

2007-02-15 Thread Gene A
On 2/15/07, Gene A [EMAIL PROTECTED] wrote: Haskell solution: build the array of all lower case with corresponding numbers starting with 1 Prelude let lowerCaseTable = zip ['a'..'z'] [1..26] A couple of functions: Prelude let box a = a:[] Prelude let formatTableItems (a,b) = (box a) ++ = ++

Re: [Haskell-cafe] Re: LugRadio talk

2007-02-15 Thread Dougal Stanton
Quoth Kirsten Chevalier, nevermore: So which date was this infamous show where they talked trash about Haskell, anyway? I want to hear this firsthand, but the tables of contents given on their web sites don't seem to list talking trash about Haskell as an item :-) I'm pretty sure it was within

[Haskell-cafe] exists . a psuedo-standard non-empty list module

2007-02-15 Thread Nicolas Frisby
I don't particularly like using fromJust or head, and there's been plenty of discussion on those issues. For the cases where it makes good sense to do so, I'm about to write a module for non-empty lists that looks to strike a balance between usability and static checks. But before I re-invent the

Re: [Haskell-cafe] Re: Is lazyness make big difference?

2007-02-15 Thread Nick
Gleb, It seems you miss the point here: not only logger should be lazy, but all calls to logger's methods: logger.debug(formatLongMessage(args)); // formatLongMessage should not    // waste CPU cycles if debug

Re: [Haskell-cafe] Summer of Code

2007-02-15 Thread Mathew Mills
Google just announced the 2007 SoC http://code.google.com/soc/ On 2/15/07, Chris Kuklewicz [EMAIL PROTECTED] wrote: Donald Bruce Stewart wrote: If anyone *can* make HsJudy install and work, could you put this information on the haskell wiki? -- Chris I'd just ping the auhtor, host the

Re: [Haskell-cafe] Does laziness make big difference?

2007-02-15 Thread Nick
Dougal, According to one guy's analogy: the Real World is strict - in order to drink tea, you have to put the cattle on the fire, wait until water boils, brew tea and then drink. Not the cattle is put on the fire, water boils and the tea is brewed when you take the empty cup to

Re: [Haskell-cafe] SoC: Port Haddock to use GHC

2007-02-15 Thread Nicolas Frisby
One of my questions surely should have been: 5) Does haddock.ghc build? Does it work? I succeeded in getting it compiled (I filled in the missing data definition of DocOptions, hacked it to always use [] for the options anyway, manually set the compilerPath, and maybe more). Unfortunately it

Re: [Haskell-cafe] Does laziness make big difference?

2007-02-15 Thread Nick
Nicolas, Someone already mentioned John Hughes paper. Another resource is SPJ's "hair shirt" slides (also discusses type classes and monads). http://research.microsoft.com/~simonpj/papers/haskell-retrospective/HaskellRetrospective.pdf Laziness is addressed beginning on slide 19.

Re: [Haskell-cafe] Re: Does laziness make big difference?

2007-02-15 Thread Peter Gammie
Nick, Roughly, I'd say you can fudge laziness in data structures in a strict language without too much bother. (I don't have much experience with this, but the existence of a streams library for OCaml is the sort of thing I mean. There are plenty of papers on co- iterative streams and