haskell-servant / haskell-servant/servant
newtype instead of bare string in MimeUnrender / ResultStream?
Open
enhancement
- Dominant language
- Haskell
- Stars
- 2k
- Forks
- 427
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 5
Description
Currently we have
```haskell
mimeUnrender :: Proxy ctype -> ByteString -> Either String a
```
I think that we should have a wrapper over that `String`. The same error is also in `ResultStream` definition:
```haskell
newtype ResultStream a = ResultStream (forall b. (IO (Maybe (Either String a)) -> IO b) -> IO b)
```
If `newrype` is too much at once, I'll be already happy with a type alias. I have no good candidate for the name though.
Contributor guide
Assessment
This issue has not been assessed yet.