Hacker News new | past | comments | ask | show | jobs | submit login

Isn't that `rev`, not `tac`? (I think `tac` should be `unlines . reverse . lines`.)



You are correct.

For those not familiar with Haskell,

    unlines . map reverse . lines
is the same thing as (python)

    lambda data : [line[::-1] for line in data]
whereas

    unlines . reverse. lines
is the same as

    lambda data : [line for line in data][::-1]


Well, you need

   '\n'.join(...)
for the "unlines" bit.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: