[Haskell-cafe] ANNOUNCE: timeout-with-results

Petr P petr.mvd at gmail.com
Sat Dec 15 19:32:43 CET 2012


A small library that extends System.Timeout.timeout. It adds the
possibility of
saving partial results. Useful for AI-like algorithms that should return the
best result found within a time limit.

It comes in two variants:

(1) Simple, which only allows computations to save partial results, not
retrieve what has been written already. If a computation times out, the last
saved partial result is returned. It comes in two flavours: One that
converts
saved values to WHNF, the other to NF. (This is required so that the
producing
thread performs the computations, not the consuming thread.)

(2) Based on MonadWriter. The types of partial results have to be monoids.
Saving a partial result combines it with the saved value using `mappend`. It
also adds the ability to run a contained computation within another one,
without disturbing its output.

See https://github.com/ppetr/timeout-with-results#examples for examples.

Repo:    https://github.com/ppetr/timeout-with-results
Hackage: http://hackage.haskell.org/package/timeout-with-results

(I apologize for not being able to come up with a better package/module
names.
Suggestions welcomed.)

Petr Pudlak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20121215/8e45f16b/attachment.htm>


More information about the Haskell-Cafe mailing list