diff --git a/lib-opt/GHCup/OptParse/Common.hs b/lib-opt/GHCup/OptParse/Common.hs index fd1dee3e..7853398a 100644 --- a/lib-opt/GHCup/OptParse/Common.hs +++ b/lib-opt/GHCup/OptParse/Common.hs @@ -182,7 +182,7 @@ platformParser s' = case MP.parse (platformP <* MP.eof) "" (T.pack s') of Left e -> Left $ errorBundlePretty e where archP :: MP.Parsec Void Text Architecture - archP = MP.try (MP.chunk "x86_64" $> A_64) <|> (MP.chunk "i386" $> A_32) + archP = choice' ((\x -> MP.chunk (T.pack $ archToString x) $> x) <$> ([minBound..maxBound] :: [Architecture])) platformP :: MP.Parsec Void Text PlatformRequest platformP = choice' [ (`PlatformRequest` FreeBSD) @@ -208,6 +208,9 @@ platformParser s' = case MP.parse (platformP <* MP.eof) "" (T.pack s') of ) <* MP.chunk "-linux" ) + , (\a -> PlatformRequest a Windows Nothing) + <$> ((archP <* MP.chunk "-") + <* (MP.chunk "unknown-mingw32" <|> MP.chunk "unknown-windows" <|> MP.chunk "windows")) ] distroP :: MP.Parsec Void Text LinuxDistro distroP = choice' ((\d -> MP.chunk (T.pack $ distroToString d) $> d) <$> allDistros) diff --git a/lib/GHCup/Types.hs b/lib/GHCup/Types.hs index d147263d..98cb2c13 100644 --- a/lib/GHCup/Types.hs +++ b/lib/GHCup/Types.hs @@ -207,7 +207,7 @@ data Architecture = A_64 | A_Sparc64 | A_ARM | A_ARM64 - deriving (Eq, GHC.Generic, Ord, Show) + deriving (Eq, GHC.Generic, Ord, Show, Bounded, Enum) instance NFData Architecture