aesiniath / http-streams

Haskell HTTP client library for use with io-streams
https://hackage.haskell.org/package/http-streams
BSD 3-Clause "New" or "Revised" License
50 stars 48 forks source link

Convert to build-type Simple #109

Closed hvr closed 6 years ago

istathar commented 6 years ago

Oh, cool. Thanks @hvr . The other thing I was pulling out of the custom Setup.hs was the package version number used for the User-Agent: HTTP header. Any idea where I can get that at build time?

hvr commented 6 years ago

@afcowie for that you have two options: either the Paths_ module which gives you a version :: Version, or just use VERSION_http_streams, which is a CPP macro (provided by Cabal and GHC) that expands into a string-literal like "1.2.3"

istathar commented 6 years ago

Huh. Turns out I lost the User-Agent setting code ages ago when I refactored out http-common from http-streams. Oops. Well, I'll restore that, but in another branch. Merging.