Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build reflex-dom-core using stack #162

Closed
kaizhang opened this issue Jul 7, 2017 · 2 comments
Closed

Cannot build reflex-dom-core using stack #162

kaizhang opened this issue Jul 7, 2017 · 2 comments

Comments

@kaizhang
Copy link

kaizhang commented Jul 7, 2017

I am trying to build the reflex-dom-core using stack and getting following error:

 /home/work/server/ghcjs/.stack-work/downloaded/vkgicrxe9HwG/reflex-dom-core/src/Reflex/Dom/Builder/Class.hs:672:1-79: error:
        • Cannot instantiate unification variable ‘a1’
          with a type involving foralls:
            (forall x. JSM x -> JSM x)
            -> EventWriterT
                 t
                 (dependent-map-0.2.4.0:Data.Dependent.Map.Internal.DMap
                    (prim-uniq-0.1.0.1:Unsafe.Unique.Tag.Tag
                       (Control.Monad.Primitive.PrimState m))
                    req)
                 (ReaderT
                    (EventSelector
                       t
                       (WrapArg
                          rsp
                          (prim-uniq-0.1.0.1:Unsafe.Unique.Tag.Tag
                             (Control.Monad.Primitive.PrimState m))))
                    m)
                 a2
            -> EventWriterT
                 t
                 (dependent-map-0.2.4.0:Data.Dependent.Map.Internal.DMap
                    (prim-uniq-0.1.0.1:Unsafe.Unique.Tag.Tag
                       (Control.Monad.Primitive.PrimState m))
                    req)
                 (ReaderT
                    (EventSelector
                       t
                       (WrapArg
                          rsp
                          (prim-uniq-0.1.0.1:Unsafe.Unique.Tag.Tag
                             (Control.Monad.Primitive.PrimState m))))
                    m)
                 a2
            GHC doesn't yet support impredicative polymorphism
        • In the first argument of ‘ghc-prim-0.5.0.0:GHC.Prim.coerce’, namely
            ‘withRenderHook ::
               (forall (x :: TYPE ghc-prim-0.5.0.0:GHC.Types.PtrRepLifted).
                JSM x -> JSM x)
               -> EventWriterT t (dependent-map-0.2.4.0:Data.Dependent.Map.Internal.DMap (prim-uniq-0.1.0.1:Unsafe.Unique.Tag.Tag (Control.Monad.Primitive.PrimState m)) req) (ReaderT (EventSelector t (WrapArg rsp (prim-uniq-0.1.0.1:Unsafe.Unique.Tag.Tag (Control.Monad.Primitive.PrimState m)))) m) a
                  -> EventWriterT t (dependent-map-0.2.4.0:Data.Dependent.Map.Internal.DMap (prim-uniq-0.1.0.1:Unsafe.Unique.Tag.Tag (Control.Monad.Primitive.PrimState m)) req) (ReaderT (EventSelector t (WrapArg rsp (prim-uniq-0.1.0.1:Unsafe.Unique.Tag.Tag (Control.Monad.Primitive.PrimState m)))) m) a’
          In the expression:
              ghc-prim-0.5.0.0:GHC.Prim.coerce
                (withRenderHook ::
                   (forall (x :: TYPE ghc-prim-0.5.0.0:GHC.Types.PtrRepLifted).
                    JSM x -> JSM x)
                   -> EventWriterT t (dependent-map-0.2.4.0:Data.Dependent.Map.Internal.DMap (prim-uniq-0.1.0.1:Unsafe.Unique.Tag.Tag (Control.Monad.Primitive.PrimState m)) req) (ReaderT (EventSelector t (WrapArg rsp (prim-uniq-0.1.0.1:Unsafe.Unique.Tag.Tag (Control.Monad.Primitive.PrimState m)))) m) a
                      -> EventWriterT t (dependent-map-0.2.4.0:Data.Dependent.Map.Internal.DMap (prim-uniq-0.1.0.1:Unsafe.Unique.Tag.Tag (Control.Monad.Primitive.PrimState m)) req) (ReaderT (EventSelector t (WrapArg rsp (prim-uniq-0.1.0.1:Unsafe.Unique.Tag.Tag (Control.Monad.Primitive.PrimState m)))) m) a) ::
                forall (a :: TYPE ghc-prim-0.5.0.0:GHC.Types.PtrRepLifted).
                (forall (x :: TYPE ghc-prim-0.5.0.0:GHC.Types.PtrRepLifted).
                 JSM x -> JSM x)
                -> RequesterT t req rsp m a -> RequesterT t req rsp m a
          In an equation for ‘withRenderHook’:
              withRenderHook
                = ghc-prim-0.5.0.0:GHC.Prim.coerce
                    (withRenderHook ::
                       (forall (x :: TYPE ghc-prim-0.5.0.0:GHC.Types.PtrRepLifted).
                        JSM x -> JSM x)
                       -> EventWriterT t (dependent-map-0.2.4.0:Data.Dependent.Map.Internal.DMap (prim-uniq-0.1.0.1:Unsafe.Unique.Tag.Tag (Control.Monad.Primitive.PrimState m)) req) (ReaderT (EventSelector t (WrapArg rsp (prim-uniq-0.1.0.1:Unsafe.Unique.Tag.Tag (Control.Monad.Primitive.PrimState m)))) m) a
                          -> EventWriterT t (dependent-map-0.2.4.0:Data.Dependent.Map.Internal.DMap (prim-uniq-0.1.0.1:Unsafe.Unique.Tag.Tag (Control.Monad.Primitive.PrimState m)) req) (ReaderT (EventSelector t (WrapArg rsp (prim-uniq-0.1.0.1:Unsafe.Unique.Tag.Tag (Control.Monad.Primitive.PrimState m)))) m) a) ::
                    forall (a :: TYPE ghc-prim-0.5.0.0:GHC.Types.PtrRepLifted).
                    (forall (x :: TYPE ghc-prim-0.5.0.0:GHC.Types.PtrRepLifted).
                     JSM x -> JSM x)
                    -> RequesterT t req rsp m a -> RequesterT t req rsp m a
          When typechecking the code for ‘withRenderHook’
            in a derived instance for ‘DomRenderHook
                                         t (RequesterT t req rsp m)’:
            To see the code I am typechecking, use -ddump-deriv
        • Relevant bindings include
            withRenderHook :: (forall x. JSM x -> JSM x)
                              -> RequesterT t req rsp m a -> RequesterT t req rsp m a
              (bound at src/Reflex/Dom/Builder/Class.hs:672:1)

    /home/work/server/ghcjs/.stack-work/downloaded/vkgicrxe9HwG/reflex-dom-core/src/Reflex/Dom/Builder/Class.hs:674:1-69: error:
        • Cannot instantiate unification variable ‘a0’
          with a type involving foralls:
            (forall x. JSM x -> JSM x)
            -> StateT
                 [Behavior t q]
                 (EventWriterT t q (ReaderT (Dynamic t (QueryResult q)) m))
                 a2
            -> StateT
                 [Behavior t q]
                 (EventWriterT t q (ReaderT (Dynamic t (QueryResult q)) m))
                 a2
            GHC doesn't yet support impredicative polymorphism
        • In the first argument of ‘ghc-prim-0.5.0.0:GHC.Prim.coerce’, namely
            ‘withRenderHook ::
               (forall (x :: TYPE ghc-prim-0.5.0.0:GHC.Types.PtrRepLifted).
                JSM x -> JSM x)
               -> StateT ([] (Behavior t q)) (EventWriterT t q (ReaderT (Dynamic t (QueryResult q)) m)) a
                  -> StateT ([] (Behavior t q)) (EventWriterT t q (ReaderT (Dynamic t (QueryResult q)) m)) a’
          In the expression:
              ghc-prim-0.5.0.0:GHC.Prim.coerce
                (withRenderHook ::
                   (forall (x :: TYPE ghc-prim-0.5.0.0:GHC.Types.PtrRepLifted).
                    JSM x -> JSM x)
                   -> StateT ([] (Behavior t q)) (EventWriterT t q (ReaderT (Dynamic t (QueryResult q)) m)) a
                      -> StateT ([] (Behavior t q)) (EventWriterT t q (ReaderT (Dynamic t (QueryResult q)) m)) a) ::
                forall (a :: TYPE ghc-prim-0.5.0.0:GHC.Types.PtrRepLifted).
                (forall (x :: TYPE ghc-prim-0.5.0.0:GHC.Types.PtrRepLifted).
                 JSM x -> JSM x)
                -> QueryT t q m a -> QueryT t q m a
          In an equation for ‘withRenderHook’:
              withRenderHook
                = ghc-prim-0.5.0.0:GHC.Prim.coerce
                    (withRenderHook ::
                       (forall (x :: TYPE ghc-prim-0.5.0.0:GHC.Types.PtrRepLifted).
                        JSM x -> JSM x)
                       -> StateT ([] (Behavior t q)) (EventWriterT t q (ReaderT (Dynamic t (QueryResult q)) m)) a
                          -> StateT ([] (Behavior t q)) (EventWriterT t q (ReaderT (Dynamic t (QueryResult q)) m)) a) ::
                    forall (a :: TYPE ghc-prim-0.5.0.0:GHC.Types.PtrRepLifted).
                    (forall (x :: TYPE ghc-prim-0.5.0.0:GHC.Types.PtrRepLifted).
                     JSM x -> JSM x)
                    -> QueryT t q m a -> QueryT t q m a
          When typechecking the code for ‘withRenderHook’
            in a derived instance for ‘DomRenderHook t (QueryT t q m)’:
            To see the code I am typechecking, use -ddump-deriv
        • Relevant bindings include
            withRenderHook :: (forall x. JSM x -> JSM x)
                              -> QueryT t q m a -> QueryT t q m a
              (bound at src/Reflex/Dom/Builder/Class.hs:674:1)

