debian-4.1.2: Modules for working with the Debian package system

Safe Haskell | Safe-Inferred
Language | Haskell2010

Debian.Version.Common

Contents

- Orphan instances

Description

A module for parsing, comparing, and (eventually) modifying debian version numbers. http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version

Synopsis

- data DebianVersion
- prettyDebianVersion :: DebianVersion -> Doc
- class ParseDebianVersion a where
  - parseDebianVersion :: a -> Either ParseError DebianVersion
- parseDebianVersion' :: ParseDebianVersion string => string -> DebianVersion
- evr :: DebianVersion -> (Maybe Int, String, Maybe String)
- epoch :: DebianVersion -> Maybe Int
- version :: DebianVersion -> String
- revision :: DebianVersion -> Maybe String
- buildDebianVersion :: Maybe Int -> String -> Maybe String -> DebianVersion
- parseDV :: CharParser () (Found Int, NonNumeric, Found NonNumeric)

# Documentation

data DebianVersion Source #

#### Instances

Instances details

Data DebianVersion Source # |

Instance details

Defined in Debian.Version.Internal

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DebianVersion -> c DebianVersion Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DebianVersion Source #

toConstr :: DebianVersion -> Constr Source #

dataTypeOf :: DebianVersion -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DebianVersion) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DebianVersion) Source #

gmapT :: (forall b. Data b => b -> b) -> DebianVersion -> DebianVersion Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DebianVersion -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DebianVersion -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DebianVersion -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DebianVersion -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DebianVersion -> m DebianVersion Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DebianVersion -> m DebianVersion Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DebianVersion -> m DebianVersion Source #

Read DebianVersion Source # |
Instance details Defined in Debian.Version.String Methods readsPrec :: Int -> ReadS DebianVersion Source # readList :: ReadS [DebianVersion] Source # readPrec :: ReadPrec DebianVersion Source # readListPrec :: ReadPrec [DebianVersion] Source #
Show DebianVersion Source # |
Instance details Defined in Debian.Version.Common Methods showsPrec :: Int -> DebianVersion -> ShowS Source # show :: DebianVersion -> String Source # showList :: [DebianVersion] -> ShowS Source #
Eq DebianVersion Source # |
Instance details Defined in Debian.Version.Common Methods (==) :: DebianVersion -> DebianVersion -> Bool Source # (/=) :: DebianVersion -> DebianVersion -> Bool Source #
Ord DebianVersion Source # |

Instance details

Defined in Debian.Version.Common

Methods

compare :: DebianVersion -> DebianVersion -> Ordering Source #

(<) :: DebianVersion -> DebianVersion -> Bool Source #

(<=) :: DebianVersion -> DebianVersion -> Bool Source #

(>) :: DebianVersion -> DebianVersion -> Bool Source #

(>=) :: DebianVersion -> DebianVersion -> Bool Source #

max :: DebianVersion -> DebianVersion -> DebianVersion Source #

min :: DebianVersion -> DebianVersion -> DebianVersion Source #

Pretty (PP DebianVersion) Source # |
Instance details Defined in Debian.Version.Common Methods pretty :: PP DebianVersion -> Doc Source # prettyVersioned :: CabalSpecVersion -> PP DebianVersion -> Doc Source #

Exported abstract because the internal representation is likely to change

prettyDebianVersion :: DebianVersion -> Doc Source #

class ParseDebianVersion a where Source #

Methods

parseDebianVersion :: a -> Either ParseError DebianVersion Source #

#### Instances

Instances details

ParseDebianVersion ByteString Source # |
Instance details Defined in Debian.Version.ByteString Methods parseDebianVersion :: ByteString -> Either ParseError DebianVersion Source #
ParseDebianVersion Text Source # |
Instance details Defined in Debian.Version.Text Methods parseDebianVersion :: Text -> Either ParseError DebianVersion Source #
ParseDebianVersion String Source # |
Instance details Defined in Debian.Version.String Methods parseDebianVersion :: String -> Either ParseError DebianVersion Source #

parseDebianVersion' :: ParseDebianVersion string => string -> DebianVersion Source #

Convert a string to a debian version number. May throw an exception if the string is unparsable -- but I am not sure if that can currently happen. Are there any invalid version strings? Perhaps ones with underscore, or something?

evr :: DebianVersion -> (Maybe Int, String, Maybe String) Source #

Split a DebianVersion into its three components: epoch, version, revision. It is not safe to use the parsed version number for this because you will lose information, such as leading zeros.

epoch :: DebianVersion -> Maybe Int Source #

version :: DebianVersion -> String Source #

revision :: DebianVersion -> Maybe String Source #

buildDebianVersion :: Maybe Int -> String -> Maybe String -> DebianVersion Source #

parseDV :: CharParser () (Found Int, NonNumeric, Found NonNumeric) Source #

# Orphan instances

Show DebianVersion Source # |
Instance details Methods showsPrec :: Int -> DebianVersion -> ShowS Source # show :: DebianVersion -> String Source # showList :: [DebianVersion] -> ShowS Source #
Eq DebianVersion Source # |
Instance details Methods (==) :: DebianVersion -> DebianVersion -> Bool Source # (/=) :: DebianVersion -> DebianVersion -> Bool Source #
Ord DebianVersion Source # |

Instance details

Methods

compare :: DebianVersion -> DebianVersion -> Ordering Source #

(<) :: DebianVersion -> DebianVersion -> Bool Source #

(<=) :: DebianVersion -> DebianVersion -> Bool Source #

(>) :: DebianVersion -> DebianVersion -> Bool Source #

(>=) :: DebianVersion -> DebianVersion -> Bool Source #

max :: DebianVersion -> DebianVersion -> DebianVersion Source #

min :: DebianVersion -> DebianVersion -> DebianVersion Source #

Pretty (PP DebianVersion) Source # |
Instance details Methods pretty :: PP DebianVersion -> Doc Source # prettyVersioned :: CabalSpecVersion -> PP DebianVersion -> Doc Source #