digitallyinduced / digitallyinduced/ihp

Type error for fetchOneOrNothing id >>= maybeFetchRelatedOrNothing #fieldName

Open
#751 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
5.4k
Forks
225
Avg merge
14h 56m
Merged PRs (30d)
20

Description

Looking at the types, I thought I should be able to do something like

```haskell
maybeEntity <- fetchOneOrNothing id >>= maybeFetchRelatedOrNothing #fieldName
```

But ghc is telling me

```
Couldn't match type 'Maybe fieldValue0'
with 'QueryBuilder "fieldName"'
arising from a use of 'maybeFetchRelatedOrNothing'
• In the second argument of '(>>=)', namely
'maybeFetchRelatedOrNothing #fieldName'
```

I think either the types/constraints could be improved to make these more composable, or perhaps the haddocks could be fleshed out for some of these query functions showing how they are meant to be used and combined.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.