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

Could not deduce instance of GEq, dependency version unspecified #263

Closed
banacorn opened this issue Nov 9, 2020 · 1 comment
Closed

Comments

@banacorn
Copy link
Contributor

banacorn commented Nov 9, 2020

A side issue from #262

lsp-types doesn't build with stack-8.6.5.yaml and stack-8.6.4.yaml, but stack-8.8.2.yaml and stack-8.8.1.yaml work fine on the other hand.

I think some of the dependency version lower bound need to be specified, but I'm not sure which one it is.

 /Users/banacorn/haskell/lsp/lsp-types/src/Language/LSP/Types/Message.hs:620:13: error:
     • Could not deduce (GEq SMethod) arising from a use of ‘geq’
       from the context: (t1 ~ 'Notification, m1 ~~ m,
                          HasJSON (ServerMessage m), Message m ~ NotificationMessage m)
         bound by a pattern with constructor:
                    IsServerNot :: forall (m :: Method 'FromServer 'Notification).
                                   (HasJSON (ServerMessage m), Message m ~ NotificationMessage m) =>
                                   ServerNotOrReq m,
                  in a case alternative
         at src/Language/LSP/Types/Message.hs:619:4-14
       or from: (t ~ 'Notification, m2 ~~ m4, HasJSON (ServerMessage m4),
                 Message m4 ~ NotificationMessage m4)
         bound by a pattern with constructor:
                    IsServerNot :: forall (m :: Method 'FromServer 'Notification).
                                   (HasJSON (ServerMessage m), Message m ~ NotificationMessage m) =>
                                   ServerNotOrReq m,
                  in a case alternative
         at src/Language/LSP/Types/Message.hs:619:17-27
     • In a stmt of a 'do' block: Refl <- geq m1 m2
       In the expression:
         do Refl <- geq m1 m2
            pure HRefl
       In a case alternative:
           (IsServerNot, IsServerNot)
             -> do Refl <- geq m1 m2
                   pure HRefl
     |
 620 |     Refl <- geq m1 m2
     |             ^^^^^^^^^
