haskell / haskell/HTTP

getRequest returns Request_String instead of Request a

Aperta
#1 0 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
Haskell
Stelle
186
Fork
59
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

What's the reason for not having `getRequest` and `postRequest` return `Request a`, i.e.:

```
getRequest :: BufferType a => String -> Request a
postRequest :: BufferType a => String -> Request a
```

If they were like this, it would be much easier to tell the library to use (Lazy) ByteStrings instead of Strings. The simplest way I could do that with what's in the library at this point is this:

```
request :: URI -> IO ByteString
request url = simpleHTTP (defaultGETRequest_ url) >>= getResponseBody
```

While it's not necessarily ugly or bad, I think it would be much nicer to have polymorphic `getRequest`/`postRequest` functions.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.