[Haskell] ANNOUNCE: concurrent-hashtable - a thread-safe hash table for multicores

2019-10-25 Thread Peter Robinson
https://hackage.haskell.org/package/concurrent-hashtable

This package implements a thread-safe (linearizable) hash table. The goal
is to keep the synchronization overhead as low as possible by using
fine-grained STM transactions. Lookups are non-blocking and are guaranteed
to perform only two readTVarIO operations.

The benchmarks show that this data structure is significantly faster than
placing a pure data structure (like Data.IntMap) into a TVar or MVar.

Benchmark results and more information can be found here:
https://lowerbound.io/blog/2019-10-24_concurrent_hash_table_performance.html
___
Haskell mailing list
Haskell@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell


[Haskell] ANN: stm-io-hooks-0.6.0

2009-12-27 Thread Peter Robinson
A new announcement, as the interface has changed quite a bit (e.g. 'onRetry' is
gone) and previous versions had a rare but annoying bug due to the
unpredictability of 'unsafeIOToSTM'.

>From the package description:
-

This library provides an STM monad with commit and retry IO hooks. A
retry-action is run (at least once) if the transaction retries, while
commit-actions are executed iff the transaction commits. The AdvSTM
monad also gives some atomicity guarantees for commit-actions:

* When a TVar is modified in a transaction and this transaction
commits, the update remains invisible to other threads until the
corresponding onCommit action is run.

* If the onCommit action throws an exception, the original values of
the modified TVars are restored.

Note: This library was inspired by the AdvSTM monad on the Haskell
Wiki (see http://haskell.org/haskellwiki/?title=New_monads/MonadAdvSTM).

Feedback is welcome!

-
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] ANN: persistent-map-0.0.0

2009-04-19 Thread Peter Robinson
The persistent-map package [1] provides a thread-safe (STM) frontend
for finite map types together with a backend interface for persistent
storage. The TMap data type is thread-safe, since all access functions
run inside an STM monad . Any type that is an instance of
Data.Edison.Assoc.FiniteMapX (see EdisonAPI) can be used as a map
type.

If a TMap is modified within an STM transaction, a corresponding
backend IO-request is added using the onCommit hook (cf. stm-io-hooks
package). To ensure consistency, the (Adv)STM monad runs these
requests iff the transaction commits. Additional backends (e.g. HDBC)
can be added by instantiating class Backend.

Cheers,
Peter

[1] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/persistent-map
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Monadic Loops

2004-06-17 Thread Peter Robinson
On Thursday 17 June 2004 12:39, Johannes Waldmann wrote:
> > while test body = do
> >   (cond,res) <- body
> >   if (test cond) then do rs <- while test body
> >   return (res:rs)
> >   else return [res]
>
> do you need the monad here? what monad is it?
>
> the problem could to be that the "return $ res: rs"
> can happen only after it is certain
> that  "while test body" succeeds.
> so you won't even see the very first cons cell
> before the last one is evaluated.
See also 
http://haskell.org/hawiki/TailRecursive

>
> could you produce a (lazy) list of results instead?
> the garbage collector might be able to collect
> the list cells that are no longer needed
>
> possibly, a lazy state monad would help
> (if the computation of "while test body" cannot fail)
>
> > Is there a better way to implement (possibly infinite) loops in Haskell?
You could have a look at "Tackling the awkward squad: monadic input/output, 
concurrency, exceptions, and foreign-language calls in Haskell" (Simon Peyton 
Jones)
http://research.microsoft.com/users/simonpj/papers/marktoberdorf/
where quite a few "control structures" are described. 
Cheers,
Peter
>
> generally, don't program your own recursions -
> use pre-defined combinators instead.
> (I like to think of this as a "higher analogon"
> of "don't use goto - use block structures" from imperative programming)
>
> if you need monads, have a look at sequence, sequence_, mapM, mapM_
> http://www.haskell.org/onlinereport/monad.html
> if you can do with lists, then use iterate, fold etc.
> http://www.haskell.org/onlinereport/list.html
>
> best regards,
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] KDevelop & Haskell

2004-02-15 Thread Peter Robinson
On Monday 09 February 2004 16:19, Gour wrote:
> >
> > Well the plugin _is_ included in the 3.0 release
> > (libkdevhaskellsupport.*) but it is deactivated due to stability reasons.
>
> How it can be activated?
It can be activated by modifying a few Makefiles but i wouldn't try it at the 
moment since this version is _very_ obsolete and broken. As soon as there is 
a working patch i'll let you know. 

