[Haskell-cafe] Looking for pointfree version

Toby Hutton toby.hutton at gmail.com
Thu Feb 12 04:00:46 EST 2009


On Thu, Feb 12, 2009 at 6:46 PM, Kim-Ee Yeoh <a.biurvOir4 at asuhan.com> wrote:
>
> On the same note, does anyone have ideas for the following snippet? Tried the
> pointfree package but the output was useless.
>
> pointwise op (x0,y0) (x1,y1) = (x0 `op` x1, y0 `op` y1)

$ pointfree '(\op (a, b) (c, d) -> (a `op` c, b `op` d))'
(`ap` snd) . (. fst) . flip flip snd . ((flip . (ap .)) .) . flip flip
fst . ((flip . ((.) .)) .) . (flip =<< (((.) . flip . (((.) . (,)) .))
.))

'Useless' is a bit understated , IMO.


More information about the Haskell-Cafe mailing list