hsec-core-0.2.0.2: Core package representing Haskell advisories
Safe HaskellSafe-Inferred
LanguageHaskell2010

Security.Advisories.Core.HsecId

Synopsis

Documentation

data HsecId Source #

Instances

Instances details
Show HsecId Source # 
Instance details

Defined in Security.Advisories.Core.HsecId

Eq HsecId Source # 
Instance details

Defined in Security.Advisories.Core.HsecId

Methods

(==) :: HsecId -> HsecId -> Bool #

(/=) :: HsecId -> HsecId -> Bool #

Ord HsecId Source # 
Instance details

Defined in Security.Advisories.Core.HsecId

mkHsecId Source #

Arguments

:: Integer

Year

-> Integer

Serial number within year

-> Maybe HsecId 

Make an HsecId. Year and serial must both be positive, or else both must be zero (the placeholder).

placeholder :: HsecId Source #

The placeholder ID: HSEC-0000-0000. See also isPlaceholder.

isPlaceholder :: HsecId -> Bool Source #

Test whether an ID is the placeholder

parseHsecId :: String -> Maybe HsecId Source #

Parse an HsecId. The placeholder is accepted.

nextHsecId Source #

Arguments

:: Integer

Current year

-> HsecId 
-> HsecId 

Given a year and an HSEC ID, return a larger HSEC ID. This function, when given the current year and the greatest allocated HSEC ID, returns the next HSEC ID to allocate.

getNextHsecId :: HsecId -> IO HsecId Source #

Get the current time, and return an HSEC ID greater than the given HSEC ID. The year of the returned HSEC ID is the current year.