Cat

Mars sample program (Download)

#!/usr/bin/env mars

# Cat
# It just echoes stdin to stdout.

import prelude

def main() :: io Num:
    var c :: Num
    c = get_char()
    while c != eof:
        put_char(c)
        c = get_char()
    return 0