
On Mar 15, 2010, at 12:09 PM, Jeremy Shaw wrote:
In happstack we use a really horrible trick involving template haskell where we see if the SockAddrInet6 constructor exists at compile time and conditionally compile different versions of the code that way. But it is really ugly.
Maybe a simpler code generator would be a better fit, since this task isn't really parametrized over types? I'm not familiar with cabal really -- can you drop down to bash? Can you run an arbitrary program? Or at least one in the cwd? Or at the very least, one you just built? If so, a simple bash script (or Haskell program) can emit valid Haskell to compile. It can (potentially) be as simple as concatenating your IPv6 instances/data to the end of the "default" IPv4 code.