eliminate partial functions

This commit is contained in:
Krasimir Angelov committed 2026-10-22 20:36:25 +02:00
1 parent 7513dca294
commit dc2b87315e
2 files changed
+5 -5

No files matched your search

+2 -2
View File
@@ -35,8 +35,8 @@ loadLangs = loadLangsFrom configFile
-- | Load language information from specified config file
loadLangsFrom:: FilePath -> IO [LangInfo]
loadLangsFrom configFile = do
lns <- readFile configFile >>= return . lines
mapM mkLangInfo (tail lns)
_:lns <- readFile configFile >>= return . lines
mapM mkLangInfo lns
where
maybeBit bits n = if length bits >= (n+1) && length (bits !! n) > 0 then Just (bits !! n) else Nothing
boolBit bits n def = if length bits >= (n+1) && length (bits !! n) > 0 then (if def then bits !! n /= "n" else bits !! n == "y") else def