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

Error messages mention unification (?) variables like $coxswainTau0 #11

Open
mrkgnao opened this issue Oct 21, 2017 · 3 comments
Open

Comments

@mrkgnao
Copy link

mrkgnao commented Oct 21, 2017

getAge :: (Lacks a "age", Short (NumCols a)) => R I (a .& "age" .= Int) -> Int
getAge = (`dot` #age)

getName :: (Lacks a "name", Short (NumCols a)) => R I (a .& "name" .= Text) -> Text
getName = (`dot` #name)

info :: _
info x = (getAge x, getName x)

The error:

src/Main.hs:47:9: error:
     Found type wildcard _
        standing for R I
                        (($coxswainTau0 .& ("name" .= Text)) .& ("age" .= Int))
                      -> (Int, Text)
      Where: ‘$coxswainTau0 is an ambiguous type variable
      To use the inferred type, enable PartialTypeSignatures
     In the type signature: info :: _
   |
47 | info :: _
   |         ^
src/Main.hs:48:1: error:
    No instance for (Lacks $coxswainTau0 "age")
      arising from a use of getAge
   |
48 | info x = (getAge x, getName x)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@nfrisby
Copy link
Owner

nfrisby commented Oct 21, 2017 via email

@mrkgnao
Copy link
Author

mrkgnao commented Oct 22, 2017

You're welcome! I'm trying to use your code to implement an extensible-effects library of some sort; let's see if I find any other bugs.

@nfrisby
Copy link
Owner

nfrisby commented Oct 22, 2017 via email

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