bitemyapp / bitemyapp/esqueleto

TypeError instance for Tuple

Open
#269 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
399
Forks
107
Avg merge
1d 17h
Merged PRs (30d)
1

Description

A coworker had a bug where they wrote:

```haskell
from $
Table @Foo
`InnerJoin`
Table @Bar
`on`
( \(foo, bar) -> foo ^. FooId ==. bar ^. BarFooId
)
```

The error was pretty gnarly.

```
Could not deduce (Database.Esqueleto.Experimental.ToInnerJoin
Database.Esqueleto.Experimental.NotLateral
(E.From (E.SqlExpr (Entity Foo)))
(E.From (E.SqlExpr (Entity Bar)))
(E.SqlExpr (Entity Foo), E.SqlExpr (Entity Bar)))
```

If we had a type error instance with `ToInnerJoin a b c (d, e)` then we may be able to provide a better error mesage.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the ToInnerJoin type and its related instances, then reproduce the query and current type error shown in the issue. Define done as producing a more helpful diagnostic for tuple-shaped join expressions, and add or run a focused type-checking test if the repository provides one.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.