{------------Ryan Bloor, Computer Science, Assignment three---------------} module Football where import PoolsRes import Data.List --Define data types type Result = (Int, String ,Int,Int,String) type Results = [Result] wordToInt :: String -> Int wordToInt w = read w :: Int {--------------------------------------------------------------------------} --Define the function that returns a list of strings (manual) method :: (String -> [String]) -> [String] -> [[String]] method f [] = [] method f (x:xs) = (f x : method f xs) --parse the integers and transfer into the Results - for one result parseResults :: [String] -> Result parseResults (a:b:c:d:e:_) = (n,hteam,hscore,ascore,ateam) where n = wordToInt a; hteam = b; hscore = wordToInt c; ascore = wordToInt d; ateam = e --test method that takes a list of lists and returns the results test :: [[String]] -> Results test [] = [] test (x:xs) = parseResults x : test xs --function to run the test and method function other :: [String] -> Results other r = test (method words r) {--------------------------------------------------------------------------} --Pool Newss