The version of ghcjs I'm using is from stack:

ghcjs:
    source:
      ghcjs-0.2.1.9007019_ghc-8.0.1:
           url: http://ghcjs.tolysz.org/ghc-8.0-2017-02-05-lts-7.19-9007019.tar.gz
           sha1: d2cfc25f9cda32a25a87d9af68891b2186ee52f9

Could it be that the ghcjs is too old?

Below is my stack.yaml:

resolver: lts-7.19
compiler: ghcjs-0.2.1.9007019_ghc-8.0.1
compiler-check: match-exact

setup-info:
  ghcjs:
    source:
      ghcjs-0.2.1.9007019_ghc-8.0.1:
           url: http://ghcjs.tolysz.org/ghc-8.0-2017-02-05-lts-7.19-9007019.tar.gz
           sha1: d2cfc25f9cda32a25a87d9af68891b2186ee52f9

packages:
  - location:
      git: https://github.com/ghcjs/ghcjs-dom.git
      commit: "b5984c8326f6eb1e29f2ca60c0e88eb6ecfdc0c1"
    subdirs:
      - ghcjs-dom
      - ghcjs-dom-jsffi
      - ghcjs-dom-jsaddle

  - location:
      git: https://github.com/ghcjs/jsaddle-dom
      commit: "0c3f8c60a15fba49bea8d9e4fa871fb1e40460d4"

  - location:
      git: https://github.com/reflex-frp/reflex.git
      commit: 1d3a26b3f7d7d50cfe95bb3a28eca38981ad9ec3

  - location:
      git: https://github.com/reflex-frp/reflex-dom.git
      commit: 275939f650b87d2d46b6b8416655d963fee9280e
    subdirs:
      - reflex-dom-core
      - reflex-dom

