我正在使用haskell和im尝试输出列表中记录的所有数据。但我不知道怎么做。
Image of code
data Employee = Employee { name :: String,
position :: String,
idNum :: Int
}
samSmith = Employee {name = "Sam Smith", position = "Manager", idNum = 1000}
pamMarx = Employee {name = "Pam Marx", position = "Sales", idNum = 1001}
test = Employee {name = "Test", position = "test", idNum =0}
test2 = Employee {name = "Test2", position = "test2", idNum =01}
test3 = Employee {name = "Test3", position = "test3", idNum =20}
test4 = Employee {name = "Test4", position = "test4", idNum =30}
test5 = Employee {name = "Test5", position = "test5", idNum =40}
testData = [samSmith,pamMarx,test,test2,test3,test4,test5]
renderEmployee :: Employee -> (String,String,Int)
renderEmployee re = (name re,position re,idNum re)