Simon Marlow wrote:
> I think the only answer to this is "litlits are deprecated". We'll
> have to make do with foreign imports to get these kind of constants.
It's not clear to me how exactly this should be accomplished via
foreign import. The (well, *my* :-) basic problem is: How do you
map about 1000 numerical #defines from C header files (OpenGL/GLUT)
efficiently to Haskell? Saving some STG state, calling out to C land,
and restoring some state for accessing every value will definitely make
my binding about 1-2 orders slower. Currently the usage of litlits
compiles into a single load instruction in machine code. *sigh*
Normally I'm not an advocate of O(1) optimizations, but in this
special case, which will happen in lots of inner loops, the situation
is different...
Cheers,
Sven
--
Sven Panne Tel.: +49/89/2178-2235
LMU, Institut fuer Informatik FAX : +49/89/2178-2211
LFE Programmier- und Modellierungssprachen Oettingenstr. 67
mailto:[EMAIL PROTECTED] D-80538 Muenchen
http://www.informatik.uni-muenchen.de/~Sven.Panne