<p dir="ltr">It can't be done. Instances of Storable need to have a fixed serialized size, and Text values don't.</p>
<br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 24, 2016, 8:21 PM Cody Goodman <<a href="mailto:codygman.consulting@gmail.com">codygman.consulting@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg">Any ideas on how I'd write this instance? I know for it to be storable it needs a size, couldn't I just get the length of the text? Has anyone did anything similar?<br class="gmail_msg"><br class="gmail_msg"></div>I ran into a surprise when trying to use storable-record and derive-storable and tried using them with a record that contained a Text field.<br class="gmail_msg"><br class="gmail_msg"></div>My end goal is having a vector of records that could contain Text, UTCTime, or other similarly complex types which I can write as an mmap to disk and then read back to the original format.<br class="gmail_msg"><br class="gmail_msg"></div>Thanks!<br class="gmail_msg"></div>
_______________________________________________<br class="gmail_msg">
Haskell-Cafe mailing list<br class="gmail_msg">
To (un)subscribe, modify options or view archives go to:<br class="gmail_msg">
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" class="gmail_msg" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br class="gmail_msg">
Only members subscribed via the mailman list are allowed to post.</blockquote></div>