1 -- |Miscellaneous functions for manipulating string.
8 -- | Takes a list of strings, call them string1, string2, etc. and
9 -- numbers them like a list. So,
15 listify :: [String] -> [String]
17 zipWith (++) list_numbers items
19 list_numbers = map show_with_dot [1::Integer ..]
20 show_with_dot x = (show x) ++ ". "
24 string_utils_tests :: [Test]
25 string_utils_tests = [ test_listify ]
30 TestCase $ assertEqual "All items are numbered correctly." expected_items actual_items
32 actual_items = listify [ "item1", "item2" ]
33 expected_items = ["1. item1", "2. item2" ]