Link to FAQ; give age of LTS snapshots

This commit is contained in:
Michael Snoyman 2017-01-28 19:30:08 +02:00
parent 7e44c31152
commit cc1dc6ffe5
2 changed files with 13 additions and 7 deletions

View File

@ -790,7 +790,7 @@ getPackageCount :: GetStackageDatabase m
getPackageCount sid = run $ count [SnapshotPackageSnapshot ==. sid]
getLatestLtsByGhc :: GetStackageDatabase m
=> m [(Int, Int, Text)]
=> m [(Int, Int, Text, Day)]
getLatestLtsByGhc = run $ fmap (dedupe . map toTuple) $ do
E.select $ E.from $ \(lts `E.InnerJoin` snapshot) -> do
E.on $ lts E.^. LtsSnap E.==. snapshot E.^. SnapshotId
@ -799,9 +799,9 @@ getLatestLtsByGhc = run $ fmap (dedupe . map toTuple) $ do
return (lts, snapshot)
where
toTuple (Entity _ lts, Entity _ snapshot) =
(ltsMajor lts, ltsMinor lts, snapshotGhc snapshot)
(ltsMajor lts, ltsMinor lts, snapshotGhc snapshot, snapshotCreated snapshot)
dedupe [] = []
dedupe (x:xs) = x : dedupe (dropWhile (\y -> thd x == thd y) xs)
thd (_, _, x) = x
thd (_, _, x, _) = x

View File

@ -33,11 +33,16 @@
bleeding-edge nightly release.
<p>
<a href="https://www.stackage.org/lts">
<a href="/lts">
LTS Haskell
<p>
<a href="https://www.stackage.org/nightly">
<a href="/nightly">
Stackage Nightly
<p>
Have more questions? We have a #
<a href="https://github.com/fpco/stackage#frequently-asked-questions">FAQ section on Github
.
<h3>
Related initiatives
<p>
@ -51,9 +56,10 @@
<h3>
Latest LTS per GHC version
<ul>
$forall (major, minor, ghc) <- latestLtsByGhc
$forall (major, minor, ghc, date) <- latestLtsByGhc
<li>
<a href=@{SnapshotR (SNLts major minor) StackageHomeR}>LTS #{major}.#{minor} for GHC #{ghc}
<a href=@{SnapshotR (SNLts major minor) StackageHomeR}>LTS #{major}.#{minor} for GHC #{ghc}#
\, published #{dateDiff now' date}
<h3>
Package Maintainers
<p>