Have you considered moving these packages that are unrelated to web development into a separate namespace? I know that I never considered looking under the happstack namespace simply because I never do webapps.<br><br><div class="gmail_quote">
On Thu, Dec 16, 2010 at 5:09 PM, Jeremy Shaw <span dir="ltr">&lt;<a href="mailto:jeremy@n-heptane.com">jeremy@n-heptane.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word">Hello,<div><br></div><div>You should use happstack-data for this (you do not need the other happstack components to use happstack-data)*. It was created to solve this exact problem.</div>
<div><br></div><div>happstack-data builds on type of the &#39;binary&#39; library and adds versioned  data types and automatic version migration.</div><div><br></div><div>You can get an idea as to how it works by reading this old blog post,</div>
<div><br></div><div><a href="http://nhlab.blogspot.com/2008/12/data-migration-with-happs-data.html" target="_blank">http://nhlab.blogspot.com/2008/12/data-migration-with-happs-data.html</a></div><div><br></div><div>The modules names have changed from HAppS.* to Happstack.*, but otherwise it is still pretty accurate. The upcoming happstack 7 release cycle will be focusing on this area of happstack. Especially improved documentation. But, it is quite usable right now.</div>
<div><br></div><div>If you have questions about happstack-data, feel free to ask on the happstack mailing list or irc channel. (<a href="http://happstack.com/community" target="_blank">http://happstack.com/community</a>)</div>
<div><br></div><div>I am happy to answer any questions or concerns you may have.</div><div><br></div><div>- jeremy</div><div><br></div><div>* the version on hackage depends on happstack-util, but the darcs version does not.</div>
<div><div></div><div class="h5"><div><br><div><div>On Dec 16, 2010, at 12:26 PM, Dmitry V&#39;yal wrote:</div><br><blockquote type="cite"><div>Greetings,<br><br>while developing my neural net simulator I stumbled upon a problem.<br>
<br>I have a data type NeuralNet and use Show and Read instances for saving and loading configurations. As time passed, I changed the data type, so the program can no longer load files saved in previous versions.<br><br>I want fix it. My current idea looks as follows. I&#39;m going to create a bunch of types NN1, NN2, NN3..NNn for different versions and write converters c12 :: N1 -&gt; N2, c23 :: N2 -&gt; N3 and so on.<br>
<br>But how to organize the whole process of parsing String into NNn so it&#39;s easy to change formats?<br>Something based on using a list of parsers<br>[read, c43 . read, c43 . c23 . read, c43, c23 . c12 . read, c43 . c32 . c21 . read]<br>
<br>looks rather verbose and grows quadratically with N.<br><br>I&#39;m sure there must be a more elegant way. Any ideas?<br><br>Dmitry<br><br>_______________________________________________<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>
</div></blockquote></div><br></div></div></div></div><br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">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>