semver 0.3.1 → 0.3.2
raw patch · 6 files changed
+25/−16 lines, 6 files
Files
- bench/Main.hs +1/−1
- semver.cabal +2/−2
- src/Data/SemVer.hs +1/−1
- src/Data/SemVer/Delimited.hs +1/−1
- src/Data/SemVer/Internal.hs +19/−10
- test/Main.hs +1/−1
bench/Main.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE OverloadedStrings #-} -- Module : Main--- Copyright : (c) 2014 Brendan Hay <brendan.g.hay@gmail.com>+-- Copyright : (c) 2014-2015 Brendan Hay <brendan.g.hay@gmail.com> -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v. 2.0. -- A copy of the MPL can be found in the LICENSE file or
semver.cabal view
@@ -1,12 +1,12 @@ name: semver-version: 0.3.1+version: 0.3.2 synopsis: Representation, manipulation, and de/serialisation of Semantic Versions. homepage: https://github.com/brendanhay/semver license: OtherLicense license-file: LICENSE author: Brendan Hay maintainer: Brendan Hay <brendan.g.hay@gmail.com>-copyright: Copyright (c) 2014 Brendan Hay+copyright: Copyright (c) 2014-2014 Brendan Hay category: Data build-type: Simple extra-source-files: README.md
src/Data/SemVer.hs view
@@ -1,5 +1,5 @@ -- Module : Data.SemVer--- Copyright : (c) 2014 Brendan Hay <brendan.g.hay@gmail.com>+-- Copyright : (c) 2014-2015 Brendan Hay <brendan.g.hay@gmail.com> -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v. 2.0. -- A copy of the MPL can be found in the LICENSE file or
src/Data/SemVer/Delimited.hs view
@@ -2,7 +2,7 @@ {-# LANGUAGE RecordWildCards #-} -- Module : Data.SemVer.Delimited--- Copyright : (c) 2014 Brendan Hay <brendan.g.hay@gmail.com>+-- Copyright : (c) 2014-2015 Brendan Hay <brendan.g.hay@gmail.com> -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v. 2.0. -- A copy of the MPL can be found in the LICENSE file or
src/Data/SemVer/Internal.hs view
@@ -2,7 +2,7 @@ {-# LANGUAGE RecordWildCards #-} -- Module : Data.SemVer.Internal--- Copyright : (c) 2014 Brendan Hay <brendan.g.hay@gmail.com>+-- Copyright : (c) 2014-2015 Brendan Hay <brendan.g.hay@gmail.com> -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v. 2.0. -- A copy of the MPL can be found in the LICENSE file or@@ -13,14 +13,14 @@ module Data.SemVer.Internal where -import Control.Applicative-import Control.DeepSeq-import Control.Monad-import Data.Attoparsec.Text-import Data.Function (on)-import Data.List (intersperse)-import Data.Monoid-import Data.Text (Text)+import Control.Applicative+import Control.DeepSeq+import Control.Monad+import Data.Attoparsec.Text+import Data.Function (on)+import Data.List (intersperse)+import Data.Monoid+import Data.Text (Text) -- | An opaque type representing a successfully decoded or constructed -- semantic version. See the related functions and lenses for modification and@@ -40,13 +40,22 @@ } deriving (Eq, Show) instance Ord Version where- compare a b = on compare versions a b <> on compare _versionRelease a b+ compare a b = on compare versions a b <> release where versions Version{..} = [ _versionMajor , _versionMinor , _versionPatch ]++ -- | Compare version releases.+ --+ -- Note: Contrary to 'List's, @[] `compare` [xs]@ equals to @GT@+ release =+ case (_versionRelease a, _versionRelease b) of+ ([], _) -> GT+ (_, []) -> LT+ (x, y) -> x `compare` y instance NFData Version where rnf Version{..} =
test/Main.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE OverloadedStrings #-} -- Module : Main--- Copyright : (c) 2014 Brendan Hay <brendan.g.hay@gmail.com>+-- Copyright : (c) 2014-2015 Brendan Hay <brendan.g.hay@gmail.com> -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v. 2.0. -- A copy of the MPL can be found in the LICENSE file or