packages feed

versions 3.1.0.1 → 3.1.1

raw patch · 3 files changed

+22/−8 lines, 3 filesdep +deepseqdep +hashable

Dependencies added: deepseq, hashable

Files

CHANGELOG.md view
@@ -1,6 +1,13 @@ Changelog ========= +3.1.1+-----+- Added instances for common typeclasses: `Generic`, `NFData`, and+  `Hashable`. This is to avoid having users define these instances themselves+  as orphans. If there are more instances you want added, please let me know.+  `Data` was left out on purpose.+ 3.1.0 ----- - Added support for *epoch* numbers in the `Version` type. These are numbers
Data/Versions.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE DeriveGeneric, DeriveAnyClass #-}  -- | -- Module    : Data.Versions@@ -86,9 +87,12 @@     , _Digits     , _Str ) where +import Control.DeepSeq+import Data.Hashable import Data.List (intersperse) import Data.Monoid import Data.Text (Text,pack,snoc)+import GHC.Generics import Text.Megaparsec import Text.Megaparsec.Text @@ -98,7 +102,8 @@ -- types. This allows each subtype to have its own parser, and for said -- parsers to be composed. This is useful for specifying custom behaviour -- for when a certain parser fails.-data Versioning = Ideal SemVer | General Version | Complex Mess deriving (Eq,Show)+data Versioning = Ideal SemVer | General Version | Complex Mess+  deriving (Eq,Show,Generic,NFData,Hashable)  -- | Comparison of @Ideal@s is always well defined. --@@ -188,7 +193,7 @@                      , _svMinor  :: Int                      , _svPatch  :: Int                      , _svPreRel :: [VChunk]-                     , _svMeta   :: [VChunk] } deriving (Show)+                     , _svMeta   :: [VChunk] } deriving (Show,Generic,NFData,Hashable)  -- | Two SemVers are equal if all fields except metadata are equal. instance Eq SemVer where@@ -240,7 +245,7 @@ -- | A single unit of a Version. May be digits or a string of characters. -- Groups of these are called `VChunk`s, and are the identifiers separated -- by periods in the source.-data VUnit = Digits Int | Str Text deriving (Eq,Show,Read,Ord)+data VUnit = Digits Int | Str Text deriving (Eq,Show,Read,Ord,Generic,NFData,Hashable)  -- | > _Digits :: Traversal' VUnit Int _Digits :: Applicative f => (Int -> f Int) -> VUnit -> f VUnit@@ -267,7 +272,7 @@ -- Examples of @Version@ that are not @SemVer@: 0.25-2, 8.u51-1, 20150826-1, 1:2.3.4 data Version = Version { _vEpoch  :: Maybe Int                        , _vChunks :: [VChunk]-                       , _vRel    :: [VChunk] } deriving (Eq,Show)+                       , _vRel    :: [VChunk] } deriving (Eq,Show,Generic,NFData,Hashable)  -- | Set a `Version`'s epoch to `Nothing`. wipe :: Version -> Version@@ -353,7 +358,7 @@ -- -- Not guaranteed to have well-defined ordering (@Ord@) behaviour, -- but so far internal tests show consistency.-data Mess = VLeaf [Text] | VNode [Text] VSep Mess deriving (Eq,Show)+data Mess = VLeaf [Text] | VNode [Text] VSep Mess deriving (Eq,Show,Generic,NFData,Hashable)  instance Ord Mess where   compare (VLeaf l1) (VLeaf l2)     = compare l1 l2@@ -370,7 +375,7 @@ -- * A hyphen (-). -- * A plus (+). Stop using this outside of metadata if you are. Example: @10.2+0.93+1-1@ -- * An underscore (_). Stop using this if you are.-data VSep = VColon | VHyphen | VPlus | VUnder deriving (Eq,Show)+data VSep = VColon | VHyphen | VPlus | VUnder deriving (Eq,Show,Generic,NFData,Hashable)  -- | A synonym for the more verbose `megaparsec` error type. type ParsingError = ParseError (Token Text) Dec
versions.cabal view
@@ -1,9 +1,9 @@--- This file has been generated from package.yaml by hpack version 0.17.0.+-- This file has been generated from package.yaml by hpack version 0.17.1. -- -- see: https://github.com/sol/hpack  name:           versions-version:        3.1.0.1+version:        3.1.1 synopsis:       Types and parsers for software version numbers. description:    A library for parsing and comparing software version numbers.                 We like to give version numbers to our software in a myriad of@@ -45,6 +45,8 @@       base >=4.8 && <4.10     , text >=1.2 && <1.3     , megaparsec >=4 && <6+    , deepseq >= 1.4 && < 1.5+    , hashable >= 1.2 && < 1.3   default-language: Haskell2010   ghc-options: -fwarn-unused-imports -fwarn-unused-binds -fwarn-name-shadowing -fwarn-unused-matches