haskell-beam / haskell-beam/beam

Query documentation could use an example on how to compare column with dynamic value

Open
#369 1 comment 0 reactions 0 assignees View on GitHub
docs
Dominant language
Haskell
Stars
635
Forks
193
PR merge metrics
No merged PRs in 30d

Description

Hey!

Stumbled upon another slightly unclear thing — how to filter against a value from a variable. Turns out all of the `filter_` examples in http://tathougies.github.io/beam/user-guide/queries/basic/ use hard-coded values that I guess work due to overloaded strings. When one plugs in a variable, for example, of type `String` to either side, they get a type mismatch. Because `==.` is fairly generic, the error is somewhat backwards — not pushing the `String` towards `QExpr`, but vice versa. As I remembered seeing `Beam.val_` when playing with `insertExpressions`, I thought to try that.

I think it'd be valuable to newcomers if one such example were documented, too. The overloaded string or `Num` variants do for nice examples, but don't address the complexity that later surfaces again.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.