here are the all 4 error messages (including the one above)
 /Users/banacorn/haskell/lsp/lsp-types/src/Language/LSP/Types/Message.hs:620:13: error:
     • Could not deduce (GEq SMethod) arising from a use of ‘geq’
       from the context: (t1 ~ 'Notification, m1 ~~ m,
                          HasJSON (ServerMessage m), Message m ~ NotificationMessage m)
         bound by a pattern with constructor:
                    IsServerNot :: forall (m :: Method 'FromServer 'Notification).
                                   (HasJSON (ServerMessage m), Message m ~ NotificationMessage m) =>
                                   ServerNotOrReq m,
                  in a case alternative
         at src/Language/LSP/Types/Message.hs:619:4-14
       or from: (t ~ 'Notification, m2 ~~ m4, HasJSON (ServerMessage m4),
                 Message m4 ~ NotificationMessage m4)
         bound by a pattern with constructor:
                    IsServerNot :: forall (m :: Method 'FromServer 'Notification).
                                   (HasJSON (ServerMessage m), Message m ~ NotificationMessage m) =>
                                   ServerNotOrReq m,
                  in a case alternative
         at src/Language/LSP/Types/Message.hs:619:17-27
     • In a stmt of a 'do' block: Refl <- geq m1 m2
       In the expression:
         do Refl <- geq m1 m2
            pure HRefl
       In a case alternative:
           (IsServerNot, IsServerNot)
             -> do Refl <- geq m1 m2
                   pure HRefl
     |
 620 |     Refl <- geq m1 m2
     |             ^^^^^^^^^

 /Users/banacorn/haskell/lsp/lsp-types/src/Language/LSP/Types/Message.hs:623:13: error:
     • Could not deduce (GEq SMethod) arising from a use of ‘geq’
       from the context: (t1 ~ 'Request, m1 ~~ m,
                          HasJSON (ServerMessage m), HasJSON (ResponseMessage m),
                          Message m ~ RequestMessage m)
         bound by a pattern with constructor:
                    IsServerReq :: forall (m :: Method 'FromServer 'Request).
                                   (HasJSON (ServerMessage m), HasJSON (ResponseMessage m),
                                    Message m ~ RequestMessage m) =>
                                   ServerNotOrReq m,
                  in a case alternative
         at src/Language/LSP/Types/Message.hs:622:4-14
       or from: (t ~ 'Request, m2 ~~ m4, HasJSON (ServerMessage m4),
                 HasJSON (ResponseMessage m4), Message m4 ~ RequestMessage m4)
         bound by a pattern with constructor:
                    IsServerReq :: forall (m :: Method 'FromServer 'Request).
                                   (HasJSON (ServerMessage m), HasJSON (ResponseMessage m),
                                    Message m ~ RequestMessage m) =>
                                   ServerNotOrReq m,
                  in a case alternative
         at src/Language/LSP/Types/Message.hs:622:17-27
     • In a stmt of a 'do' block: Refl <- geq m1 m2
       In the expression:
         do Refl <- geq m1 m2
            pure HRefl
       In a case alternative:
           (IsServerReq, IsServerReq)
             -> do Refl <- geq m1 m2
                   pure HRefl
     |
 623 |     Refl <- geq m1 m2
     |  
 /Users/banacorn/haskell/lsp/lsp-types/src/Language/LSP/Types/Message.hs:623:13: error:
     • Could not deduce (GEq SMethod) arising from a use of ‘geq’
       from the context: (t1 ~ 'Request, m1 ~~ m,
                          HasJSON (ServerMessage m), HasJSON (ResponseMessage m),
                          Message m ~ RequestMessage m)
         bound by a pattern with constructor:
                    IsServerReq :: forall (m :: Method 'FromServer 'Request).
                                   (HasJSON (ServerMessage m), HasJSON (ResponseMessage m),
                                    Message m ~ RequestMessage m) =>
                                   ServerNotOrReq m,
                  in a case alternative
         at src/Language/LSP/Types/Message.hs:622:4-14
       or from: (t ~ 'Request, m2 ~~ m4, HasJSON (ServerMessage m4),
                 HasJSON (ResponseMessage m4), Message m4 ~ RequestMessage m4)
         bound by a pattern with constructor:
                    IsServerReq :: forall (m :: Method 'FromServer 'Request).
                                   (HasJSON (ServerMessage m), HasJSON (ResponseMessage m),
                                    Message m ~ RequestMessage m) =>
                                   ServerNotOrReq m,
                  in a case alternative
         at src/Language/LSP/Types/Message.hs:622:17-27
     • In a stmt of a 'do' block: Refl <- geq m1 m2
       In the expression:
         do Refl <- geq m1 m2
            pure HRefl
       In a case alternative:
           (IsServerReq, IsServerReq)
             -> do Refl <- geq m1 m2
                   pure HRefl
     |
 623 |     Refl <- geq m1 m2
     |             ^^^^^^^^^

 /Users/banacorn/haskell/lsp/lsp-types/src/Language/LSP/Types/Message.hs:634:13: error:
     • Could not deduce (GEq SMethod) arising from a use of ‘geq’
       from the context: (t1 ~ 'Request, m1 ~~ m,
                          HasJSON (ClientMessage m), HasJSON (ResponseMessage m),
                          Message m ~ RequestMessage m)
         bound by a pattern with constructor:
                    IsClientReq :: forall (m :: Method 'FromClient 'Request).
                                   (HasJSON (ClientMessage m), HasJSON (ResponseMessage m),
                                    Message m ~ RequestMessage m) =>
                                   ClientNotOrReq m,
                  in a case alternative
         at src/Language/LSP/Types/Message.hs:633:4-14
       or from: (t ~ 'Request, m2 ~~ m4, HasJSON (ClientMessage m4),
                 HasJSON (ResponseMessage m4), Message m4 ~ RequestMessage m4)
         bound by a pattern with constructor:
                    IsClientReq :: forall (m :: Method 'FromClient 'Request).
                                   (HasJSON (ClientMessage m), HasJSON (ResponseMessage m),
                                    Message m ~ RequestMessage m) =>
                                   ClientNotOrReq m,
                  in a case alternative
         at src/Language/LSP/Types/Message.hs:633:17-27
     • In a stmt of a 'do' block: Refl <- geq m1 m2
       In the expression:
         do Refl <- geq m1 m2
            pure HRefl
       In a case alternative:
           (IsClientReq, IsClientReq)
             -> do Refl <- geq m1 m2
                   pure HRefl
     |
 634 |     Refl <- geq m1 m2
     |             ^^^^^^^^^
fwcd added a commit to fwcd/koka that referenced this issue Dec 8, 2020
fwcd added a commit to fwcd/koka that referenced this issue Dec 9, 2020
fwcd added a commit to fwcd/koka that referenced this issue Dec 9, 2020
@alanz
Copy link
Collaborator