> Any idea if it would be possible to use HaRe refactorer with KVim
> embedded in KDevelop?
I'm not familiar with HaRe but after reading that it can be accessed from Vim 
or Emacs i suppose this can be done by implementing a plugin.

>
> Sincerely,
> Gour
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] KDevelop & Haskell

2004-02-08 Thread Peter Robinson
On Saturday 07 February 2004 20:46, Gour wrote:

> When asked on KDevelop forum, I got the reply that Haskell plugin is not in
> active development, but it looks like you are still behind it, isn't it?
The last update was made in September and I didn't have much time to work on 
it since then but I expect to have a working updated version at the latest by 
the end of February, it isn't really much work. 

> When tried KDevelop rc1, I got the error that "language plugin is not
> found" and on KDevelop forum it is stated that it won't/isn't included in
> final release.
Well the plugin _is_ included in the 3.0 release (libkdevhaskellsupport.*) but 
it is deactivated due to stability reasons. 

> So, can we expect new features in KDevelop's Haskell support?
You can expect the basic support working pretty soon more advanced features 
might take a little longer, any help is welcome.

regards,
Peter


>
> Sincerely,
> Gour
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] KDevelop & Haskell

2004-02-06 Thread Peter Robinson
Hi,
my intention when writing the Haskell Plugin for KDevelop was mainly to 
increase the language's publicity, since KDevelop 3.0 is the most popular and 
mature IDE for Linux/Unix. 
I know that most of you prefer to use your favourite editor but the real 
audience are the C/C++/Java/Php/Python/SQL/... programmers who probably 
haven't heard much about Haskell yet and would like to give it a try. 

Things like a background parser that checks the syntax continuously can be 
implemented quite straightforward in KDevelop as soon as i've got a working 
C++ parser for Haskell. Syntax highlighting is provided by the Kate Plugin.

A better integration of Hugs or GHCi is possible (via plugins). At the moment 
only the GHC  plugin that allows the user to build and run the files in the 
project is implemented.

regards,
Peter

- Original Message ---
From: Gour 
Subject: Re: [Haskell] KDevelop & Haskell 
Date: Tue, 27 Jan 2004 02:26:43 -0800 
Claus Reinke ([EMAIL PROTECTED]) wrote:

> that's why it would be nice if the supported Haskell implementations
> we have would also offer the necessary API on top of which such
> enhanced IDE functionality could be implemented in everyone's
> editors of choice.

>  
> >> But I saw that haskell is in the the table of supported languages.
> >
> >yes, and it is nice to see it advertised this way, but I just checked,
> >and the support seems to be in its very early stages:
>

>But, it's better than nothing :-)

> 
> >it won't do everything (unless you do a little programming, or we get
>> those APIs I keep mumbling about), but it will do a lot. 

>>Do you have some pointer for discussion(s) about these APIs you're mumbling
>>about?

>> set your editor as specified, start Hugs, type ":find foldl", enjoy.
>> for extra marks, make your editor call out to Hugs, load the current
>> module, and :find the identifier under the cursor. (or were you 
>> suggesting that most Hugs users are already aware of this
>> feature and use it every day?)

>At the moment (6th ch. of Thompson's Craft of FP) I'm still with Helium :-)
>but otherwise I was/am using ghc to compile e.g. darcs and other Haskell 
>stuff.

> > This one is nice. Thank you.
> 
> why, thank you!-)

>At the moment I'm compiling HaRE under MSYS/MinGW environment. Where can I 
>report back?

> >Have you (maybe) tried KDevelop with kvim?
> 
> no, I was thinking of the recent Haskell-in-Haskell frontends, and
> of Simon M's work on providing an API for ghc to support a
> visual studio binding. The frontends, or the API once it has evolved,
> are just what one needs to provide programmers editors with
> Haskell-awareness.
> 
> http://www.haskell.org/communities/11-2003/html/report.html#sect5.2.3.1
> http://www.haskell.org/communities/11-2003/html/report.html#sect5.3.3
> http://www.haskell.org/communities/11-2003/html/report.html#sect6.5.5

Wow! It looks great. I definitely have to find out some more time in pursuing
my learning of Haskell, since there is interesting development going on.

(recently I've found few posts on Ruby list with the complain that "but
ultimately lost interest because the discussions focused on a /much/ higher
level than they do here on the Ruby list--arguments over language design, 
etc.,
with few mentions of using Haskell to do anything productive.", so I hope that
something like Programatica Project can drastically change the situation and
bring Haskell more tho the mainstream (despite the fact if this is the 
intention of the whole project :-)

Thank you for enlighetning me about Programmatica.

Sincerely,
Gour
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell