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

Fails to compile with GHC 7.0.4 #82

Closed hvr closed 9 years ago

hvr commented 9 years ago

cabal install http-streams on GHC 7.0.4 fails with

Configuring http-streams-0.7.2.6...
Preprocessing library http-streams-0.7.2.6...
Preprocessing test suites for http-streams-0.7.2.6...
Building http-streams-0.7.2.6...

lib/Network/Http/Utilities.hs:27:14:
    Unsupported extension: Trustworthy
Failed to install http-streams-0.7.2.6
cabal: Error: some packages failed to install:
http-streams-0.7.2.6 failed during the building phase. The exception was:
ExitFailure 1

It works fine in GHC 7.2.2 though. Hence, if you don't want to support GHC 7.0.4 anymore, please set a lower bound base >= 4.4 in future http-streams releases

hvr commented 9 years ago

Alternatively, wrapping that {-# LANGUAGE Trustworthy #-} with an #ifdef __GLASGOW_HASKELL__ >= 702 restores GHC 7.0 support

istathar commented 9 years ago

@hvr Does {-# LANGUAGE Trustworthy #-} actually do anything?

hvr commented 9 years ago

pinging @dterei ... :-)

dterei commented 9 years ago

@afcowie, in this situation, not really. Trustworthy in general declares that despite using things like unsafePerformIO, this module only exports an interface that is type-safe. That is, by importing this module alone, I couldn't write type unsafe functions.

Now this only really matters if other users depend on your code and want assurances of type safety. This is exactly the point of safe haskell.

The module though, Utilities is not an exposed module to users. And the other module, Client, which is exposed is unsafe anyway. So you may as well just remove Trustworthy at this point.