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

Best way to specify that a column should be treated as Categorical? #123

Open
o1lo01ol1o opened this issue Dec 21, 2018 · 3 comments
Open

Comments

@o1lo01ol1o
Copy link
Contributor

Given some inferred types from tableTypes "Foos" data/foo, if I find that one of my columns was inferred incorrectly, I can just declare it correctly:

declareColumn "TruFoo" ''Double

tableTypes "Foo" data/foo

Is there an equally simple way to specify that TruBar in

declareCategorical "TruBar" (Just "TB_") ["C", "D", "T", "E"]

Should be preferred over the one in
tableTypes "Foo" data/foo

?

@acowley
Copy link
Owner

acowley commented Dec 21, 2018

Huh. I think if that's not working then it's a bug, but I'm not sure where yet. I guess you're doing something like the example program, but declaring the categorical column before tableTypes is issuing an error?

@o1lo01ol1o
Copy link
Contributor Author

o1lo01ol1o commented Dec 21, 2018

Yes, it basically looks like

declareCategorical "TruBar" (Just "TB_") ["C", "D", "T", "E"]
tableTypes "Foo" "data/foo"

Where tableTypes will infer a column that it will alias as TruBar. The error is in tableTypes:

Expected kind ‘(ghc-prim-0.5.1.1:GHC.Types.Symbol, *)’,
        but ‘TruBar’ has kind ‘*’
    • In the first argument of ‘Record’, namely

@acowley
Copy link
Owner

acowley commented Dec 21, 2018

Okay, that seems like a bug. I'll take a look.

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