Fix a nonexhaustive pattern match

This commit is contained in:
Utku Demir 2023-01-14 17:43:09 +13:00
parent b18f430668
commit 4eaca0c0bd

View File

@ -110,7 +110,9 @@ getNixVersion = do
-- split by ".", take the first two, and convert them to numbers
(major, minor) <- do
let maT : miT : _ = T.splitOn "." ver
(maT, miT) <- case T.splitOn "." ver of
p1 : p2 : _ -> Just (p1, p2)
_ -> Nothing
ma <- readMaybe @Natural (toString maT)
mi <- readMaybe @Natural (toString miT)
return (ma, mi)