digitallyinduced / digitallyinduced/ihp
Type error for fetchOneOrNothing id >>= maybeFetchRelatedOrNothing #fieldName
- 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
Assessment
This issue has not been assessed yet.