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

Compiler error when trying to use with current yesod-* #3

Open
schoettl opened this issue Nov 7, 2021 · 0 comments
Open

Compiler error when trying to use with current yesod-* #3

schoettl opened this issue Nov 7, 2021 · 0 comments

Comments

@schoettl
Copy link

schoettl commented Nov 7, 2021

Hi @danpalmer, I'm trying to use your nopassword package but GHC gives compiler errors when I try to compile my project.

Could not deduce (NoPasswordAuth m0) from the context: NoPasswordAuth m

I already downloaded the source and tried the suggested {-# LANGUAGE AllowAmbiguousTypes #-} but that only yields much more errors. Honestly, I have no clue how to fix it. If you have an idea or could help me, I'd happily provide an PR.

The error messages are:

yesod-auth-nopassword> [1 of 1] Compiling Yesod.Auth.NoPassword
yesod-auth-nopassword> 
yesod-auth-nopassword> /tmp/stack-39aef2d3928bc69a/yesod-auth-nopassword-0.1.1.1/src/Yesod/Auth/NoPassword.hs:145:14: error:
yesod-auth-nopassword>     • Could not deduce (NoPasswordAuth m0)
yesod-auth-nopassword>       from the context: NoPasswordAuth m
yesod-auth-nopassword>         bound by the type signature for:
yesod-auth-nopassword>                    getLoginR :: forall m.
yesod-auth-nopassword>                                 NoPasswordAuth m =>
yesod-auth-nopassword>                                 HandlerT Auth (HandlerT m IO) TypedContent
yesod-auth-nopassword>         at src/Yesod/Auth/NoPassword.hs:145:14-75
yesod-auth-nopassword>       The type variable ‘m0’ is ambiguous
yesod-auth-nopassword>     • In the ambiguity check for ‘getLoginR’
yesod-auth-nopassword>       To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
yesod-auth-nopassword>       In the type signature:
yesod-auth-nopassword>         getLoginR :: NoPasswordAuth m =>
yesod-auth-nopassword>                      HandlerT Auth (HandlerT m IO) TypedContent
yesod-auth-nopassword>     |
yesod-auth-nopassword> 145 | getLoginR :: NoPasswordAuth m => HandlerT Auth (HandlerT m IO) TypedContent
yesod-auth-nopassword>     |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
yesod-auth-nopassword> 
yesod-auth-nopassword> /tmp/stack-39aef2d3928bc69a/yesod-auth-nopassword-0.1.1.1/src/Yesod/Auth/NoPassword.hs:188:11: error:
yesod-auth-nopassword>     • Could not deduce (NoPasswordAuth m0)
yesod-auth-nopassword>       from the context: NoPasswordAuth m
yesod-auth-nopassword>         bound by the type signature for:
yesod-auth-nopassword>                    genUrl :: forall m.
yesod-auth-nopassword>                              NoPasswordAuth m =>
yesod-auth-nopassword>                              Token -> TokenId -> HandlerT Auth (HandlerT m IO) Text
yesod-auth-nopassword>         at src/Yesod/Auth/NoPassword.hs:188:11-84
yesod-auth-nopassword>       The type variable ‘m0’ is ambiguous
yesod-auth-nopassword>     • In the ambiguity check for ‘genUrl’
yesod-auth-nopassword>       To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
yesod-auth-nopassword>       In the type signature:
yesod-auth-nopassword>         genUrl :: NoPasswordAuth m =>
yesod-auth-nopassword>                   Token -> TokenId -> HandlerT Auth (HandlerT m IO) Text
yesod-auth-nopassword>     |
yesod-auth-nopassword> 188 | genUrl :: NoPasswordAuth m => Token -> TokenId -> HandlerT Auth (HandlerT m IO) Text
yesod-auth-nopassword>     |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I'm using stack, GHC 8.8.4, and the current yesod template.

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

1 participant