stackage-types 1.0.1 → 1.0.1.1
raw patch · 2 files changed
+10/−3 lines, 2 filesdep +safePVP ok
version bump matches the API change (PVP)
Dependencies added: safe
API changes (from Hackage documentation)
Files
- Stackage/Types.hs +8/−2
- stackage-types.cabal +2/−1
Stackage/Types.hs view
@@ -29,7 +29,7 @@ , intersectVersionRanges ) where -import Control.Applicative ((<$>), (<*>))+import Control.Applicative ((<$>), (<*>), (<|>)) import Control.Arrow ((&&&)) import Control.Exception (Exception) import Control.Monad.Catch (MonadThrow, throwM)@@ -58,6 +58,7 @@ import qualified Distribution.Text as DT import Distribution.Version (Version, VersionRange) import qualified Distribution.Version as C+import Safe (readMay) data SnapshotType = STNightly | STNightly2 !Day@@ -81,11 +82,16 @@ parseJSON = withObject "SnapshotType" $ \o -> do t <- o .: "type" case asText t of- "nightly" -> return STNightly+ "nightly" -> (STNightly2 <$> (o .: "date" >>= readFail)) <|> return STNightly "lts" -> STLTS <$> o .: "major" <*> o .: "minor" _ -> fail $ "Unknown type for SnapshotType: " ++ unpack t+ where+ readFail t =+ case readMay t of+ Nothing -> fail "read failed"+ Just x -> return x -- | Package name is key type DocMap = Map Text PackageDocs
stackage-types.cabal view
@@ -1,5 +1,5 @@ name: stackage-types-version: 1.0.1+version: 1.0.1.1 synopsis: Shared data types between various Stackage packages description: For more information, see <https://www.stackage.org/package/stackage-types> homepage: https://github.com/fpco/stackage-types@@ -25,6 +25,7 @@ , unordered-containers , vector , time+ , safe default-language: Haskell2010 source-repository head