alanz commented Jan 21, 2021

I updated my cabal dependencies in a project to be

                     -- following needed because of https://github.com/alanz/lsp/issues/263
                     , constraints-extras == 0.3.0.2
                     , dependent-map == 0.4.0.0
                     , dependent-sum == 0.7.1.0
                     , dependent-sum-template == 0.1.0.3

based on fwcd/koka@665f959
and it then builds for me, using hackage at 2021-01-21T11:58:13Z, tested with GHC 8.8.4 and 8.10.3

banacorn added a commit to banacorn/lsp that referenced this issue Jan 28, 2021
lukel97 pushed a commit that referenced this issue Jan 30, 2021
lukel97 added a commit that referenced this issue Jan 30, 2021
Fix dependency problems in #263 2.0
@wz1000 wz1000 closed this as completed Feb 4, 2021
TimWhiting added a commit to TimWhiting/koka that referenced this issue Mar 22, 2023
commit 6dfee8f
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 15 02:14:46 2020 +0100

    Add keyword completions

commit 93d10b0
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 15 00:56:36 2020 +0100

    Fix vscode-languageclient imports

commit 8e10a56
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 15 00:55:54 2020 +0100

    Update vscode dependencies

commit a54b90d
Author: fwcd <fwcdmail@gmail.com>
Date:   Sun Dec 13 22:01:16 2020 +0100

    Add some todo notes regarding code completion enhancements

commit a503d27
Author: fwcd <fwcdmail@gmail.com>
Date:   Sun Dec 13 21:52:38 2020 +0100

    Provide types in completion detail

commit 4d474a1
Author: fwcd <fwcdmail@gmail.com>
Date:   Sun Dec 13 21:49:44 2020 +0100

    Generate more specific completion item kinds

commit 49aa566
Author: fwcd <fwcdmail@gmail.com>
Date:   Sun Dec 13 21:40:25 2020 +0100

    Update note on type completions

commit a7d6a85
Author: fwcd <fwcdmail@gmail.com>
Date:   Sun Dec 13 21:38:49 2020 +0100

    Add basic synonym completions

commit 2184bc7
Author: fwcd <fwcdmail@gmail.com>
Date:   Sun Dec 13 21:33:38 2020 +0100

    Add basic constructor completions

commit 2eb4340
Author: fwcd <fwcdmail@gmail.com>
Date:   Sun Dec 13 21:32:30 2020 +0100

    Add Kind.Constructors.constructorsList

commit 9234ac5
Author: fwcd <fwcdmail@gmail.com>
Date:   Sun Dec 13 21:29:29 2020 +0100

    Add basic value completions

commit c78fb45
Author: fwcd <fwcdmail@gmail.com>
Date:   Sun Dec 13 19:04:20 2020 +0100

    Add completion handler stub

commit 68e4db8
Merge: 369b33e 2f9a165
Author: fwcd <fwcdmail@gmail.com>
Date:   Sun Dec 13 18:23:04 2020 +0100

    Merge branch 'dev' into language-server

commit 369b33e
Author: fwcd <fwcdmail@gmail.com>
Date:   Sun Dec 13 17:49:01 2020 +0100

    Update description of the VSCode extension

commit 810a966
Author: fwcd <fwcdmail@gmail.com>
Date:   Sun Dec 13 17:43:54 2020 +0100

    Switch 'vscode' dependency to '@types/vscode'

    'vscode' is deprecated.

commit c436f3c
Author: fwcd <fwcdmail@gmail.com>
Date:   Fri Dec 11 20:18:51 2020 +0100

    Provide richer LSP symbol kinds on type declarations

commit 9533e32
Author: fwcd <fwcdmail@gmail.com>
Date:   Fri Dec 11 20:06:39 2020 +0100

    Add HasSymbols instance over lists

commit 9bc5fae
Author: fwcd <fwcdmail@gmail.com>
Date:   Fri Dec 11 20:04:17 2020 +0100

    Extract symbols from type declarations

commit 06e4655
Author: fwcd <fwcdmail@gmail.com>
Date:   Fri Dec 11 19:50:54 2020 +0100

    Extract symbols from handlers and lambda expressions

commit 9381e70
Author: fwcd <fwcdmail@gmail.com>
Date:   Fri Dec 11 19:39:30 2020 +0100

    Traverse expressions and patterns for symbols

