gdritter repos config-ini / d4e2a50
Refactor some code to account for pre-AMP Haskell Getty Ritter 8 years ago
2 changed file(s) with 8 addition(s) and 5 deletion(s). Collapse all Expand all
4343 Right v -> Right v
4444
4545 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 ]
5053
5154 sBlanks :: Parser ()
5255 sBlanks = skipMany (void eol <|> sComment)
3030 , flag
3131 ) where
3232
33 import Control.Applicative (Alternative(..))
33 import Control.Applicative (Applicative(..), Alternative(..))
3434 import Control.Monad.Trans.Except
3535 import qualified Data.HashMap.Strict as HM
3636 import Data.Ini.Config.Raw