Re: static constants -- ideas?

2008-03-03 Thread Don Stewart
jason.dusek: I have an awkward programming problem -- I need to take a dictionary, parse it, build a bunch of intermediate lists and then make maps and tries out of the list. A programming problem because it's taken me a fair amount of effort to pull together the parser and list

Re: static constants -- ideas?

2008-03-01 Thread Jay Scott
Jason Dusek [EMAIL PROTECTED]: Bryan O'Sullivan [EMAIL PROTECTED] wrote: The trick I usually use in cases like this is to compile the data as C code and link against it, then access it from Haskell via a Ptr. For my particular application, I really need to ship a single static binary that

Re: static constants -- ideas?

2008-03-01 Thread Jason Dusek
On Sat, Mar 1, 2008 at 12:24 PM, Jay Scott [EMAIL PROTECTED] wrote: Jason Dusek [EMAIL PROTECTED]: unsafePerformIO should be safe on constants, right? It has worked for me, at least. Unfortunately, reading in the list does not allow me to ship a single binary. It's not file reading,

Re: static constants -- ideas?

2008-03-01 Thread Jason Dusek
Simon Peyton-Jones [EMAIL PROTECTED] wrote: It's not quite as stupid as it sounds...have another go when you see that #2002 is fixed. Thanks for pointing me to that -- in the meantime, I'd still rather write C and Haskell than plain C++! -- _jsn

Re: static constants -- ideas?

2008-02-29 Thread Don Stewart
jay: Don Stewart [EMAIL PROTECTED]: jay: Don Stewart [EMAIL PROTECTED]: jay: I also have constants that are too large to compile. I am resigned to loading them from data files--other solutions seem even worse. ... Data.Binary eases the irritation somewhat. Did you try

Re: static constants -- ideas?

2008-02-29 Thread Jay Scott
Don Stewart [EMAIL PROTECTED]: jay: Don Stewart [EMAIL PROTECTED]: jay: I also have constants that are too large to compile. I am resigned to loading them from data files--other solutions seem even worse. ... Data.Binary eases the irritation somewhat. Did you try bytestring literals

Re: static constants -- ideas?

2008-02-29 Thread Jay Scott
Don Stewart [EMAIL PROTECTED]: jay: Don Stewart [EMAIL PROTECTED]: jay: I also have constants that are too large to compile. I am resigned to loading them from data files--other solutions seem even worse. ... Data.Binary eases the irritation somewhat. Did you try bytestring literals

Re: static constants -- ideas?

2008-02-29 Thread Jay Scott
Don Stewart [EMAIL PROTECTED]: jay: Don Stewart [EMAIL PROTECTED]: jay: Don Stewart [EMAIL PROTECTED]: jay: I also have constants that are too large to compile. I am resigned to loading them from data files--other solutions seem even worse. ... Data.Binary eases the irritation

Re: static constants -- ideas?

2008-02-29 Thread Don Stewart
jay: Don Stewart [EMAIL PROTECTED]: jay: Don Stewart [EMAIL PROTECTED]: jay: Don Stewart [EMAIL PROTECTED]: jay: I also have constants that are too large to compile. I am resigned to loading them from data files--other solutions seem even worse. ... Data.Binary eases

Re: static constants -- ideas?

2008-02-29 Thread Jason Dusek
Bryan O'Sullivan [EMAIL PROTECTED] wrote: The trick I usually use in cases like this is to compile the data as C code and link against it, then access it from Haskell via a Ptr. For my particular application, I really need to ship a single static binary that has it all -- data as well as

Re: static constants -- ideas?

2008-02-25 Thread Chris Kuklewicz
Is it _possible_ to use Template Haskell to take the name of the external binary file and produce such a bytestring literal? ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org

RE: static constants -- ideas?

2008-02-25 Thread Simon Peyton-Jones
| On another note, I am extremely curious about the difference | between statically compiling a list and building it at | runtime. I find it hard to wrap my head around the fact that I | can build the list at runtime in a short time, but can not | compile it without eating all of my

Re: static constants -- ideas?

2008-02-24 Thread Don Stewart
jason.dusek: I have an awkward programming problem -- I need to take a dictionary, parse it, build a bunch of intermediate lists and then make maps and tries out of the list. A programming problem because it's taken me a fair amount of effort to pull together the parser and list

Re: static constants -- ideas?

2008-02-24 Thread Jason Dusek
Don Stewart [EMAIL PROTECTED] wrote: You can build large constant bytestrings, fwiw. They turn into an Addr#, and GHC will leave them alone. Well, for my particular problem -- I guess I could align all the elements of the lists, and then build the trie and maps from the ByteStrings at

Re: static constants -- ideas?

2008-02-24 Thread Don Stewart
jason.dusek: Don Stewart [EMAIL PROTECTED] wrote: You can build large constant bytestrings, fwiw. They turn into an Addr#, and GHC will leave them alone. Well, for my particular problem -- I guess I could align all the elements of the lists, and then build the trie and maps from

Re: static constants -- ideas?

2008-02-24 Thread Jay Scott
Jason Dusek [EMAIL PROTECTED]: I have an awkward programming problem -- I need to take a dictionary, parse it, build a bunch of intermediate lists and then make maps and tries out of the list. A programming problem because it's taken me a fair amount of effort to pull together the parser

Re: static constants -- ideas?

2008-02-24 Thread Don Stewart
jay: Jason Dusek [EMAIL PROTECTED]: I have an awkward programming problem -- I need to take a dictionary, parse it, build a bunch of intermediate lists and then make maps and tries out of the list. A programming problem because it's taken me a fair amount of effort to pull together

Re: static constants -- ideas?

2008-02-24 Thread Jay Scott
Don Stewart [EMAIL PROTECTED]: jay: I also have constants that are too large to compile. I am resigned to loading them from data files--other solutions seem even worse. ... Data.Binary eases the irritation somewhat. Did you try bytestring literals (and maybe parsing them in-memory with

Re: static constants -- ideas?

2008-02-24 Thread Bryan O'Sullivan
Jay Scott wrote: That didn't occur to me, since neither of my large constants includes strings The trick I usually use in cases like this is to compile the data as C code and link against it, then access it from Haskell via a Ptr. b ___

Re: static constants -- ideas?

2008-02-24 Thread Don Stewart
jay: Don Stewart [EMAIL PROTECTED]: jay: I also have constants that are too large to compile. I am resigned to loading them from data files--other solutions seem even worse. ... Data.Binary eases the irritation somewhat. Did you try bytestring literals (and maybe parsing them in-memory

static constants -- ideas?

2008-02-23 Thread Jason Dusek
I have an awkward programming problem -- I need to take a dictionary, parse it, build a bunch of intermediate lists and then make maps and tries out of the list. A programming problem because it's taken me a fair amount of effort to pull together the parser and list generator -- and