Skip to content

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

Description

@mrkgnao
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)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions