I apologize for the delay. Here are three patches.
The first one deals with this issue: "GHC was recently changed to not allow you to use newtypes in FFI imports unless the constructor of the newtype is in scope." [1]
The second patch removes a redundant function and adjusts some imports. (I wrote a version of 'splitByDelimiter' that uses 'B.breakSubstring' instead of 'B.findSubstrings'. Let me know if you want to keep 'splitByDelimiter', and I'll use that version.)
The third patch removes 'TorDNSEL.System.Timeout'. There is a similar module in 'base' (see [2], for instance). In TorDNSEL, this line
(bracket (forkIO (threadDelay n >> throwDynTo pid ex))
wraps a 'Timeout' exception into 'Dynamic' [3] and raises the exception after 'n' microseconds. And this one
handleJust (\e -> dynExceptions e >>= fromDynamic >>= guard . (ex ==))
catches dynamic exceptions and compares them with the 'Timeout' exception. I think there is no need to use dynamic exceptions at all.
The latest version of 'System.Timeout' [4] is also similar but uses 'forkIOWithUnmask' [5]. It seems safer because it doesn't rely on 'MaskingState' [6] of a parent thread (also, see [7]).
There is another reason to remove 'TorDNSEL.System.Timeout': it's the only module that is not in the public domain.
If you apply the attached patches on top of the previous patchset [8], you should see some exception-related errors, which I haven't fixed yet. (Don't forget that the mentioned patches are preliminary and need additional testing.)
[1] http://ghc.haskell.org/trac/ghc/ticket/5610 [2] http://hackage.haskell.org/packages/archive/base/4.1.0.0/doc/html/src/System... [3] http://hackage.haskell.org/packages/archive/base/4.1.0.0/doc/html/Control-Ol... [4] http://hackage.haskell.org/packages/archive/base/4.6.0.1/doc/html/src/System... [5] http://hackage.haskell.org/packages/archive/base/4.6.0.1/doc/html/src/GHC-Co... [6] http://hackage.haskell.org/packages/archive/base/4.6.0.1/doc/html/src/GHC-IO... [7] http://ofps.oreilly.com/titles/9781449335946/sec_cancellation.html [8] https://lists.torproject.org/pipermail/tor-dev/2013-July/005134.html