Skip to content

Commit

Permalink
Sort by version number when generating the Appendix A link
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronp24 committed May 31, 2022
1 parent 61500af commit b947f2e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions NVVersionParser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ newtype Version = Version String
deriving Eq

data Driver = Driver {
version :: Version,
branch :: Branch,
maturity :: Maturity,
version :: Version
maturity :: Maturity
} deriving (Show, Eq, Ord)

-- Version helper functions
Expand Down Expand Up @@ -74,7 +74,7 @@ versionEntry = do
space
ver <- parseVersion
manyTill anyChar newline
return (Driver br mat ver)
return (Driver ver br mat)

parseWord = many1 (alphaNum <|> oneOf "._")

Expand Down
4 changes: 2 additions & 2 deletions generate-stuff.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ toMap :: [Driver] -> Map Key Version
toMap versions =
Map.fromList (map split versions)
where
split (Driver br mat ver) = ((br, mat), ver)
split (Driver ver br mat) = ((br, mat), ver)

-- If key is a member of the given map, look it up and pass the result
-- to a function that returns an IO action. Otherwise, do nothing.
Expand Down Expand Up @@ -111,7 +111,7 @@ main = do
Right versions <- parseVersionFile
let verMap = toMap versions
let showVer = printVerLine verMap
let (_, newest) = Map.findMax verMap
let (Driver newest _ _) = maximum versions

generateForumPostTemplate (show newest)
putStrLn ""
Expand Down

0 comments on commit b947f2e

Please sign in to comment.