commit 97c84f5
Author: fwcd <fwcdmail@gmail.com>
Date:   Fri Dec 11 19:08:20 2020 +0100

    List top-level declarations as document symbols

commit 88a7c29
Author: fwcd <fwcdmail@gmail.com>
Date:   Fri Dec 11 19:01:17 2020 +0100

    Update imports in LSP handlers

commit 0c11297
Author: fwcd <fwcdmail@gmail.com>
Date:   Fri Dec 11 18:52:15 2020 +0100

    Add document symbol LSP handler

commit 3338b7f
Author: fwcd <fwcdmail@gmail.com>
Date:   Fri Dec 11 18:47:31 2020 +0100

    Add some more doc comments

commit 117ba29
Author: fwcd <fwcdmail@gmail.com>
Date:   Fri Dec 11 18:29:55 2020 +0100

    Add unneccessary tag to warnings mentioning 'unused'

    This enables editors to 'dim' unused variables and expressions.

commit 317fe77
Author: fwcd <fwcdmail@gmail.com>
Date:   Fri Dec 11 18:24:06 2020 +0100

    Clean up recompileFile function in LSP handler

commit 0c47ef1
Author: fwcd <fwcdmail@gmail.com>
Date:   Fri Dec 11 18:18:57 2020 +0100

    Look up synonyms in LSP definition handler

commit aa604a1
Author: fwcd <fwcdmail@gmail.com>
Date:   Fri Dec 11 18:16:41 2020 +0100

    Look up types in LSP definition handler

commit bc0a6ea
Author: fwcd <fwcdmail@gmail.com>
Date:   Fri Dec 11 18:13:47 2020 +0100

    Look up constructor definitions in LSP definition handler

commit d31c02a
Author: fwcd <fwcdmail@gmail.com>
Date:   Fri Dec 11 18:04:05 2020 +0100

    Remove unused 'rightToMaybe' function

commit ae2851b
Author: fwcd <fwcdmail@gmail.com>
Date:   Fri Dec 11 18:02:44 2020 +0100

    Add LSP definition handler

commit c646824
Author: fwcd <fwcdmail@gmail.com>
Date:   Fri Dec 11 17:45:17 2020 +0100

    Add LSP location conversions

commit b37bf3b
Author: fwcd <fwcdmail@gmail.com>
Date:   Thu Dec 10 06:07:22 2020 +0100

    Remove debug log messages from LSP text doc handlers

commit eb21f36
Author: fwcd <fwcdmail@gmail.com>
Date:   Thu Dec 10 06:04:39 2020 +0100

    Fix LS state accessor

commit 8353451
Author: fwcd <fwcdmail@gmail.com>
Date:   Thu Dec 10 05:57:48 2020 +0100

    Share the LSState among all handlers

commit ae48beb
Author: fwcd <fwcdmail@gmail.com>
Date:   Thu Dec 10 05:48:20 2020 +0100

    Enable open/close notifications

commit 2af326f
Author: fwcd <fwcdmail@gmail.com>
Date:   Thu Dec 10 05:35:31 2020 +0100

    WIP: Recompile text documents in language server on changes

commit 7048e96
Author: fwcd <fwcdmail@gmail.com>
Date:   Thu Dec 10 05:06:36 2020 +0100

    Add accessors to language server monad

commit 9b89384
Author: fwcd <fwcdmail@gmail.com>
Date:   Thu Dec 10 04:52:27 2020 +0100

    Add custom monad for storing language server-specific state

commit 1436685
Author: fwcd <fwcdmail@gmail.com>
Date:   Thu Dec 10 03:24:18 2020 +0100

    Add LSP initialization handler

commit 2422049
Author: fwcd <fwcdmail@gmail.com>
Date:   Thu Dec 10 03:17:39 2020 +0100

    Add stub handlers for text document changes

commit 74f144d
Author: fwcd <fwcdmail@gmail.com>
Date:   Thu Dec 10 03:09:29 2020 +0100

    Move hover handler

commit f2f5d41
Author: fwcd <fwcdmail@gmail.com>
Date:   Thu Dec 10 00:34:57 2020 +0100

    Clean up imports in hover module

commit 91c4604
Author: fwcd <fwcdmail@gmail.com>
Date:   Thu Dec 10 00:34:31 2020 +0100

    Add source to LSP diagnostics and flush them

