Skip to content

Commit

Permalink
Add support for summoning GHC 9.2.8 9.4.5 9.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
noughtmare committed Aug 10, 2023
1 parent 30b5604 commit 1a84038
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions summoner-cli/src/Summoner/GhcVer.hs
Expand Up @@ -37,6 +37,9 @@ data GhcVer
| Ghc884
| Ghc8107
| Ghc902
| Ghc928
| Ghc945
| Ghc962
deriving stock (Eq, Ord, Show, Enum, Bounded)

-- | Converts 'GhcVer' into dot-separated string.
Expand All @@ -49,6 +52,9 @@ showGhcVer = \case
Ghc884 -> "8.8.4"
Ghc8107 -> "8.10.7"
Ghc902 -> "9.0.2"
Ghc928 -> "9.2.8"
Ghc945 -> "9.4.5"
Ghc962 -> "9.6.2"

{- | These are old GHC versions that are not working with default GHC versions
when using Stack.
Expand All @@ -67,8 +73,11 @@ latestLts = \case
Ghc844 -> "lts-12.26"
Ghc865 -> "lts-14.27"
Ghc884 -> "lts-16.31"
Ghc8107 -> "lts-18.21"
Ghc902 -> "nightly-2022-01-10"
Ghc8107 -> "lts-18.28"
Ghc902 -> "lts-19.33"
Ghc928 -> "lts-20.26"
Ghc945 -> "lts-21.6"
Ghc962 -> "nightly-2023-08-09"

-- | Represents PVP versioning (4 numbers).
data Pvp = Pvp
Expand All @@ -92,6 +101,9 @@ baseVerPvp = \case
Ghc884 -> Pvp 4 13 0 0
Ghc8107 -> Pvp 4 14 3 0
Ghc902 -> Pvp 4 15 1 0
Ghc928 -> Pvp 4 16 4 0
Ghc945 -> Pvp 4 17 0 0
Ghc962 -> Pvp 4 18 0 0

-- | Returns corresponding @base@ version of the given GHC version.
baseVer :: GhcVer -> Text
Expand Down

0 comments on commit 1a84038

Please sign in to comment.