私はここにタプルのリストを持っています。そして、各タプルの最初の要素に関数dir..
を適用したいと思います。どうやってやるの?ありがとうございます!Haskellのリストの各要素に関数を適用するには?
[ ("grid", gridResponse),
("graph", graphResponse),
("image", graphImageResponse),
("timetable-image", timetableImageResponse x),
("graph-fb",toResponse ""),
("post-fb",toResponse ""),
("test", getEmail),
("test-post", postToFacebook),
("post", postResponse),
("draw", drawResponse),
("about", aboutResponse),
("privacy" ,privacyResponse),
("static", serveDirectory),
("course", retrieveCourse),
("all-courses", allCourses),
("graphs", queryGraphs),
("course-info", courseInfo),
("depts", deptList),
("timesearch",searchResponse),
("calendar",calendarResponse),
("get-json-data",getGraphJSON),
("loading",loadingResponse),
("save-json", saveGraphJSON)]
'map'について知っていますか? – pdexter
'map(dir。fst)data' – karakfa
データを取り出して適用し、そのリストを返すか、元の位置に元の値を戻して、新しい値をfst位置に戻しますか?私は前者のレンズ、後者のレンズをお勧めします。 – jamshidh