>
> module DataEntryUtilities
>   (blank,
>    capitalizeWords,
>    comma,
>    decimalPt,
>    dollarSign,
>    hyphen,
>    period,
>    removeTrailingCommas,
>    slash,
>    spaceAfterComma)
>   where
>   import SequenceUtilities(dropWhileFromRight)
>   import IOutilities(capitalizeWord)

function: spaceAfterComma
where spaces after commas are missing, insert them

>   spaceAfterComma :: String -> String
>   spaceAfterComma = foldr addSpaceIfComma [ ]

>   c `addSpaceIfComma` [ ] = [c]
>   c `addSpaceIfComma` (s : cs)
>     | c == comma  &&  s /= blank   = [comma, ' ', s] ++ cs
>     | otherwise                    = [c, s]          ++ cs


function: removeTrailingCommas
remove trailing comma

>   removeTrailingCommas :: String -> String
>   removeTrailingCommas = dropWhileFromRight(== comma)


function: capitalizeWords
capitalize words in string

>   capitalizeWords :: String -> String
>   capitalizeWords = unwords . map capitalizeWord . words


variables: names for characters

>   blank, comma, decimalPt, dollarSign :: Char
>   blank      = ' '
>   comma      = ','
>   decimalPt  = '.'
>   dollarSign = '$'
>   hyphen     = '-'
>   period     = '.'
>   slash      = '/'
Last Modified: