You can abstract this pattern:
-- runs its argument in an infinite loop, and returns an action that stops
the loop
daemon :: IO () - IO (IO ())
daemon action = do
stopvar - atomically $ newTVar False
let run = do
stop - atomically $ readTVar stopvar
if stop
On Mon, 2009-01-12 at 20:24 -0200, rodrigo.bonifacio wrote:
Hi all,
I'm trying to build a library that has the following code:
hasTypeOf (TermRep (dx,_,_)) (x::t)
= ((fromDynamic dx)::Maybe t)
Could you do something like this?
Enforce the types with a signature:
hasTypeOf :: (Typeable
Although I am not Luke, I will answer :)
The code creates a TVar 'stopvar', whose truth means to the 'run' loop
that it's time to return ().
So, if we're going to return an action that stops the loop, we're
going to return an action that sets stopvar to True.
That's precisely what return
* Ahn, Ki Yung wrote:
This is why I am looking for existing work, because I am
not yet very sure about my code I'm using.
http://www.galois.com/technology/communications_security
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
I just tried to install the cabal-install tool (version 0.6.0) (see
http://www.haskell.org/cabal/download.html) on Windows XP, Service
Pack 2, but when I followed the instructions on the download page and
downloaded cabal-install-0.6.0.tar.gz, the gunzipped untarred
cabal-install-0.6.0 directory
Thanks Kazuya, that link is perfect.
Basically, I have to explicitly add -lglut :
ghc -package GLUT -lglut HelloWorld.hs -o HelloWorld
Great. GLUT (and now FreeGLUT) remains the simplest
and most reliable standard cross-platform OpenGL
windowing API.
(It seems from the link that the
Luke Palmer lrpal...@gmail.com wrote:
TVars are overkill here, actually, an IORef would be just fine, I
think.
Using IORefs is generally a sign of bad style. But MVars would
perfectly suffice here. They would be essentially the same, but without
'atomically'.
Greets,
Ertugrul.
--
On Thu, Jan 22, 2009 at 8:11 AM, Belka lambda-be...@yandex.ru wrote:
You can abstract this pattern:
-- runs its argument in an infinite loop, and returns an action that stops
the loop
daemon :: IO () - IO (IO ())
daemon action = do
stopvar - atomically $ newTVar False
let run = do
On Thu, Jan 22, 2009 at 5:48 AM, Ertugrul Soeylemez e...@ertes.de wrote:
Luke Palmer lrpal...@gmail.com wrote:
TVars are overkill here, actually, an IORef would be just fine, I
think.
Using IORefs is generally a sign of bad style.
I totally disagree.
The disadvantage of IORefs is that
Sure, I've had to deal with this frequently. Luckily, Data.Binary has
functions like getWord32be, putWord64le, etc. I've never had any
problems and typically don't worry about the wire format after making
the Binary instances.
Or, if your question was what types of programs might be concerned
On Thu, 2009-01-22 at 18:38 +0900, Benjamin L.Russell wrote:
To facilitate installation for Windows users, perhaps cabal.exe should
be bundled with cabal-install-0.6.0.tar.gz, and the README file
updated?
I will mention it in the README for the next release. As it happens the
new bootstrap.sh
Thomas Davie wrote:
Further to all the playing with unamb to get some very cool behaviors,
you might want to look at Olaf Chitil's paper here:
http://www.cs.kent.ac.uk/pubs/2006/2477/index.html
It outlines a tool for checking if your programs are as non-strict as
they can be.
On Wed, Jan 21, 2009 at 11:12 PM, Eugene Kirpichov ekirpic...@gmail.com wrote:
To my mind, in the map-reduce case you generally need a commutative
monoid. Or, you need an extra infrastructure that mappend's only
results from adjacent machines, or something like that.
This is a good paper on
See, that's the kind of name we need!
StructureWithAssociativeOperationAndIdentity -- make both the mathematicians
AND the non-mathematicians mad!
On Thu, Jan 22, 2009 at 9:53 AM, Dan Piponi dpip...@gmail.com wrote:
On Wed, Jan 21, 2009 at 11:12 PM, Eugene Kirpichov ekirpic...@gmail.com
wrote:
One wart that was briefly mentioned during the Great Monoid Naming
Thread of 2009 is the need to wrap types in newtypes to provide multiple
instances of the same class with different semantics -- the archetypical
example being Integer as a monoid over addition as well as
multiplication.
I was
On Thu, Jan 22, 2009 at 06:53:24AM -0800, Dan Piponi wrote:
On Wed, Jan 21, 2009 at 11:12 PM, Eugene Kirpichov ekirpic...@gmail.com
wrote:
To my mind, in the map-reduce case you generally need a commutative
monoid. Or, you need an extra infrastructure that mappend's only
results from
Thanks; I saw you mention the paper before, but now I finally started
reading it :)
By the way, the paper *does* arrange an extra infrastructure for
mappending only adjacent results.
Looks like with a commutative monoid, a fold could be done in a fully
distributed fashion, however it would no more
Luke Palmer lrpal...@gmail.com wrote:
On Thu, Jan 22, 2009 at 5:48 AM, Ertugrul Soeylemez e...@ertes.de wrote:
Luke Palmer lrpal...@gmail.com wrote:
TVars are overkill here, actually, an IORef would be just fine, I
think.
Using IORefs is generally a sign of bad style.
I totally
On Thu, Jan 22, 2009 at 9:04 AM, Ertugrul Soeylemez e...@ertes.de wrote:
A program that needs only IORefs and is threadsafe is *good* style to
me, because it means all the state is well-encapsulated (if it
escaped, it would fail to be threadsafe).
That's not my point. The use of IORefs
Lennart Augustsson schrieb:
There's the numbers package which contains BigFloat. You can pick
your own precision, but it's not IEEE.
It's actually base 10 floats which makes it more fun (actually, the
iEEE standard will cover base 10 floats in the future).
Actually, all of the arbitrary
On Wed, Jan 21, 2009 at 9:20 AM, David Fox dds...@gmail.com wrote:
I posted a bug about this (http://hackage.haskell.org/trac/ghc/ticket/2971)
but its so odd I had to ask here. Using ghc 6.10.1, both readFile
/proc/mounts and Data.ByteString.Lazy.Char8.readFile /proc/mounts hang
on an amd64
Hello haskell-cafe,
SPJ asked us a few years ago about examples of simple and elegant
haskell programs. i want to propose this external sorting program: it
reads stdin in chunks of 5000 lines, writes sorted chunks into files
and then merges files together:
import Data.List
import Control.Monad
Interesting. I have a similar, but worse problem. For me, ':load'ing main.hs
would fail to find the imported files. The only thing I appear to be able to
:load is files that don't import from local directories.
2009/1/22 Peter Verswyvelen bugf...@gmail.com
I have a silly problem.
I'm using
Hello,
Just some minor suggestions and comments:
The description might read better as two sentences:
A class for monoids with various general-purpose instances. Monoids
are types with an associative binary operation that has an
identity.
One thing that I think is a bit unclear from
I have a silly problem.
I'm using Emacs with the Haskell mode extension on Windows
I have a source file in say
c:/foo/src/main.hs
main.hs is importing some other modules in that same src directory
When I invoke GHCi from within Emacs, the first thing it does is
:cd c:/foo
and then
:load
On my Mac I've had the same problem. Commenting out lines
(unless (equal default-directory root)
(setq default-directory root)
(inferior-haskell-send-command
proc (concat :cd default-directory)))
solved it for me.
On 22 Jan 2009, at 20:23,
mmm, it seems that the code is searching for the location of a cabal file
and uses that as the current directory, assuming all source code is relative
to that directory, instead of using the source directive in that cabal file.
On Thu, Jan 22, 2009 at 6:23 PM, Andrew Wagner
Oops, sorry, forgot to mention that lines worth commenting were in
inf-haskell.el file.
On 22 Jan 2009, at 20:23, Andrew Wagner wrote:
Interesting. I have a similar, but worse problem. For me, ':load'ing
main.hs would fail to find the imported files. The only thing I
appear to be able to
indeed, that works! the comment above those lines is:
;; Not sure if it's useful/needed and if it actually works.
:-)
On Thu, Jan 22, 2009 at 6:41 PM, Miguel Mitrofanov miguelim...@yandex.ruwrote:
On my Mac I've had the same problem. Commenting out lines
(unless (equal
On Thu, 2009-01-22 at 16:11 +0100, Ketil Malde wrote:
One wart that was briefly mentioned during the Great Monoid Naming
Thread of 2009 is the need to wrap types in newtypes to provide multiple
instances of the same class with different semantics -- the archetypical
example being Integer as a
On Thu, 2009-01-22 at 11:32 -0600, Jeremy Shaw wrote:
Hello,
Just some minor suggestions and comments:
The description might read better as two sentences:
A class for monoids with various general-purpose instances. Monoids
are types with an associative binary operation that has an
Not that you're looking to switch editors, but if you want something a
little more hassle-free:
http://www.n-brain.net/unashots/Haskell/ErrorHighlighting.png
Regards,
John
On Jan 22, 2009, at 10:17 AM, Peter Verswyvelen wrote:
I have a silly problem.
I'm using Emacs with the
On Thu, 22 Jan 2009, Eugene Kirpichov wrote:
To my mind, in the map-reduce case you generally need a commutative
monoid. Or, you need an extra infrastructure that mappend's only
results from adjacent machines, or something like that.
The paper
http://www.cs.vu.nl/~ralf/MapReduce/
analyzes
Thomas DuBuisson thomas.dubuis...@gmail.com writes:
open(/proc/mounts, O_RDONLY|O_NOCTTY|O_NONBLOCK) = 3
fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0x77470b70) = -1 ENOTTY
(Inappropriate ioctl for device)
This is to test whether the file
Hello John,
Thursday, January 22, 2009, 8:50:39 PM, you wrote:
thanks, support of over-internet and intranet collaboration looks very
promising these days (even if not saying about ability to highlight error place
;)
btw, i was unable to download mp4 video from http://vimeo.com/1653402
(online
http://depositfiles.com/files/4565hs7vl
On 22 Jan 2009, at 21:14, Bulat Ziganshin wrote:
Hello John,
Thursday, January 22, 2009, 8:50:39 PM, you wrote:
thanks, support of over-internet and intranet collaboration looks very
promising these days (even if not saying about ability to highlight
Hello
(i sent this message to the mail of author, specified at hackage, but it
returned to me, so i decided to resend it here)
I found strange thing during work with latest versions of CouchDB HTTP
module on my Mac OS X 10.4. The problem is, that when i send document to
the couchdb server, it
This library provides an STM monad with commit and retry IO hooks. A
retry-action is run (once) in a separate thread if the transaction retries,
while commit-actions are executed iff the transaction commits. The code is
based on the AdvSTM Monad [1] by Chris Kuklewicz, but in addition also
ensures
On Thu, Jan 22, 2009 at 10:11 AM, Ketil Malde ke...@malde.org wrote:
I was just wondering if not phantom types might serve here as an
alternative way to go about that. Here's a small example illustrating
it:
...
*Monoids mconcat [1,2::Foo Additive]
Foo 3
*Monoids mconcat [1,2::Foo
Hello again,
I think that I have done all of the above in different situations, and
so I don't think that there is a single correct answer. I usually
avoid using the newtype trick as I find it inconvenient: usually
the newtype does not have the same operations as the underlying type
and so
How might I go about finding out how many processors are available in a
concurrent GHC program? I have some code I'd like to parallelize, but I
don't want to spawn a separate (even lightweight) thread for each of
thousands of minor tasks.
Louis Wasserman
wasserman.lo...@gmail.com
wasserman.louis:
How might I go about finding out how many processors are available in a
concurrent GHC program? I have some code I'd like to parallelize, but I
don't want to spawn a separate (even lightweight) thread for each of
thousands of minor tasks.
Louis Wasserman
2009/1/22 Louis Wasserman wasserman.lo...@gmail.com:
How might I go about finding out how many processors are available in a
concurrent GHC program? I have some code I'd like to parallelize, but I
don't want to spawn a separate (even lightweight) thread for each of
thousands of minor tasks.
It's too bad Visual Haskell was not continued, since a free version of the
Visual Studio platform is available now.
I felt Visual Haskell was very promising, like on the fly type inference
with tool tips, code completion, built in Cabal support, etc...
On Thu, Jan 22, 2009 at 6:50 PM, John A. De
In C, if you try to alloca too much memory, then the stack gets
overwritten and bad things happen. Does GHC exhibit the same behavior
with allocaArray and the like? Is there a way to find out how much is
safe to allocate?
Thanks in advance for the help,
Patrick
Hello Patrick,
Friday, January 23, 2009, 1:22:21 AM, you wrote:
In C, if you try to alloca too much memory, then the stack gets
overwritten and bad things happen. Does GHC exhibit the same behavior
with allocaArray and the like? Is there a way to find out how much is
safe to allocate?
On Tue, 2009-01-20 at 10:22 +, Gracjan Polak wrote:
Same here:
Vista, GHC 6.8.3
Tested a bit changed scenario: instead of 20 separate compilations it is
worthwhile to run single, longer build, e.g. ghc --make of same package.
Seems like GHCi does not run garbage collection when
Hi Tom,
What is an example of some software in Hackage that reads/writes things
like integers to persistent store ... i.e. where endian-ness is an issue?
Regards, Vasili
On Thu, Jan 22, 2009 at 7:24 AM, Thomas DuBuisson
thomas.dubuis...@gmail.com wrote:
Sure, I've had to deal with this
2009/1/22 Louis Wasserman wasserman.lo...@gmail.com
How might I go about finding out how many processors are available in a
concurrent GHC program? I have some code I'd like to parallelize, but I
don't want to spawn a separate (even lightweight) thread for each of
thousands of minor tasks.
Luke Palmer lrpal...@gmail.com wrote:
On Thu, Jan 22, 2009 at 9:04 AM, Ertugrul Soeylemez e...@ertes.de wrote:
Sometimes this is inevitable, but I've never seen a case, where
IORefs couldn't be replaced by a more elegant State/StateT-based
solution. And if you need to do multi-threading,
Hmm, strange. This doesn't appear to fix my problem. Perhaps I have
something bigger broken locally :(
On Thu, Jan 22, 2009 at 12:44 PM, Peter Verswyvelen bugf...@gmail.comwrote:
indeed, that works! the comment above those lines is:
;; Not sure if it's useful/needed and if it actually works.
After emacs started your GHCi session, when you manually type
:cd the full path of the directory of your Main.hs
:load Main.hs
Does it work then?
Can you use GHCi from outside Emacs?
On Fri, Jan 23, 2009 at 1:09 AM, Andrew Wagner wagner.and...@gmail.comwrote:
Hmm, strange. This doesn't
Jonathan Cast wrote:
On Mon, 2009-01-19 at 21:04 +, Andrew Coppin wrote:
I mean, heck, *I* use Haskell at work - and I'm not even supposed to be
coding things!
/me feels slightly relieved, if you'll forgive my saying so :)
Damn... I didn't think I was *that* bad at using
Paul Johnson wrote:
So next time I hear the you can't get the programmers line I'm going
to respond with something like this:
If you post an advert for a Haskell developer you will get 20
applicants. All of those people will be the kind of developer who
learns new programming
Jim Burton wrote:
Parallelism! Something based on dons' blog
http://cgi.cse.unsw.edu.au/~dons/blog/2007/11/29#smoking-4core will be a
good start.
+3
Ever tried to do anything like this in Java?
Even Smalltalk makes it relatively hard compared to Haskell's
parallelism primitives. (I do
On Tue, 2009-01-20 at 21:01 +, Andrew Coppin wrote:
Paul Johnson wrote:
So next time I hear the you can't get the programmers line I'm going
to respond with something like this:
If you post an advert for a Haskell developer you will get 20
applicants. All of those people
On Tue, 2009-01-20 at 19:14 +, Andrew Coppin wrote:
Jonathan Cast wrote:
On Mon, 2009-01-19 at 21:04 +, Andrew Coppin wrote:
I mean, heck, *I* use Haskell at work - and I'm not even supposed to be
coding things!
/me feels slightly relieved, if you'll forgive my saying so :)
That's..evil
On Thu, Jan 22, 2009 at 7:56 PM, Jonathan Cast jonathancc...@fastmail.fmwrote:
On Tue, 2009-01-20 at 21:01 +, Andrew Coppin wrote:
Paul Johnson wrote:
So next time I hear the you can't get the programmers line I'm going
to respond with something like this:
Hello,
A while back, we had a discussion on #haskell about assembling a
Haskell benchmark suite, that is suitable for doing performance tests.
A preliminary page was erected athttp://www.haskell.org/haskellwiki/HaBench
. In the meantime, Donald Steward extended the original nofib suite
On Thu, 2009-01-22 at 20:02 -0500, Andrew Wagner wrote:
That's..evil
I know. I'm evil too, though. So it's cool.
jcc
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On Fri, Jan 23, 2009 at 11:56 AM, Jonathan Cast
jonathancc...@fastmail.fm wrote:
Not really. My company *advertises* for Haskell developers, and then
when they come in to interview, informs them that the code base is
actually written in Perl. Works, too --- we have several Haskellers
Hello,
Real World Haskell seems to say that the abstraction layer HDBC
doesn't support MySQL. If so, in what sense doesn't HDBC support
MySQL??
Thanks, Vasili
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Duncan Coutts wrote:
Does the same happen with 6.10 ?
Yes. In 6.10.1 also leak.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
I am trying to figure out if there is a way to model cloud computing
computations in Haskell.
My specific problems is that in cloud computing, as in Amazon
WebServices, side effects (writes to storage, simple database, queue)
follow the eventually consistent model. Which means even if your
Thanks Alex,
contacting the maintainer of a package rather than author is probably
the best course of action in general. They may both be out of date,
but the former maybe less so. :)
As verified offline, you issue this request via sendHTTP when experiencing
this misbehavior.
A couple of
65 matches
Mail list logo