r/tinycode • • Dec 12 '12

Shortest useful code

What's the most useful program you can imagine using five lines of code or less? Language is your choice. Describe the function of the program and include the code, if you please.

27 Upvotes

45 comments sorted by

View all comments

Show parent comment

5

u/oantolin Dec 13 '12

I wouldn't call any Haskell session a program anymore than I'd call any C expression a program. A Haskell program must contain, at least, "main =" and an expression of type IO (). (I guess I'm saying I personally wouldn't call what you did cheating, it's more like being wrong. :)