[Haskell] ANNOUNCE: tardis
danburton.email at gmail.com
Tue Aug 7 08:04:13 CEST 2012
I'm pleased to announce that I've uploaded the *tardis* package to hackage.
*TardisT* is a monad transformer that combines the (regular, "forwards")
with the "backwards State monad", allowing you to communicate on two
channels of state:
one is "backwards travelling" state, while the other is "forwards
Its primitives are comparable to the State monad's "get" and "put", but the
disambiguate which channel they operate on:
getPast :: Monad m => TardisT bw fw m fw
getFuture :: Monad m => TardisT bw fw m bw
sendPast :: Monad m => bw -> TardisT bw fw m ()
sendFuture :: Monad m => fw -> TardisT bw fw m ()
These primitives allow you to write some very amusing timey-wimey code,
but it only works in the presence of sufficient laziness.
If you run into an infinite loop, try adding laziness annotations
and make sure that what you are trying to do is not a time paradox.
I've provided both *transformers* and *mtl* style modules:
Control.Monad.Trans.Tardis contains the transformer,
while Control.Monad.Tardis.Class contains the MonadTardis class,
and Control.Monad.Tardis re-exports both as well as the TardisT instance
See the readme on github for more details:
As a side note, since the code base is relatively small, it can also serve
as a simple demonstration of how to use a cabal flag
in conjunction with CPP to selectively include swaths of code
(see Control/Monad/Tardis.hs and tardis.cabal).
I'm not entirely sold on the naming conventions for the package (including
the package name),
and am open to suggestions.
-- Dan Burton
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell