Hi everyone,
I have the following code whose purpose is to add dither (noise) to a given
array. The code looks very straightforward but apparently it has a memory
leak somewhere. Here I try to run the algorithm for an array of 10,000,000
integers. Ten million unboxed strict integers should equal
Hi Niko,
to, 2006-11-23 kello 12:11 +0200, Niko Korhonen kirjoitti:
I've tried applying seq and some other strictness tricks (such as x ==
x) pretty much everywhere on the code with no results. Could you
please help me understand what is going on here? Have I misunderstood
something critical
http://channel9.msdn.com/Showpost.aspx?postid=231495
The links to the video are a couple of yellow buttons at the bottom of
the article: Watch or Download.
I haven't watched this yet (it's nearly an hour long, I think). Found
via reddit (http://reddit.com).
Haskeller's on TV (sort of...) woot
Niko Korhonen wrote:
I have the following code whose purpose is to add dither (noise) to a given
array. The code looks very straightforward but apparently it has a memory leak
somewhere.
No, it doesn't. It can't, because it doesn't even compile. After
correcting the obvious
(lo,
Ah, yet another UndeadArray necromancer exhausting his stack of bones.
May the forces of light suggest to structure the incantation of darkness?
modifyArray arr i f =
readArray arr i = \y - writeArray arr i (f y)
accumM :: (MArray a e m, Ix i) =
(e - e' - e) - a i e -
Udo Stenzel wrote:
Niko Korhonen wrote:
I have the following code whose purpose is to add dither (noise) to a given
array. The code looks very straightforward but apparently it has a memory
leak
somewhere.
No, it doesn't. It can't, because it doesn't even compile. After
correcting the
On 20 Nov 2006, at 08:27, Michael T. Richter wrote:
I've been eyeing LLVM[1] as interesting technology -- brief
executive summary: a virtual machine suited as the back end of
compiler output with optimised native code then coming from it as
either JIT-based execution of the LLVM bytecode
Neil Mitchell schrieb:
How is this an FAQ:
http://www.haskell.org/haskellwiki/Why_Haskell_just_works
It's a nice piece of marketing, but I can't imagine anyone has ever
asked Why Haskell just works, unless they've already used it, in which
case they've moved past an FAQ.
Oh, but that kind of
Hi all,
Weekly news had a link to article
Local and global side effects with monad transformers
and the following is from there (minor modification done):
import Control.Monad.List
import Control.Monad.State
import Control.Monad.Writer
test5 :: StateT Integer (ListT (Writer [Char])) Integer
Hi thanks!
to, 2006-11-16 kello 14:02 -0800, Greg Buchholz kirjoitti:
] I'll guess the reason it didn't compile was different
] types at case branches (am I wrong?)
Correct.
] Anyhow, do you know that is it possible to choose the return type
] somehow in the spirit above?
isto wrote:
Hi all,
Weekly news had a link to article
Local and global side effects with monad transformers
and the following is from there (minor modification done):
import Control.Monad.List
import Control.Monad.State
import Control.Monad.Writer
test5 :: StateT Integer (ListT
On 11/23/06, Dougal Stanton [EMAIL PROTECTED] wrote:
Is there some sort of equivalent of the if/then/else construct for use
in the IO monad? For instance the following can get quite tedious:
do bool - doesFileExist filename
if bool
then sth
else sth'
Is there a more compact way of
Dougal Stanton wrote:
Is there some sort of equivalent of the if/then/else construct for use
in the IO monad? For instance the following can get quite tedious:
do bool - doesFileExist filename
if bool
then sth
else sth'
Is there a more compact way of writing that? Something
On 23/11/06, Jason Dagit [EMAIL PROTECTED] wrote:
A comment on that video said:
- BEGIN QUOTE
It seems to me that STM creates new problems with composability.
You create two classes of code: atomic methods and non atomic methods.
Nonatomic methods can easily call atomic ones – the
[sorry for quoting so much, kinda hard to decide here where to snip]
Cale Gibbard wrote:
On 23/11/06, Jason Dagit [EMAIL PROTECTED] wrote:
A comment on that video said:
- BEGIN QUOTE
It seems to me that STM creates new problems with composability.
You create two classes of code:
(Dropping [EMAIL PROTECTED])
Hi,
We've not yet looked at I/O in detail in Haskell, but there's a paper from a
few years back where I experimented with ways of integrating I/O with an
earlier implementation of atomic blocks in Java.
http://research.microsoft.com/~tharris/papers/2005-scp.pdf
On Thu, Nov 16, 2006 at 10:44:59PM +0200, isto wrote:
I'll guess the reason it didn't compile was different
types at case branches (am I wrong?) Anyhow, do you know that
is it possible to choose the return type somehow in the spirit
above?
GADTs let you do this. And they even omit the
You can use 'when' or 'unless' from the module Control.Monad, but they
each have only one branch, see:
http://members.chello.nl/hjgtuyl/tourdemonad.html#unless
and
http://members.chello.nl/hjgtuyl/tourdemonad.html#when
You can create a monadic 'if' like this (in an interactive session):
Hi,
On 23/11/06, Benjamin Franksen [EMAIL PROTECTED] wrote:
One answer is in fact to make it so that Console.Write can be rolled back
too. To achieve this one can factor the actual output to another task and
inside the transaction merely send the message to a transactional channel
(TChan):
Yes the code you are suggesting is certainly linear and it takes without
doubt time n.
But I was looking for a solution using foldl that of course takes time n.
The problem of the following solution is that it gives a reversed result,
and of course i can't just reverse the result.
couples = snd
Jason Dagit wrote:
On 11/23/06, Dougal Stanton [EMAIL PROTECTED] wrote:
Is there some sort of equivalent of the if/then/else construct for use
in the IO monad? For instance the following can get quite tedious:
do bool - doesFileExist filename
if bool
then sth
else sth'
Is there a
Hi Liyang HU
you wrote:
On 23/11/06, Benjamin Franksen [EMAIL PROTECTED] wrote:
One answer is in fact to make it so that Console.Write can be rolled
back too. To achieve this one can factor the actual output to another
task and inside the transaction merely send the message to a
ithika:
I was trying to write my own equivalent to Don Stewart's mkcabal but
ended up getting sidetracked. I made some generalised prompts for use at
the command line and wanted to get some feedback on them.
The full code can be found at [1] but the basic summary is like this:
prompt ::
I have a simple test program for takusen and PostgreSQL:
import Database.Enumerator
import Database.PostgreSQL.Enumerator
import Control.Monad.Trans
gazdbSession dbname = connect [CAdbname dbname]
resultCollector :: (Monad m) = String - IterAct m [String]
resultCollector str accum = result'
Dougal Stanton wrote:
Is there some sort of equivalent of the if/then/else construct for use
in the IO monad? For instance the following can get quite tedious:
do bool - doesFileExist filename
if bool
then sth
else sth'
Is there a more compact way of writing that?
On 11/23/06, Seth Gordon [EMAIL PROTECTED] wrote:
takusen-test.hs:11:57:
Couldn't match expected type `forall mark. DBM mark Session a'
against inferred type `DBM mark sess ()'
In the second argument of `($)', namely `main''
In the expression:
(withSession
mvanier:
First off, I apologize if this has come up before. As far as I can tell,
the mailing list archives don't have a search function. I'm running
ghc-6.6 and haddock-0.8, both compiled from source.
I'm working my way through the How to Write a Haskell Program tutorial
(which is a
Donald Bruce Stewart wrote:
Looks pretty good, though you use
case x :: Bool of
True - ...
False - ...
when
if x then ... else ...
would be preferred.
Why? Personally, I find boolean case to feel better wrt layout and I see
no loss of clarity in its use.
28 matches
Mail list logo