haskell-servant / haskell-servant/servant

newtype instead of bare string in MimeUnrender / ResultStream?

Open
#999 3 comments 1 reaction 0 assignees View on GitHub
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

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.