packages feed

stooq-api 0.1.0.0 → 0.2.0.0

raw patch · 3 files changed

+11/−6 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

- Web.Data.Stooq.API: StooqPrice :: String -> UTCTime -> Double -> Double -> Double -> Double -> Int -> Int -> StooqPrice
+ Web.Data.Stooq.API: StooqPrice :: StooqSymbol -> UTCTime -> Double -> Double -> Double -> Double -> Int -> Int -> StooqPrice
- Web.Data.Stooq.API: [symbol] :: StooqPrice -> String
+ Web.Data.Stooq.API: [symbol] :: StooqPrice -> StooqSymbol

Files

CHANGELOG.md view
@@ -1,5 +1,9 @@ # Revision history for stooq +## 0.2.0.0 -- 2022-04-08++* It makes more sense for the `StooqPrice` record to contain a field `symbol` of type `StooqSymbol` instead of `String`.+ ## 0.1.0.0 -- 2022-03-30  * Initial release.
src/lib/Web/Data/Stooq/API.hs view
@@ -12,12 +12,14 @@ -- -- xxxx.DE: Deutsche Börse --+-- xxxx.JP: Tokyo Stock Exchange+-- -- xxxx: (no exchange code after full stop) Warsaw Stock Exchange (GPW) -- -- Use: -- -- >>> fetch "SPY.US"--- Just [StooqPrice {symbol = "SPY.US", time = ..., ...}]+-- Just [StooqPrice {symbol = StooqSymbol "SPY.US", time = ..., ...}] module Web.Data.Stooq.API where  import Control.Lens ((^.))@@ -36,7 +38,7 @@ -- | A type representing market price data returned by Stooq. data StooqPrice =     StooqPrice {-        symbol  :: String,+        symbol  :: StooqSymbol,         time    :: UTCTime,         open    :: Double,         high    :: Double,@@ -62,7 +64,7 @@          toApiType :: Impl.StooqRow -> StooqPrice         toApiType row = StooqPrice {-            symbol  = (unpack . Impl.symbol) row,+            symbol  = (StooqSymbol . unpack . Impl.symbol) row,             time    = localTimeToUTC stooqTimeZone $ LocalTime ((stooqIntToDay . Impl.date) row) ((stooqStringToTime . unpack . Impl.time) row),             open    = Impl.open row,             high    = Impl.high row,@@ -93,4 +95,3 @@ -- | A shorthand around "fetchPrice" that allows to call the function using a plain String, without converting it to a `StooqSymbol` first. fetch :: String -> IO (Maybe [StooqPrice]) fetch = fetchPrice . StooqSymbol-    
stooq-api.cabal view
@@ -1,7 +1,7 @@-cabal-version:      >= 2.0+cabal-version:      2.0  name:               stooq-api-version:            0.1.0.0+version:            0.2.0.0 synopsis:           A simple wrapper around stooq.pl API for downloading market data. description:   Here's a simple wrapper around API offered by Stooq.pl.