Open silky opened 5 years ago
i "fixed" it with two terrible hacks:
i manually set the path to hsc2hs in my path: export PATH=/home/noon/.stack/programs/x86_64-linux/ghc-7.10.2/bin/:$PATH
this code had to be changed:
mouseEventDecoder :: Decoder (Int, Int)
mouseEventDecoder =
Decoder
(withObject "event" $ \o -> liftA2 (,) (o .: "clientX") (o .: "clientY"))
mempty
to
mouseEventDecoder :: Decoder (Int, Int)
mouseEventDecoder =
Decoder
(withObject "event" $ \o -> liftA2 (,) (o .: "clientX") (o .: "clientY"))
(DecodeTarget [])
because apparently DecodeTarget doesn't have a Monoid instance.
then, this project builds with the following stack.yaml
resolver: lts-6.20
compiler: ghcjs-0.2.0.9006020_ghc-7.10.3
compiler-check: match-exact
packages:
- '.'
extra-deps:
- miso-0.21.2.0@sha256:298ac5017beb44c5e4002eef917c40e2fdf017c7ffa84a1344dc73d0c01664c2
setup-info:
ghcjs:
source:
ghcjs-0.2.0.9006020_ghc-7.10.3:
url: http://ghcjs.tolysz.org/lts-6.20-9006020.tar.gz
sha1: a6cea90cd8121eee3afb201183c6e9bd6bacd94a
and all the bounds removed from the cabal file.
What the version errors are telling you is that this project is intended to be used with GHCJS >= 8.0 and newer versions of diagrams that provide this Monoid instance. Since 7.10 is really old by now, I’d say it makes more sense that you try to upgrade rather than try to make this library compatible with 7.10 and older versions of diagrams.
diagrams won't provide a monoid instance of DecodeTarget, though, because that comes from miso itself?
Oh right, good catch! In that case I’m happy to accept a PR that fixes this (the patch you showed above looks totally fine).
as a lover of diagrams, this is an awesome library and i'm very excited to try it :)
presently, miso builds nicely with stack
i'm trying to include this library as a dep of
sample-app
; i've tried changing theapp.cabal
there to have:and pointing the stack file at a clone of diagrams-miso like so:
but no such luck; i get:
it gets much further with
allow-newer: true
, but fails here:and stack-installing that binary doesn't really help (probably not surprisingly; i'm not even sure what that does here...)
thoughts?
would it be best to set up a stack environment in this repo first, maybe following the scheme of miso itself, or is there some better approach?