sloane 2.0.2 → 2.0.3
raw patch · 6 files changed
+18/−13 lines, 6 files
Files
- README.md +1/−1
- Sloane/Config.hs +1/−1
- Sloane/Transform.hs +4/−4
- sloane.1 +1/−1
- sloane.cabal +1/−1
- sloane.hs +10/−5
README.md view
@@ -1,5 +1,5 @@ ----title: SLOANE(1) Sloane User Manual | Version 2.0.2+title: SLOANE(1) Sloane User Manual | Version 2.0.3 date: 7 Jan 2015 ---
Sloane/Config.hs view
@@ -29,7 +29,7 @@ h <- getHomeDirectory let dsloane = h </> ".sloane" return Config- { nameVer = "sloane 2.0.2"+ { nameVer = "sloane 2.0.3" , home = h , sloaneDir = dsloane , sloaneDB = dsloane </> "sloane.db"
Sloane/Transform.hs view
@@ -128,7 +128,7 @@ tM2 = NT "M2" f where f [] = []; f (c:cs) = c : map ((2%1)*) cs tM2i :: NamedTransform-tM2i = NT "M2i" (\cs -> ogfCoeffs (Series (f cs)))+tM2i = NT "M2i" (ogfCoeffs . Series . f) where f [] = [] f cs = let (d:ds) = map toRational cs in d : map (/(2%1)) ds@@ -153,7 +153,7 @@ tCONV = NT "CONV" (\cs -> ogfCoeffs (ogf cs ^ (2::Int))) tCONVi :: NamedTransform-tCONVi = NT "CONVi" (\cs -> ogfCoeffs (squareRoot (ogf cs)))+tCONVi = NT "CONVi" (ogfCoeffs . squareRoot . ogf) tEXPCONV :: NamedTransform tEXPCONV = NT "EXPCONV" (\cs -> egfCoeffs (egf cs ^ (2::Int)))@@ -182,7 +182,7 @@ tMOBIUSi :: NamedTransform tMOBIUSi = NT "MOBIUSi" $ \cs ->- [ sum [ (cs !! (fromInteger k-1)) | k<-[1..n], n `rem` k == 0 ]+ [ sum [ cs !! (fromInteger k-1) | k<-[1..n], n `rem` k == 0 ] | (n,_) <- zip [1..] cs ] @@ -244,7 +244,7 @@ tPARTITION :: NamedTransform tPARTITION = NT "PARTITION" $ \cs -> do guard $ not (null cs) && all (>0) cs && increasing cs- let f = product $ map (\c -> (1 - x^^^c)) (nub cs)+ let f = product $ map (\c -> 1 - x^^^c) (nub cs) drop 1 . ogfCoeffs $ 1/f -- New transform: tSTIELTJES -- continued fraction coefficients
sloane.1 view
@@ -1,4 +1,4 @@-.TH "SLOANE" "1" "7 Jan 2015" "Sloane User Manual" "Version 2.0.1"+.TH "SLOANE" "1" "7 Jan 2015" "Sloane User Manual" "Version 2.0.2" .SH NAME .PP sloane \- a command line interface to Sloane\[aq]s On\-Line Encyclopedia
sloane.cabal view
@@ -1,5 +1,5 @@ Name: sloane-Version: 2.0.2+Version: 2.0.3 Synopsis: A command line interface to Sloane's On-Line Encyclopedia of Integer Sequences Description: A command line interface to Sloane's On-Line Encyclopedia
sloane.hs view
@@ -69,7 +69,6 @@ tr c = if c `elem` ";," then ' ' else c input = map read (words (map tr (unwords (terms opts)))) - dropComment :: Text -> Text dropComment = T.takeWhile (/= '#') @@ -93,7 +92,7 @@ optionsParser :: Parser Options optionsParser =- (abortOption ShowHelpText $ long "help") <*> (Options+ abortOption ShowHelpText (long "help") <*> (Options <$> switch ( short 'a' <> long "all"@@ -151,12 +150,18 @@ getTerms :: Options -> IO Options getTerms opts- | filtr opts = return opts- | otherwise = (\xs -> opts {terms = xs}) <$>+ | dont = return opts+ | otherwise = (\xs -> opts {terms = xs}) <$> case terms opts of [] -> isEOF >>= \b ->- if b then error "<stdin>: end of file" else return <$> getLine+ if b then error "<stdin>: end of file"+ else return <$> getLine ts -> return ts+ where+ dont = or [ filtr opts, anumber opts > 0+ , listTransforms opts, update opts+ , version opts+ ] main :: IO () main = do