gdritter repos config-ini / 9d84c29
Tiny refactors to make Hedgehog code look incer Getty Ritter 7 years ago
1 changed file(s) with 4 addition(s) and 4 deletion(s). Collapse all Expand all
5656 valueToPair (name, value) = (T.toLower name, T.strip (I2.vValue value))
5757 conv = HM.fromList . Fold.toList
5858
59 textChunk :: Monad m => Gen.Gen m Text
59 textChunk :: Monad m => Gen m Text
6060 textChunk = fmap T.pack $ Gen.list (Range.linear 1 20) $ Gen.alphaNum
6161
62 mkIni :: Monad m => Gen.Gen m I1.Ini
62 mkIni :: Monad m => Gen m I1.Ini
6363 mkIni = do
6464 ss <- Gen.list (Range.linear 0 10) $ do
6565 name <- textChunk
6868 return (name, HM.fromList section)
6969 return (I1.Ini (HM.fromList ss))
7070
71 mkComments :: Monad m => Gen.Gen m (Seq.Seq I2.BlankLine)
71 mkComments :: Monad m => Gen m (Seq.Seq I2.BlankLine)
7272 mkComments = fmap (Seq.fromList . nub) $ Gen.list (Range.linear 0 5) $
7373 Gen.choice
7474 [ return I2.BlankLine
7575 , I2.CommentLine <$> Gen.element ";#" <*> textChunk
7676 ]
7777
78 mkRichIni :: Monad m => Gen.Gen m I2.Ini
78 mkRichIni :: Monad m => Gen m I2.Ini
7979 mkRichIni = do
8080 ss <- Gen.list (Range.linear 0 10) $ do
8181 name <- textChunk