On Tue, Feb 24, 2009 at 2:43 AM, Jean-Philippe Bernardy
<jeanphilippe.berna...@gmail.com> wrote:
>
> On Tue, Feb 24, 2009 at 5:00 AM, Gwern Branwen <gwe...@gmail.com> wrote:
>
>> After a fair bit of hacking, that turned out to be a workable
>> solution. I just stored ArticleDB in it (don't need anything else).
>> Had a bit of trouble working out the monads and was shortly flummoxed
>> by the Initializable stuff
>
>>(until I realized that that typeclass was
>> how the case of no-defined-variable was handled, by calling the
>> 'initial' function)
>
> It would help if you documented the parts that were opaque to you;
> a patch with haddock comments would be great.

I'll see if I can do some documenting this week. It's not all that
clear where the Haddocks would go, though - one can't really use the
Buffer.Misc functions without putA/getA, and I'm not really sure what
they do without those functions. Do I put the comment about what
Initializable means by the typeclass or somewhere else?

>> But the initial load is still several seconds. How would Data.Binary
>> help there? Is it intended to be a faster version of '(read $ readFile
>> foo) :: ArticleDB)'?
>
> Yep.
>
> Cheers,
> -- JP.

I've been looking, and it looks like that might work. At least,
Data.Binary claims
http://hackage.haskell.org/packages/archive/binary/0.5/doc/html/Data-Binary.html
to have a 'Binary e => Binary (Seq e)', and I'm sure there's an
instance for String/[Char]. I wonder whether binary-strict might not
be better though?

-- 
gwern

--~--~---------~--~----~------------~-------~--~----~
Yi development mailing list
yi-devel@googlegroups.com
http://groups.google.com/group/yi-devel
-~----------~----~----~----~------~----~------~--~---

Reply via email to