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

Safe Haskell | None
Language | Haskell2010

Debian.Relation.String

Contents

- Types
- Helper Functions
- Relation Parser
- Orphan instances

Description

A module for working with debian relationships http://www.debian.org/doc/debian-policy/ch-relationships.html

Synopsis

- type AndRelation = [OrRelation]
- type OrRelation = [Relation]
- type Relations = AndRelation
- data Relation where
  - RRel BinPkgName (Maybe VersionReq) (Maybe ArchitectureReq) [RestrictionList]
  - pattern Rel :: BinPkgName -> Maybe VersionReq -> Maybe ArchitectureReq -> Relation
- data ArchitectureReq
  - = ArchOnly (Set Arch)
  - | ArchExcept (Set Arch)
- data VersionReq
  - = SLT DebianVersion
  - | LTE DebianVersion
  - | EEQ DebianVersion
  - | GRE DebianVersion
  - | SGR DebianVersion
- checkVersionReq :: Maybe VersionReq -> Maybe DebianVersion -> Bool
- type RelParser a = CharParser () a
- class ParseRelations a where
  - parseRelations :: a -> Either ParseError Relations
- pRelations :: RelParser Relations

# Types

type AndRelation = [OrRelation] Source #

type OrRelation = [Relation] Source #

type Relations = AndRelation Source #

data Relation Source #

Constructors

RRel BinPkgName (Maybe VersionReq) (Maybe ArchitectureReq) [RestrictionList] |

Bundled Patterns

pattern Rel :: BinPkgName -> Maybe VersionReq -> Maybe ArchitectureReq -> Relation | Deprecated: Switch to RRel

#### Instances

Instances details

Read Relation Source # |
Instance details Defined in Debian.Relation.Common Methods readsPrec :: Int -> ReadS Relation Source # readList :: ReadS [Relation] Source # readPrec :: ReadPrec Relation Source # readListPrec :: ReadPrec [Relation] Source #
Show Relation Source # |
Instance details Defined in Debian.Relation.Common Methods showsPrec :: Int -> Relation -> ShowS Source # show :: Relation -> String Source # showList :: [Relation] -> ShowS Source #
Eq Relation Source # |
Instance details Defined in Debian.Relation.Common Methods (==) :: Relation -> Relation -> Bool Source # (/=) :: Relation -> Relation -> Bool Source #
Ord Relation Source # |
Instance details Defined in Debian.Relation.Common Methods compare :: Relation -> Relation -> Ordering Source # (<) :: Relation -> Relation -> Bool Source # (<=) :: Relation -> Relation -> Bool Source # (>) :: Relation -> Relation -> Bool Source # (>=) :: Relation -> Relation -> Bool Source # max :: Relation -> Relation -> Relation Source # min :: Relation -> Relation -> Relation Source #
Pretty (PP OrRelation) Source # |
Instance details Defined in Debian.Relation.Common Methods pretty :: PP OrRelation -> Doc Source # prettyVersioned :: CabalSpecVersion -> PP OrRelation -> Doc Source #
Pretty (PP Relation) Source # |
Instance details Defined in Debian.Relation.Common Methods pretty :: PP Relation -> Doc Source # prettyVersioned :: CabalSpecVersion -> PP Relation -> Doc Source #
Pretty (PP Relations) Source # | Wrap `PP` around type synonyms that might overlap with the `Pretty [a]` instance.
Instance details Defined in Debian.Relation.Common Methods pretty :: PP Relations -> Doc Source # prettyVersioned :: CabalSpecVersion -> PP Relations -> Doc Source #

data ArchitectureReq Source #

Constructors

ArchOnly (Set Arch) |
ArchExcept (Set Arch) |

#### Instances

Instances details

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

Instance details

Defined in Debian.Relation.Common

Methods

compare :: ArchitectureReq -> ArchitectureReq -> Ordering Source #

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

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

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

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

max :: ArchitectureReq -> ArchitectureReq -> ArchitectureReq Source #

min :: ArchitectureReq -> ArchitectureReq -> ArchitectureReq Source #

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

data VersionReq Source #

Constructors

SLT DebianVersion |
LTE DebianVersion |
EEQ DebianVersion |
GRE DebianVersion |
SGR DebianVersion |

#### Instances

Instances details

Read VersionReq Source # |
Instance details Defined in Debian.Relation.Common Methods readsPrec :: Int -> ReadS VersionReq Source # readList :: ReadS [VersionReq] Source # readPrec :: ReadPrec VersionReq Source # readListPrec :: ReadPrec [VersionReq] Source #
Show VersionReq Source # |
Instance details Defined in Debian.Relation.Common Methods showsPrec :: Int -> VersionReq -> ShowS Source # show :: VersionReq -> String Source # showList :: [VersionReq] -> ShowS Source #
Eq VersionReq Source # |
Instance details Defined in Debian.Relation.Common Methods (==) :: VersionReq -> VersionReq -> Bool Source # (/=) :: VersionReq -> VersionReq -> Bool Source #
Ord VersionReq Source # | The sort order is based on version number first, then on the kind of relation, sorting in the order

Instance details

Defined in Debian.Relation.Common

Methods

compare :: VersionReq -> VersionReq -> Ordering Source #

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

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

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

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

max :: VersionReq -> VersionReq -> VersionReq Source #

min :: VersionReq -> VersionReq -> VersionReq Source #

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

# Helper Functions

checkVersionReq :: Maybe VersionReq -> Maybe DebianVersion -> Bool Source #

Check if a version number satisfies a version requirement.

# Relation Parser

type RelParser a = CharParser () a Source #

class ParseRelations a where Source #

Methods

parseRelations :: a -> Either ParseError Relations Source #

`parseRelations` parse a debian relation (i.e. the value of a Depends field). Return a parsec error or a value of type `Relations`

#### Instances

Instances details

ParseRelations ByteString Source # |
Instance details Defined in Debian.Relation.ByteString Methods parseRelations :: ByteString -> Either ParseError Relations Source #
ParseRelations Text Source # |
Instance details Defined in Debian.Relation.Text Methods parseRelations :: Text -> Either ParseError Relations Source #
ParseRelations String Source # |
Instance details Defined in Debian.Relation.String Methods parseRelations :: String -> Either ParseError Relations Source #

pRelations :: RelParser Relations Source #

# Orphan instances

ParseRelations String Source # |
Instance details Methods parseRelations :: String -> Either ParseError Relations Source #