[Haskell-cafe] Looking for pointfree version
bradypus at xs4all.nl
Mon Feb 9 09:42:29 EST 2009
Rewriting it to:
concatMap ($ p)[downPar , downNew , downTrans ]
($ p) =<< [downPar, downNew, downTrans]
didn't check though!
Edsko de Vries schreef:
> 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,
> Pointers appreciated!
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe