Hi, Am Montag, den 02.08.2010, 12:38 -0700 schrieb John MacFarlane: > > Did you consider a third variant: Actually linking the hook into your > > code, as a (Byte)String constant, and writing it out to disk when > > creating a gitit-enabled repository? Then there is no such problem at > > all, and the hook is always tied directly to the code. (Probably does > > not work as you’d need to update the hook when you upgrade the code, > > right?) > > In the case of filestore, I could do that. I used to do something like that > for pandoc, but switched for various reasons to using data files. As you > note, it's a maintenance hassle if the bytestring is just a literal in the > code. I could avoid this by using template haskell, but that introduces its > own headaches (recall the difficulties TH caused on some architectures with > earlier versions of pandoc). I could also avoid it without template Haskell, > possibly, with a custom Setup.hs that reads the data file and writes out a > Haskell file. But now we're getting farther and farther from the nice, clean > mechanism for data files that Cabal provides. slightly diverging from the original question: Couldn’t Cabal directly provides support for this? It automatically detects files like ".y". It could convert a file ending in ".blob" to a haskell file containing the data as a raw bytestring, or even convert it directly to a .o file with a corresponding FFI wrapper that can be linked into the libraries. I’m sure there are a few use cases. E.g. icons for executables on windows, or binaries which contain the manpage as the documentation source. Greetings, Joachim -- Joachim "nomeata" Breitner Debian Developer nomeata@debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C JID: nomeata@joachim-breitner.de | http://people.debian.org/~nomeata
Attachment:
signature.asc
Description: This is a digitally signed message part