Refactor some code to account for pre-AMP Haskell
Getty Ritter
8 years ago
43 | 43 | Right v -> Right v |
44 | 44 | |
45 | 45 | pIni :: Parser Ini |
46 | pIni = sBlanks *> (go `fmap` (many (pSection <?> "section") <* eof)) | |
47 | where go vs = Ini $ HM.fromList [ (T.toLower (isName v), v) | |
48 | | v <- vs | |
49 | ] | |
46 | pIni = do | |
47 | sBlanks | |
48 | vs <- many (pSection <?> "section") | |
49 | void eof | |
50 | return $ Ini $ HM.fromList [ (T.toLower (isName v), v) | |
51 | | v <- vs | |
52 | ] | |
50 | 53 | |
51 | 54 | sBlanks :: Parser () |
52 | 55 | sBlanks = skipMany (void eol <|> sComment) |