On Tue, Nov 09, 2004 at 11:41:49PM +, Jorge Adriano Aires wrote:
Hello,
A hash-table becomes rather useless without mutable state AFAICS.
Without it, one might almost just as well use a list of pairs...
Could you please elaborate? Is there motive why an Hash Table, implemented as
Hi there,
In XSLT there is an XPath function that will let you select a
particular node in the current context, for example;
xsl:value-of select=team[1] /
in Michael Kay's article
http://www-106.ibm.com/developerworks/xml/library/x-xslt/?article=xr
This selects the first team element in the
On 09 November 2004 11:54, Graham Klyne wrote:
I've not been following the Global variables debate too closely, it
seeming to have something of a religious wars flavour, but I noticed
that an example being proposed was how to achieve a one shot
execution. Here's something I did when working
Tom Spencer [EMAIL PROTECTED] writes:
In XSLT there is an XPath function that will let you select a
particular node in the current context, for example;
xsl:value-of select=team[1] /
This selects the first team element in the current context. Is there a
work around to get similar
Hi,
This may be silly, but I tried to code a simmulated annealing method
to solve the travelling salesman prblem, by adapting the algorithm
described in Numerical Recipes in C.
Doesn't seem silly so far! :-)
The problem is that there are
so many iterations, that the program gets killed
I have written a small library for supporting one-shot without using
unsfePerformIO...
The library uses SYSV semaphores under linux to make sure the functional
argument of
once is only ever run once. It uses the ProcessID as the key for the
semaphore, so will
even enforce the once-only property
Keith Wansbrough wrote:
The problem is that there are
so many iterations, that the program gets killed (kill -9) by the
system.
I'm not sure what you mean here - I've never encountered a system that
kills processes with -9, other than at shutdown time. Are you sure
it's -9?
If a
What about the following? It does use unsafePerformIO, but only to
wrap newMVar in this
specific case.
once :: Typeable a = IO a - IO a
once m = let {-# NOINLINE r #-}
r = unsafePerformIO (newMVar Nothing)
in do
y - takeMVar r
x - case y of
Hello,
Concurrency in Haskell (technically GHC) is much like concurrency in
other languages,
in that you fork off threads and do stuff with them, etc.
I think you are perhaps thinking of another kind of concurrency, where
different redexes in
a term are evaluted simultaneously? Here is an
OK, I'll play again..
On Wednesday 10 Nov 2004 4:39 pm, Judah Jacobson wrote:
What about the following? It does use unsafePerformIO, but only to
wrap newMVar in this
specific case.
once :: Typeable a = IO a - IO a
once m = let {-# NOINLINE r #-}
r = unsafePerformIO (newMVar
Adrian Hey wrote:
Suppose I had..
myOtherRef :: IO (IORef Char)
myOtherRef = once (newIORef 'a')
There's nothing to stop the compiler doing CSE and producing, in effect..
commonRef :: IO (IORef Char)
commonRef = once (newIORef 'a')
.. followed by substitution of all occurrences of myRef and
Right in time, I am pleased to announce -- on behalf of the many
contributers -- that the
Haskell Communities and Activities Report
(7th edition, November 2004)
http://www.haskell.org/communities/
is now available from the Haskell
Ugh, replying to myself...
Obviously, the following contains a few mistakes...:
On Wed, Nov 10, 2004 at 11:34:32AM +0100, R. Turk wrote:
{-# OPTIONS -fglasgow-exts #-}
{- I want a Hashable instance for String ;) -}
import Data.FiniteMap
import Data.HashTable (hashInt, hashString)
import
Hi,
Here's another completely safe (and simpler way) to limit
a computation to only happen once:
once' :: IO () - IO ()
once' f = do
k - getProcessID
a - getEnv (showString MyApp.Main $ show k)
case a of
Just _ - return ()
_ - do
f
On Tue, Nov 09, 2004 at 11:41:49PM +, Jorge Adriano Aires wrote:
Hello,
A hash-table becomes rather useless without mutable state AFAICS.
Without it, one might almost just as well use a list of pairs...
Could you please elaborate? Is there motive why an Hash Table, implemented as
15 matches
Mail list logo