I am trying to write the function trade_report :: String -> [Transaction] -> String which will take an element in a list and return the values associated with the element.
For context in what the Type transaction is:
type Transaction = (Char, Int, Int, String, Int)
test_log :: [Transaction]
test_log = [('B', 100, 1104, "VTI", 1),
('B', 200, 36, "ONEQ", 3),
('B', 50, 1223, "VTI", 5),
('S', 150, 1240, "VTI", 9),
('B', 100, 229, "IWRD", 10),
('S', 200, 32, "ONEQ", 11),
('S', 100, 210, "IWRD", 12)
]
transaction_to_stringto each element in the result ofget_trades, not the list as a whole. (Hint: usemap.) Then you want to join the list of strings you get as a result into a single string using"\n"as a separator. (Hint: useData.List.intercalate, which a normal language would calljoin:) )filterfunction for that. The data flow would look some thing like this: transaction_log -> filter logs that you need -> convert each transaction to string -> intercalate the strings.get_tradesis doing.trade_report" (without even really specifying what it does) and gives some auxiliary definitions for context. To help you we need to know what code you have written to try to solve this, and what specifically (full error messages, etc) isn't working. I can see in the edit history you have removed a lot of material; should some of that come back?