diff options
author | sternenseemann <git@lukasepple.de> | 2017-01-01 01:57:55 +0100 |
---|---|---|
committer | sternenseemann <git@lukasepple.de> | 2017-01-01 01:57:55 +0100 |
commit | 2ecbf3bd212b322419e4222493a3ae35c9aceb3a (patch) | |
tree | da52b58c6efb93e13c85a5de11f9af51c6fe5559 | |
parent | 57a05a1740ca41cccf58f728c89a09bc26c915cc (diff) |
Fix compatibility issue with network < 2.6.3
-rw-r--r-- | gopher-proxy.cabal | 1 | ||||
-rw-r--r-- | src/GopherProxy/Params.hs | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/gopher-proxy.cabal b/gopher-proxy.cabal index 66bcf65..82461d1 100644 --- a/gopher-proxy.cabal +++ b/gopher-proxy.cabal @@ -16,6 +16,7 @@ cabal-version: >=1.10 executable gopher-proxy main-is: Main.hs + default-extensions: CPP -- other-modules: -- other-extensions: build-depends: base diff --git a/src/GopherProxy/Params.hs b/src/GopherProxy/Params.hs index e919e81..c99d099 100644 --- a/src/GopherProxy/Params.hs +++ b/src/GopherProxy/Params.hs @@ -59,3 +59,9 @@ params = Params optionalWithDefault :: a -> Parser a -> Parser a optionalWithDefault def p = fromMaybe def <$> optional p + +-- Thanks enum! <3 +#if !MIN_VERSION_network(2,6,3) +instance Read PortNumber where + readsPrec i str = fmap (\(i,str) -> (fromInteger i,str)) $ readsPrec i str +#endif |