Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion haskell-ci.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.2
name: haskell-ci
version: 0.19.20250531
version: 0.19.20250604
synopsis: Haskell CI script generator
description:
Script generator (@haskell-ci@) for
Expand Down
10 changes: 9 additions & 1 deletion src/HaskellCI/Newtypes.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,15 @@ newtype NoCommas = NoCommas String
deriving anyclass (C.Newtype String)

instance C.Parsec NoCommas where
parsec = NoCommas <$> liftA2 (:) (C.satisfy (not . isSpace)) (C.munch (/= ','))
parsec = NoCommas . mergeSpaces <$> liftA2 (:) (C.satisfy (not . isSpace)) (C.munch (/= ','))

mergeSpaces :: String -> String
mergeSpaces [] = []
mergeSpaces (' ' : s) = ' ' : go s where
go [] = []
go (' ' : s') = go s'
go (c : s') = c : mergeSpaces s'
mergeSpaces (c : s) = c : mergeSpaces s

instance C.Pretty NoCommas where
pretty (NoCommas p) = PP.text p
Expand Down
Loading