commit d6362a8
Author: fwcd <fwcdmail@gmail.com>
Date:   Thu Dec 10 00:31:18 2020 +0100

    Generate experimental LSP diagnostics

commit e9225d2
Author: fwcd <fwcdmail@gmail.com>
Date:   Thu Dec 10 00:18:12 2020 +0100

    Add conversions for LSP diagnostics

commit 39038ae
Author: fwcd <fwcdmail@gmail.com>
Date:   Thu Dec 10 00:00:16 2020 +0100

    Improve handling of errors when creating hover

commit f22e5cf
Author: fwcd <fwcdmail@gmail.com>
Date:   Wed Dec 9 23:55:29 2020 +0100

    Move hover into separate module

commit 54d2e19
Author: fwcd <fwcdmail@gmail.com>
Date:   Wed Dec 9 23:49:10 2020 +0100

    Factor out pos/range LSP conversions into separate module

commit 0d1c20e
Author: fwcd <fwcdmail@gmail.com>
Date:   Wed Dec 9 23:41:24 2020 +0100

    Using pretty-printer to generate better hovers

    Hover tooltips now display detailed type information.

commit ae607d9
Author: fwcd <fwcdmail@gmail.com>
Date:   Wed Dec 9 23:00:13 2020 +0100

    Perform some stylistic cleanup in LanguageServer.Handlers

commit a085ae1
Author: fwcd <fwcdmail@gmail.com>
Date:   Wed Dec 9 22:56:41 2020 +0100

    Update language server options in VSCode extension

    Rename 'languageServer.path' to 'languageServer.command' and add option
    for specifying the cwd. This is especially useful for development, e.g.
    in the following configuration:

        "koka.languageServer.command": "stack exec koka -- --language-server",
        "koka.languageServer.cwd": "path/to/cloned/koka"

commit cbc8747
Author: fwcd <fwcdmail@gmail.com>
Date:   Wed Dec 9 22:35:45 2020 +0100

    Update cabal file

commit de44cb8
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 8 17:48:19 2020 +0100

    Improve todo comments

commit fc98530
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 8 17:12:34 2020 +0100

    Only start language client in VSCode extension if option is set

commit f79f53b
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 8 17:00:23 2020 +0100

    Fix off-by-ones in LSP pos/range conversions

commit 20d5001
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 8 16:54:56 2020 +0100

    Find innermost range in rangeMapFindAt

commit e86f8e7
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 8 16:46:34 2020 +0100

    Add rangeLength

commit 4618e99
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 8 16:34:31 2020 +0100

    Use actual range in hover result

commit c3f8dee
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 8 16:32:59 2020 +0100

    Implement hover using range map

commit e420c6b
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 8 16:16:55 2020 +0100

    Derive Show on RangeMap

commit e42d151
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 8 16:13:24 2020 +0100

    Control range map generation via new flag

commit 371dd04
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 8 14:15:15 2020 +0100

    Implement experimental hover

commit ed510ef
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 8 12:58:27 2020 +0100

    Add missing options to language server runner

commit 90d0aa0
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 8 12:54:29 2020 +0100

    Fix VSCode extension executable path

commit 2ea5c22
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 8 12:51:39 2020 +0100

    Add language client to VSCode extension

commit e62a764
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 8 12:23:45 2020 +0100

    Add option for language server mode

commit 479718e
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 8 12:19:44 2020 +0100

    Implement 'fail' for Asm

    Use 'error' for now

commit 206d174
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 8 12:19:09 2020 +0100

    Implement 'fail' for IOErr

commit 19f0d18
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 8 12:11:31 2020 +0100

    Move 'fail' implementations to MonadFail

    as Monad.fail was removed from GHC 8.8

commit d86f6b6
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 8 12:10:53 2020 +0100

    Implement basic LSP handler

commit 98cde17
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 8 12:03:31 2020 +0100

    Add unliftio extra-dep

    Required to build the latest version of the lsp library

commit 665f959
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 8 11:38:14 2020 +0100

    Update stack resolver

    See haskell/lsp#263

commit 1889536
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 8 11:24:09 2020 +0100

    Add dependency on lens library

commit 5d5b075
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 8 11:09:48 2020 +0100

    Add language server protocol library

commit c3db897
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 8 11:03:15 2020 +0100

    Add language server mode

commit 4e005d1
Author: fwcd <fwcdmail@gmail.com>
Date:   Tue Dec 8 10:52:30 2020 +0100

    Gitignore .vscode
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

3 participants