I&#39;m pleased to announce that I&#39;ve uploaded the <i>tardis</i> package to hackage.<br><br><a href="http://hackage.haskell.org/package/tardis-0.2.0.0">http://hackage.haskell.org/package/tardis-0.2.0.0</a><br><br><i>TardisT</i> is a monad transformer that combines the (regular, &quot;forwards&quot;) State monad<br>

with the &quot;backwards State monad&quot;, allowing you to communicate on two channels of state:<br>one is &quot;backwards travelling&quot; state, while the other is &quot;forwards travelling&quot; state.<br>Its primitives are comparable to the State monad&#39;s &quot;get&quot; and &quot;put&quot;, but the names<br>

disambiguate which channel they operate on:<br><pre><div class="line" id="LC102"><span class="nf">getPast</span> <span class="ow">   ::</span> <span class="kt">Monad</span> <span class="n">m</span> <span class="ow">=&gt;</span> <span class="kt">      TardisT</span> <span class="n">bw</span> <span class="n">fw</span> <span class="n">m</span> <span class="n">fw</span></div>

<span class="nf">getFuture</span> <span class="ow"> ::</span> <span class="kt">Monad</span> <span class="n">m</span> <span class="ow">=&gt;</span> <span class="kt">      TardisT</span> <span class="n">bw</span> <span class="n">fw</span> <span class="n">m</span> <span class="n">bw</span><span class="nf"><br>

sendPast</span> <span class="ow">  ::</span> <span class="kt">Monad</span> <span class="n">m</span> <span class="ow">=&gt;</span> <span class="n">bw</span> <span class="ow">-&gt;</span> <span class="kt">TardisT</span> <span class="n">bw</span> <span class="n">fw</span> <span class="n">m</span> <span class="nb">()</span><span class="nf"><br>

sendFuture</span> <span class="ow">::</span> <span class="kt">Monad</span> <span class="n">m</span> <span class="ow">=&gt;</span> <span class="n">fw</span> <span class="ow">-&gt;</span> <span class="kt">TardisT</span> <span class="n">bw</span> <span class="n">fw</span> <span class="n">m</span> <span class="nb">()</span><br>

</pre>These primitives allow you to write some very amusing timey-wimey code,<br>but it only works in the presence of sufficient laziness.<br>If you run into an infinite loop, try adding laziness annotations everywhere,<br>

and make sure that what you are trying to do is not a time paradox.<br><br>I&#39;ve provided both <i>transformers</i> and <i>mtl</i> style modules:<br>Control.Monad.Trans.Tardis contains the transformer,<br>while Control.Monad.Tardis.Class contains the MonadTardis class,<br>

and Control.Monad.Tardis re-exports both as well as the TardisT instance<br>for MonadTardis.<br><br>See the readme on github for more details:<br><br><a href="https://github.com/DanBurton/tardis#readme">https://github.com/DanBurton/tardis#readme</a><br>

<br>As a side note, since the code base is relatively small, it can also serve<br>as a simple demonstration of how to use a cabal flag<br>in conjunction with CPP to selectively include swaths of code<br>(see Control/Monad/Tardis.hs and tardis.cabal).<br>

<br>I&#39;m not entirely sold on the naming conventions for the package (including the package name),<br>and am open to suggestions.<br><br clear="all">-- Dan Burton<br>