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,
13 listify :: [String] -> [String]
15 zipWith (++) list_numbers items
17 list_numbers = map show_with_dot [1::Integer ..]
18 show_with_dot x = (show x) ++ ". "
22 string_utils_tests :: [Test]
23 string_utils_tests = [ test_listify ]
28 TestCase $ assertEqual "All items are numbered correctly." expected_items actual_items
30 actual_items = listify [ "item1", "item2" ]
31 expected_items = ["1. item1", "2. item2" ]