code duplication
Changaco opened this issue · comments
The code of this package is very redundant, I suggest using CPP to refactor it, like this: Changaco/vault@master...factorize
Any thoughts on this ? Should I create a pull request ?
I finally found the time to take a look. I'm not entirely sure about it.
- I like to use GHCi from my editor, but this doesn't work well with the CPP magic. I can use ghci from the command line if I remember to use the -XCPP flag. I think that's ok.
- Haddock works fine, that's important.
- The type signatures in Data.Vault.* are now a copy of the signature for Data.Vault.ST.*. However, the intention was that the API in the IO monad should not involve the extra parameter
s
at all, so some type signatures just have to be duplicated. It's a bit like howIORef
duplicatesSTRef
. - There was an issue with
unlock
having an extraneous type signature in IORef.hs
I haven't quite made up my mind yet, but if 3 and 4 are fixed, I think I might be willing to accept the changes.