sloane 4.1.2 → 4.2.0
raw patch · 5 files changed
+19/−19 lines, 5 filesdep ~http-conduit
Dependency ranges changed: http-conduit
Files
- Sloane/Config.hs +1/−1
- Sloane/Download.hs +10/−13
- sloane.1 +4/−1
- sloane.cabal +3/−3
- sloane.hs +1/−1
Sloane/Config.hs view
@@ -35,7 +35,7 @@ w <- maybe maxBound width `fmap` size h <- getHomeDirectory let c = Config { home = h- , sloaneDir = h </> ".sloane"+ , sloaneDir = h </> ".oeis-data" , seqDBPath = sloaneDir c </> "stripped" , namesDBPath = sloaneDir c </> "names" , termWidth = w
Sloane/Download.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} -- | -- Copyright : Anders Claesson 2015 -- Maintainer : Anders Claesson <anders.claesson@gmail.com>@@ -16,21 +15,11 @@ import Network.HTTP.Conduit hiding (Proxy) import Network.HTTP.Types (hContentLength) import Control.Monad.IO.Class (liftIO)-import Control.Monad.Trans.Resource (runResourceT)-#if __GLASGOW_HASKELL__ < 710-import Control.Applicative-#endif import Sloane.OEIS (URL) import System.Console.ANSI import System.IO---- | Request a page at a given URL with specified key-value pairs (query--- string).-requestPage :: URL -> [(ByteString, ByteString)] -> IO ByteString-requestPage url kvs = do- req <- liftIO $ setQueryString [(k, Just v) | (k,v) <- kvs] <$> parseUrl url- man <- newManager tlsManagerSettings- BL.toStrict . responseBody <$> httpLbs req man+import Control.Applicative+import Control.Monad.Trans.Resource (runResourceT) -- | Download a file at a given URL showing a progress indicator at the -- given column, and save it at a specified path.@@ -52,3 +41,11 @@ liftIO $ hFlush stdout yield chunk progress total acc')++-- | Request a page at a given URL with specified key-value pairs (query+-- string).+requestPage :: URL -> [(ByteString, ByteString)] -> IO ByteString+requestPage url kvs = do+ req <- liftIO $ setQueryString [(k, Just v) | (k,v) <- kvs] <$> parseUrl url+ man <- newManager tlsManagerSettings+ BL.toStrict . responseBody <$> httpLbs req man
sloane.1 view
@@ -1,4 +1,7 @@-.TH "SLOANE" "1" "4 Sep 2015" "User Manual" "Version 4.1.1"+.\" Automatically generated by Pandoc 1.15.1+.\"+.hy+.TH "SLOANE" "1" "4 Sep 2015" "User Manual" "Version 4.2.0" .SH NAME .PP sloane \- lookup integer sequences, OEIS A\-numbers, etc.
sloane.cabal view
@@ -1,11 +1,11 @@ Name: sloane-Version: 4.1.2+Version: 4.2.0 Synopsis: A command line interface to Sloane's OEIS. Description: A command line interface to Sloane's On-Line Encyclopedia of Integer Sequences with offline capabilities. -Homepage: http://github.com/akc/sloane+Homepage: http://akc.is/sloane License: BSD3 License-file: LICENSE Author: Anders Claesson@@ -45,7 +45,7 @@ containers >=0.5, directory >=1.2, filepath >=1.3,- http-conduit >=2,+ http-conduit >=2.1.7, http-types >=0.8, optparse-applicative >=0.10, stringsearch >=0.3,
sloane.hs view
@@ -36,7 +36,7 @@ import Sloane.Bloom import Sloane.DB -nameVer = "sloane 4.1.2" :: String+nameVer = "sloane 4.2.0" :: String oeisURL = "https://oeis.org/search" :: URL strpdURL = "https://oeis.org/stripped.gz" :: URL namesURL = "https://oeis.org/names.gz" :: URL