I'm a Python programmer with experience in wxPython, and I'm learning Haskell and having a go at coding up a small GUI project in wxHaskell. One feature from wxPython that I have not yet figured out how to duplicate is PyEmbeddedImage - where images can be stored as strings inside Python modules, and then accessed from wxPython. Does this functionality exist in wxHaskell, and if so, how do you do it?

You can embed arrays of bytes with GHC's magic hash syntax. The lexer generator Alex does this. Unfortunately I couldn't find a proper description of doing this with GHC the last time I looked (i.e. whether its a genuine technique or frowned upon as a hack). If you generate an Alex lexer, looking in the resulting *.hs file will show you the syntax. Maybe someone has better knowledge on this technique?
–
stephen tetleyNov 18 '10 at 12:49