I recently read the STM paper on lock-free data structures [1] which I
found very informative in my quest to learn how to use STM. However,
there are a few things I do not fully understand and was hoping
someone might be able to explain further.
In the STM version of the ArrayBlockingQueue, the
Bryan O'Sullivan [EMAIL PROTECTED] writes:
Pete Kazmier wrote:
data ArrayBlockingQueueSTM e = ArrayBlockingQueueSTM {
[...]
sa :: Array Int (TVar e)
}
It's unclear to me why the Array's elements must be wrapped in TVars.
To allow them to be modified. You can't otherwise
Ian Zimmerman [EMAIL PROTECTED] writes:
It has a different focus than the Moss haskell-mode that's normally
used nowadays. Yaham strives, first and foremost, to integrate well
with the rest of Emacs and respect the Emacs ecosystem.
Could you elaborate on this? Perhaps an itemized list of
Brandon S. Allbery KF8NH [EMAIL PROTECTED] writes:
On Jun 15, 2007, at 18:37 , Jason Dagit wrote:
I love to see people using Haskell, especially professionally, but I
have to wonder if the real tool for this job is sed? :-)
Actually, while sed could do that, it'd be a nightmare. You really
As a newbie to Haskell, I found your thorough analysis very
interesting. Thanks for the great read! I have a few questions
regarding some of your comments, see below:
Jules Bean [EMAIL PROTECTED] writes:
E,F. Progressive GET
pSynGET :: URL - ((Bool,ByteString) - IO ()) - IO ()
I've modified my Norvig spelling corrector to use a trie instead of
Data.Map in the hopes of improving performance. Plus, this is fun and
a great learning exercise for me. Unfortunately, when I load my trie
with a large amount of data, I get a stack overflow. It's unclear to
me why this is
Ketil Malde [EMAIL PROTECTED] writes:
On Sun, 2007-04-22 at 00:25 -0400, Pete Kazmier wrote:
Pete Kazmier [EMAIL PROTECTED] writes:
I'd love to see other Haskell implementations as well if anyone has a
few moments to spare. Admittedly, it took me several hours to get my
version working
Bryan O'Sullivan [EMAIL PROTECTED] writes:
After this switch, I found that spellchecking one word still took 4x
as long in Haskell as Norvig's Python program. Since I was checking
only one word in each case, essentially all of the runtime was taken
up by building the word frequency map.
Derek Elkins [EMAIL PROTECTED] writes:
After reading Bryan's post, I switched my right fold to a strict left
fold and almost tripled my original speed. Could someone provide some
guidelines on when to use each? I thought foldr should be used when
building some large data structure such as
Recently I read an interesting article by Peter Norvig[1] on how to
write a spelling corrector in 21-lines of Python. I wanted to try and
implement it in Haskell. My implementation is terribly slow and I was
hoping for some tips on how to improve it and make it idiomatic.
I'd love to see other
Pete Kazmier [EMAIL PROTECTED] writes:
I'd love to see other Haskell implementations as well if anyone has a
few moments to spare. Admittedly, it took me several hours to get my
version working, but I'm a Haskell newbie. Unfortunately, I think it
runs as slow as it took me to write
Simon Peyton-Jones [EMAIL PROTECTED] writes:
My guess is that they'll be Linux/Perl/Ruby types, and they'll be
practitioners rather than pointy-headed academics.
Suggest concrete examples of programs that are
* small
* useful
*
Evan Laforge [EMAIL PROTECTED] writes:
It illustrates a few nice things about haskell: laziness for the
recursive defs and easy backtracking, low syntax overhead and custom
operators for DSLs, composability, etc.
Although that is true, I somehow feel that showing a perl, ruby, or
python
Claus Reinke [EMAIL PROTECTED] writes:
I won't try to understand fix just yet, but I'm still confused by
the type of fix:
fix :: (a - a) - a
It appears to me that it takes a function as an argument, and that
function takes a single argument. So how are you passing fix an
anonymous
Matthew Brecknell [EMAIL PROTECTED] writes:
Pete Kazmier:
I understand the intent of this code, but I am having a hard time
understanding the implementation, specifically the combination of
'fix', 'flip', and 'interate'. I looked up 'fix' and I'm unsure how
one can call 'flip' on a function
Matthew Brecknell [EMAIL PROTECTED] writes:
As others have pointed out, fix is polymorphic, so a can stand for any
type, including (b - c). Removing redundant parentheses, this means
fix can directly specialise to:
fix :: ((b - c) - b - c) - b - c
I understand now. I think part of my
Matthew Brecknell [EMAIL PROTECTED] writes:
Pete Kazmier:
I attempted to read Oleg's fold-stream implementation [1] as this
sounds quite appealing to me, but I was completely overwhelmed,
especially with all of the various type signatures used. It would be
great if one of the regular
Pete Kazmier [EMAIL PROTECTED] writes:
I attempted to read Oleg's fold-stream implementation [1] as this
sounds quite appealing to me, but I was completely overwhelmed,
especially with all of the various type signatures used. It would be
great if one of the regular Haskell bloggers (Tom
Matthew Brecknell [EMAIL PROTECTED] writes:
So here's a test. I don't have any big maildirs handy, so this is based
on the simple exercise of printing the first line of each of a large
number of files. First, the preamble.
import Control.Exception (bracket)
import System.Environment
import
When using readFile to process a large number of files, I am exceeding
the resource limits for the maximum number of open file descriptors on
my system. How can I enhance my program to deal with this situation
without making significant changes?
My program takes one or more directories that
[EMAIL PROTECTED] (Donald Bruce Stewart) writes:
pete-expires-20070513:
When using readFile to process a large number of files, I am exceeding
the resource limits for the maximum number of open file descriptors on
my system. How can I enhance my program to deal with this situation
without
The other day at work an opportunity arose where I was hoping to sneak
some Haskell into the pipeline of tools used to process call detail
records (CDRs). In the telecommunications industry, CDRs are used for
billing. Each CDR is a single line record of 30 comma-separated
values. Each line is
[EMAIL PROTECTED] writes:
For such a small self-contained task, I don't think Haskell
is any better than Python.
I figured as much, but I thought with the new FPS lazy bytestrings it
might have a chance in terms of raw speed. On the other side of the
coin, in terms of elegance, I thought I'd
Simon Peyton-Jones [EMAIL PROTECTED] writes:
You probably know this, but your kind of application is a big reason
that we now make GHC available as a library. (Just say 'import GHC'.)
You shouldn't need to parse Haskell yourself: just call GHC's parser.
You get back a syntax tree with
Pete Kazmier [EMAIL PROTECTED] writes:
As part of my learning experience, I think I want to see if I can
write a haskell pastebin that does proper syntax highlighting.
Someone in #haskell suggested that I use just a lexer because using a
parser is overkill. However, I can't make
25 matches
Mail list logo