Comments (6)
Apparently, the underlying problem is that vault exports two slightly different APIs, one that includes the Hashable
instance (when the UseGHC
flag is set) and one that does not include the instance (when the UseGHC
flag is not set). Reactive-banana assumes that the instance is always there, and hence fails for some configurations of vault, which is clearly a defect on my part.
One thing I don't understand is why the vault package was being without hashable
in the first place. My intention was that the UseGHC
flag is not optional when compiling with GHC. (The reason for that is that the default Data.Unique
doesn't work correctly in GHCi, so I had to supply my own Data.Unique.Really
.) It seems that cabal decides this on a whim, namely sets the flag to false when the dependencies cannot be satisfied with the currently installed packages.
(The whole UseGHC
flag story is actually only because I wanted to compile reactive-banana to JavaScript using the haste compiler and the hashable packages used too many GHC tricks. I got things to compile at some point, but unfortunately, it seems that the JS output is subtly incorrect and reactive-banana doesn't work. Then again, the library is using unsafePerformIO
for observable sharing and thus tests the boundaries of legal Haskell, so small errors in the compiler tend to crash the banana party big time.)
from vault.
Your comment about cabal is exactly my point: it seems cabal ignores that I am indeed using GHC and silently unsets the flag.
I think you are not alone with this: many packages on hackage create subtle conditional dependencies, and it is increasingly difficult to manually resolve package dependencies as I did (the text
-dependency of hashable
is just another example).
The clean thing here would be to create a single API, but I fully understand why you went the other way.
If you want to keep the 2-API package, I suggest that vault issue a big warning (using CPP) during the build to let the user know that the API is incomplete (in case UseGHC
is unset). Then again, is there any chance for reactive-banana to build (with the reduced vault API) when using a Haskell compiler different from GHC? It depends on hashable
directly and via vault right now, and probably uses unsafePerformIO
"the GHC way".
from vault.
Ok, I changed reactive-banana to not make use of the Hashable
instance for Unique
. Thanks again for the report, @jberthold !
Concerning the vault package, it's probably a good idea to remove the UseGHC
flag altogether. I'm hesitant to do it right now, though, because the vault-0.3.0.0 branch still needs some polish. I'll just leave this open until the next release if nobody minds.
from vault.
IMO, you shouldn't keep the UseGHC stuff around for Haste; if the GHC version doesn't work then that's a problem with Haste that I should be fixing (at least as long as you're not using black pointer arithmethic primop magic); working around it just gives me an incentive to be lazy. :)
from vault.
Well, it can be useful for other compilers like EHC as well, for which a JavaScript backend exists as well.
Concerning Haste, there is still issue 25 whose resolution would be very beneficial for me. ;-)
from vault.
Removed the 'UseGHC' flag entirely and added a dependency on 'hashable'. Haste has hopefully advanced enough for this to be viable.
from vault.
Related Issues (15)
- code duplication HOT 3
- Vault fails to install with Cabal 1.18.0.1 HOT 4
- Invalid link in haddock on hackage HOT 2
- Is vault thread-safe? HOT 2
- Export either Vault.Lazy or Vault.Strict as Vault, again HOT 3
- Allow GHC 8.0 HOT 2
- release a new version on hackage (or make a hackage revision) to support hashable-1.3.0.0 HOT 11
- Travis integration is broken HOT 2
- Support GHC-9.6 HOT 1
- GHC 9.8 compat HOT 2
- GHC 9.10 compat HOT 1
- hashable-1.5 not accepted HOT 5
- Variant that uses no GHC-specific extensions / functions HOT 7
- Control.Monad.ST.Unsafe not found HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vault.