From c0ffb22d6af079af54285edfc3fd413ead29d75b Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sun, 1 Oct 2023 14:33:37 +0800 Subject: [PATCH] Improve documentation around tags --- docs/guide.md | 8 ++++++++ lib/GHCup/Types.hs | 17 +++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/docs/guide.md b/docs/guide.md index b2f0cf7..53b0cc3 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -43,6 +43,14 @@ All of the following are valid arguments to `ghcup install ghc`: If the argument is omitted, the default is `recommended`. +Other tags include: + +- `prerelease`: a prerelease version +- `latest-prerelease`: the latest prerelease version +- `nightly`: a nightly version +- `latest-nightly`: the latest nightly version + + ## Manpages For man pages to work you need [man-db](http://man-db.nongnu.org/) as your `man` provider, then issue `man ghc`. Manpages only work for the currently set ghc. diff --git a/lib/GHCup/Types.hs b/lib/GHCup/Types.hs index 3987ce3..4adfa6a 100644 --- a/lib/GHCup/Types.hs +++ b/lib/GHCup/Types.hs @@ -158,12 +158,17 @@ instance NFData VersionInfo -- | A tag. These are currently attached to a version of a tool. data Tag = Latest - | Recommended - | Prerelease - | LatestPrerelease - | Nightly - | LatestNightly - | Base PVP + | Recommended -- ^ the recommended version of a tool + | Prerelease -- ^ denotes a prerelease version + -- (a version should either be 'Prerelease' or + -- 'LatestPrerelease', but not both) + | LatestPrerelease -- ^ the latest prerelease (there should be only + -- one per tool) + | Nightly -- ^ denotes a nightly version + -- (a version should either be 'Nightly' or + -- 'LatestNightly', but not both) + | LatestNightly -- ^ the latest nightly (there should be only one per tool) + | Base PVP -- ^ the base version shipped with GHC | Old -- ^ old versions are hidden by default in TUI | UnknownTag String -- ^ used for upwardscompat deriving (Ord, Eq, GHC.Generic, Show) -- FIXME: manual JSON instance