
9 Feb
2009
9 Feb
'09
9:18 a.m.
Hi, Is there a nice way to write down :: Focus -> [Focus] down p = concat [downPar p, downNew p, downTrans p] in point-free style? (In doesn't make much difference what these functions do; if it helps, their types are downPar, downNew, downTrans :: Focus -> [Focus]). Ideally, I would like to write something like down = downPar ... downNew ... downTrans but I'm not sure what should be on the dots. This works: down = concat . flip map [downPar, downNew, downTrans] . flip ($) but is extremely ugly and doesn't really explain what's going on :) (It seems to me I should be able to take advantage of the list monad, somehow). Pointers appreciated! Edsko