On Sat, Jan 23, 2010 at 7:57 AM, Neil Mitchell <span dir="ltr">&lt;<a href="mailto:ndmitchell@gmail.com">ndmitchell@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">No, that&#39;s definitely not correct, or even remotely scalable as we</div>
increase the number of abstract types in disparate packages.</blockquote><div><br></div><div>Yes.. happstack is facing another aspect of this scalability issue as well. We have a class, Serialize, which is used to serialize and deserialize data. It builds on the binary library, but adds the ability to version your data types and migrate data from older versions to newer versions.</div>
<div><br></div><div>This has a serious scalability issue though, because it requires that each type a user might want to serialize has a Serialize instance.</div><div><br></div><div>So do we:</div><div><br></div><div>  1. provide Serialize instances for as many data types from libraries on hackage as we can, resulting in depending on a large number of packages that people are required to install, even though they will only use a small fraction of them.</div>
<div><br></div><div>  2. convince people that Serialize deserves the same status as Data, and then convince authors to create Serialize instances for their type? It would be nice, but authors will start complaining if they are asked to provide a zillion other instances for their types as well. And they will be annoyed if they their library has to depend on a bunch of other libraries, just so they can provide some instances that only a small fraction of their users might use. So, this method does not scale as the number of &#39;interesting&#39; classes grows. </div>
<div><br></div><div>  3. let individual users define the Serialize instances as they need them. Unfortunately, if two different library authors defined a Serialize instance for Text in their libraries, you could not use both libraries in your application because of the conflicting Serialize instances. So this method does not scale when the number of libraries using the Serialize class grows.</div>
<div><br></div><div>Not really sure what the work around is. #1 could work if there was some way to just selectively install the pieces as you need them. But the only way to do this now would be to create a lot of cabal packages which just defined a single instance -- happstack-text, happstack-map, happstack-time, happstack-etc. One for each package that has types we want to create a serialization instance for...</div>
<div><br></div><div>Any other suggestions?</div><div><br></div><div>- jeremy</div><div><br></div><div><br></div></div>