<div dir="ltr">Hi Ben,<div><br></div><div>Thanks for the reply.</div><div><br></div><div style>I am planning on using Persistent which can work without template haskell, though I am planning on using the TH on my workstation to create the boiler code parts of the database setup.</div>
<div style><br></div><div style>The part that I&#39;m having trouble with is collecting the composed functions. It may be a very typical problem but I&#39;m just lost.</div><div style><br></div><div style>Let me just describe a simple example;</div>
<div style><br></div><div style>A message comes through the FFI to:</div><div style><br></div><div style>Haskell chooses criteria to select a sequence of data from the database</div><div style>--- many functions exist to do this, some may take a random number as a parameter, the seed needs to be stored</div>
<div style>Haskell similarly chooses a process to apply to the data</div><div style>--- A random number or other deterministic chain of functions</div><div style>The results from the processing are loaded into memory - (these are not the focus here)</div>
<div style>The minimal chain of functions, parameters and seeds is stored to allow for a deterministic recall/modification</div><div style>--- The input parameters and output parameters are Table and Row ID&#39;s </div><div style>
<br></div><div style>So Haskell isn&#39;t reacting to many input events, just a trigger that may come with a few initialization parameters.</div><div style><br></div><div style>If a function is composed of other functions which do not depend on external state they should not need to be stored in the database as they are implicit.</div>
<div style><br></div><div style>I imagine this is a monad problem, but kind and what other things spring to mind that might help in approaching this kind of problem?</div><div style><br></div><div style>Thanks,</div><div style>
Casey</div><div style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 9, 2013 at 11:40 AM, Ben Doyle <span dir="ltr">&lt;<a href="mailto:benjamin.peter.doyle@gmail.com" target="_blank">benjamin.peter.doyle@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I think acid-state (<a href="http://hackage.haskell.org/package/acid-state" target="_blank">http://hackage.haskell.org/package/acid-state</a>) might do what you want, at least in broad strokes. It uses a durable transaction log to store query and update events. <div>


<br></div><div>As far as I know, the interface to the library doesn&#39;t expose an undo/rollback function, so you&#39;d have a bit of work to do to extend it to your use case. But the core functionality to make it possible should be there. </div>


<div><br></div><div>Can you use ghc extensions aside from Template Haskell? Template Haskell you can do without with acid-state, but without GADTs and so on you&#39;ll have problems.</div><div><br><div class="gmail_quote">
<div><div class="h5">

On Sun, Jan 6, 2013 at 12:01 PM, Casey Basichis <span dir="ltr">&lt;<a href="mailto:caseybasichis@gmail.com" target="_blank">caseybasichis@gmail.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="h5">

<div dir="ltr">Hi,<br clear="all"><div><br></div>I am still getting a hang of Haskell.  Sorry if the answer is obvious.<div><br></div><div>What sorts of packages and approaches should I be looking at if I was looking to store something like an Undo stack into a database.</div>



<div><br></div><div>Each table would refer to a function. </div><div>Each records input and outputs would specify both a table ID and record ID.  </div><div>The records would also have a data and a Process ID to associate all functions to a specific process and give them an order.<br>



</div><div><br></div><div>No records are ever deleted.  Rolling something back is instead a process of recreating a new, modified graph by taking the old graph from the database.</div><div><br></div><div>I should note that while I can generate some of the boiler parts from template haskell in advance I&#39;m ultimately using a stage 1 compiler with no GHCI o template haskell.</div>



<div><br></div><div>Thanks,</div><div>Casey</div><span><font color="#888888"><div><br></div>-- <br>Casey James Basichis<br>Composer - Cartoon Network<br><a href="http://www.caseyjamesbasichis.com" target="_blank">http://www.caseyjamesbasichis.com</a><br>



<a href="mailto:caseybasichis@gmail.com" target="_blank">caseybasichis@gmail.com</a><br><a href="tel:310.387.7540" value="+13103877540" target="_blank">310.387.7540</a>
</font></span></div>
<br></div></div>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Casey James Basichis<br>Composer - Cartoon Network<br><a href="http://www.caseyjamesbasichis.com" target="_blank">http://www.caseyjamesbasichis.com</a><br><a href="mailto:caseybasichis@gmail.com" target="_blank">caseybasichis@gmail.com</a><br>
310.387.7540
</div>