[Haskell-cafe] IO Monad/ haskelldb strange error?

2006-08-08 Thread Marc Weber
line 39 works fine line 56 doesn't. Why? Isn't both a IO monad (because of the print statements) After commenting out 56 it compiles fine Any suggestion appreciated.. I'm struggling for some hours now.. module Modules.ObjectTree where import Debug.Trace import Data.FunctorM import DBUtils

Re: [Haskell-cafe] Re: Why Not Haskell?

2006-08-08 Thread Immanuel Litzroth
Reilly Hayes [EMAIL PROTECTED] writes: On Aug 7, 2006, at 10:00 AM, Stefan Monnier wrote: In any case, making a living by selling a program (as opposed to services around that program) is a difficult business.   Making a living writing and selling programs for use by a wide audience

deriving DeepSeq and deep strict fields proposals (Re[2]: [Haskell-cafe] How can we detect and fix memory leak due to lazyness?)

2006-08-08 Thread Bulat Ziganshin
Hello Ki, Tuesday, August 8, 2006, 6:34:51 AM, you wrote: Unfortunately seq and the strict data declaration is not helpful in general. They are only helpful on base values such as Int or Bool. What they do is just making sure that it is not a thunk. That is if it was a list it would just

Re: [Haskell-cafe] How can we detect and fix memory leak due to lazyness?

2006-08-08 Thread Chris Kuklewicz
Ahn, Ki Yung wrote: Recently, I'm facing the dark side of laziness -- the memory leak because of laziness. Typical pattern that I encounter the problem is like this. My code was working fine and I was happy. I just wanted to inspect some properties of my code so I made a slight chage go the

[Haskell-cafe] creating tree with level subnodes and incrementing number?

2006-08-08 Thread Marc Weber
Hi I've tried as an exercise to learn how to use the state monad to create a tree this way: module Main where import Control.Monad.State import Data.Tree import Random createTree :: Int - Int - (Tree Int, Int) createTree 4 = runState $ State $ \s - (Node s [] , s+1) -- stop at level 4

Re: [Haskell-cafe] creating tree with level subnodes and incrementing number?

2006-08-08 Thread Chris Kuklewicz
Is there a better way to do this? This problem is similar to adding numbers to each tree item Marc Yes. The feature you wanted is replicateM. The point of a State monad is you probably never have to touch the State data constructor: module Main where import Control.Monad.State import

Re: [Haskell-cafe] How can we detect and fix memory leak due to lazyness?

2006-08-08 Thread Udo Stenzel
Ahn, Ki Yung wrote: Recently, I'm facing the dark side of laziness -- the memory leak because of laziness. Are there standardized approaches for detecting and fixing these kind of problems? Not really. As Don S. already said, try heap profiling. The function that is too lazy will show up

Re: [Haskell-cafe] creating tree with level subnodes and incrementing number?

2006-08-08 Thread Udo Stenzel
Marc Weber wrote: I've tried as an exercise to learn how to use the state monad to create a tree this way: createTree :: Int - Int - (Tree Int, Int) createTree 4 = runState $ State $ \s - (Node s [] , s+1) -- stop at level 4 createTree level = runState (do item - State $ (\s - (s,s+1))

[Haskell-cafe] RE: [Haskell] thread-local variables

2006-08-08 Thread Simon Peyton-Jones
| I have initialized a wiki page: | | http://haskell.org/haskellwiki/Thread_local_storage Great | I have put a page on the wiki summarizing the thread. However, I want | to say that I think that email is a better medium for most ongoing | discussions. I agree. Discussion by email

[Haskell-cafe] Re: [Haskell] thread-local variables

2006-08-08 Thread Frederik Eaton
Furthermore, can we move this thread from the Haskell mailing list (which should not have heavy traffic) to either Haskell-Café, or the libraries list? Sure, moving to haskell-cafe. Frederik -- http://ofb.net/~frederik/ ___ Haskell-Cafe mailing

Re: [Haskell-cafe] creating tree with level subnodes and incrementing number?

2006-08-08 Thread Tomasz Zielonka
On Tue, Aug 08, 2006 at 02:30:39PM +0200, Marc Weber wrote: Is there a better way to do this? In this case it is quite easy to separate the task into two smaller ones: - creating the tree with a desired shape - numbering the nodes in post-order The first task is naturally expressed without

Re: [Haskell-cafe] creating tree with level subnodes and incrementing number?

2006-08-08 Thread Marc Weber
Thanks to you all! I think I've learned a lot. Marc ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] HWS - With Plugins

2006-08-08 Thread Johan Tibell
The HWS - With Plugins tarball is unavailable at the author's website (http://www.mdstud.chalmers.se/~md9ms/hws-wp/) and his email address doesn't work so this is desperate attempt to reach him. So, Martin Sjögren, are you here somewhere? P.S. If someone else knows where I could get hold of the

Re: [Haskell-cafe] Why Not Haskell?

2006-08-08 Thread Albert Lai
Brian Hulley [EMAIL PROTECTED] writes: Also, the bottom line imho is that Haskell is a difficult language to understand, and this is compounded by the apparent cleverness of unreadable code like: c = (.) . (.) when a normal person would just write: c f g a b = f (g a b) All

[Haskell-cafe] beginner's haskell question

2006-08-08 Thread Jens Theisen
Hello, as a haskell newbie I'm wondering about the following question. Are there options to popular haskell implementations or other means (haskell lint?) to check for incomplete patterns at compile time for some? I can't see a reason why this shouldn't be possible or even a relatively

Re: [Haskell-cafe] beginner's haskell question

2006-08-08 Thread J. Garrett Morris
The ghc flag -fwarn-incomplete-patterns might be what you're looking for. /g On 8/8/06, Jens Theisen [EMAIL PROTECTED] wrote: Hello, as a haskell newbie I'm wondering about the following question. Are there options to popular haskell implementations or other means (haskell lint?) to check

Re: [Haskell-cafe] beginner's haskell question

2006-08-08 Thread Donald Bruce Stewart
jens-theisen-tmp01: Hello, as a haskell newbie I'm wondering about the following question. Are there options to popular haskell implementations or other means (haskell lint?) to check for incomplete patterns at compile time for some? I can't see a reason why this shouldn't be possible

Re: [Haskell-cafe] Re: Why Not Haskell?

2006-08-08 Thread Reilly Hayes
On Aug 8, 2006, at 1:42 AM, Immanuel Litzroth wrote:"Reilly Hayes" [EMAIL PROTECTED] writes: I don't understand your argument. How exactly does the GPL get in theway of selling software as an instantiation of business expertise?Are you saying that you have the business expertise but