aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authoralexwl <alexey.a.kiryushin@gmail.com>2019-05-17 18:43:42 +0300
committeralexwl <alexey.a.kiryushin@gmail.com>2019-05-17 18:43:42 +0300
commit31267d352e329875e647fa422d68b08106a36cf2 (patch)
tree065465d1b252bf688b91828f26c8be52899decd8 /app
parentfabedd76f04b630b29fdbd680aa56a383441e046 (diff)
Code cleanup: fix warnings
Diffstat (limited to 'app')
-rw-r--r--app/Indexer.hs2
-rw-r--r--app/Server.hs10
-rw-r--r--app/Store.hs10
3 files changed, 16 insertions, 6 deletions
diff --git a/app/Indexer.hs b/app/Indexer.hs
index 6284f06..26fad4a 100644
--- a/app/Indexer.hs
+++ b/app/Indexer.hs
@@ -19,7 +19,7 @@ import qualified Data.Serialize as S
import qualified Data.Text as T
import qualified Data.Text.Encoding as TE
import Data.Time (getZonedTime)
-import Data.Version (Version(..),showVersion)
+import Data.Version (showVersion)
import HaskellCodeExplorer.PackageInfo (createPackageInfo, ghcVersion)
import qualified HaskellCodeExplorer.Types as HCE
import Network.URI.Encode (encode)
diff --git a/app/Server.hs b/app/Server.hs
index de2c325..41197b6 100644
--- a/app/Server.hs
+++ b/app/Server.hs
@@ -53,8 +53,6 @@ import Data.Maybe (fromMaybe, mapMaybe)
import qualified Data.Vector as V
#if MIN_VERSION_GLASGOW_HASKELL(8,4,3,0)
import qualified GHC.Compact as C
-#else
-import Data.Functor.Identity(Identity(..))
#endif
import Data.Pagination
( Paginated
@@ -139,7 +137,11 @@ import Servant
)
import Servant.API.ContentTypes (AllCTRender(..), JSON)
import Servant.Server (Handler(..), hoistServer)
+#if MIN_VERSION_servant(0,14,1)
+import Servant.Links (safeLink)
+#else
import Servant.Utils.Links (safeLink)
+#endif
import System.Directory (doesFileExist)
import System.Exit (exitFailure, exitSuccess)
import System.FilePath.Find
@@ -751,7 +753,7 @@ loadPackages _config mbStore
eitherGlobalReferenceMap <*>
eitherGlobalIdentifierMap of
Right res -> return $ Just res
- Left _ -> do
+ Left _ -> do
putStrLn "Store lookup errors : "
let ignoreRight :: Either a b -> Either a ()
ignoreRight = second (const ())
@@ -833,7 +835,7 @@ loadPackages config _ = do
filter isExportedId $
trieValues $ HCE.externalIdInfoMap packageInfo
in L.foldl
- (\trie' exportedId@(HCE.ExternalIdentifierInfo (HCE.IdentifierInfo {HCE.demangledOccName = name})) ->
+ (\trie' exportedId@(HCE.ExternalIdentifierInfo HCE.IdentifierInfo {HCE.demangledOccName = name}) ->
HCE.insertToTrie
S.insert
(T.unpack name)
diff --git a/app/Store.hs b/app/Store.hs
index 495f190..15f5736 100644
--- a/app/Store.hs
+++ b/app/Store.hs
@@ -23,7 +23,15 @@ import qualified Data.ByteString as BS
import qualified Data.ByteString.Short as BSS
import Data.Either (Either)
import qualified Data.Map.Strict as M
-import Data.Serialize (Serialize, decode, encode, get, put)
+import Data.Serialize (
+ Serialize,
+ decode,
+ encode,
+#if MIN_VERSION_cereal(0,5,8)
+#else
+ get, put
+#endif
+ )
import GHC.Generics (Generic)
import Prelude hiding (lookup)
import System.Directory (doesFileExist)