extra-deps:
  - jsaddle-0.9.2.1
  - prim-uniq-0.1.0.1
  - ref-tf-0.4.0.1
  - zenc-0.1.1
  - constraints-0.9.1
@ryantrinkle
Copy link
Member

It definitely could be that it's too old. Are you able to try a version of ghcjs that's based on 8.0.2 instead of 8.0.1?

@kaizhang
Copy link
Author

kaizhang commented Jul 8, 2017

8.0.2 works! This is the final stack.yaml:

resolver: lts-8.11
compiler: ghcjs-0.2.1.9008011_ghc-8.0.2
compiler-check: match-exact
setup-info:
  ghcjs:
    source:
      ghcjs-0.2.1.9008011_ghc-8.0.2:
        url: https://github.com/matchwood/ghcjs-stack-dist/raw/master/ghcjs-0.2.1.9008011.tar.gz
        sha1: a72a5181124baf64bcd0e68a8726e65914473b3b

packages:
  - location:
      git: https://github.com/ghcjs/ghcjs-dom.git
      commit: "b5984c8326f6eb1e29f2ca60c0e88eb6ecfdc0c1"
    subdirs:
      - ghcjs-dom
      - ghcjs-dom-jsffi
      - ghcjs-dom-jsaddle

  - location:
      git: https://github.com/ghcjs/jsaddle-dom
      commit: "0c3f8c60a15fba49bea8d9e4fa871fb1e40460d4"

  - location:
      git: https://github.com/reflex-frp/reflex.git
      commit: 1d3a26b3f7d7d50cfe95bb3a28eca38981ad9ec3

  - location:
      git: https://github.com/reflex-frp/reflex-dom.git
      commit: 275939f650b87d2d46b6b8416655d963fee9280e
    subdirs:
      - reflex-dom-core
      - reflex-dom

extra-deps:
  - dependent-sum-template-0.0.0.6
  - jsaddle-0.9.2.1
  - prim-uniq-0.1.0.1
  - ref-tf-0.4.0.1
  - zenc-0.1.1

@kaizhang kaizhang closed this as completed Jul 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants