Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

Just continue the pipeline, e.g.

    ls | map (f: f.size) | red + | map (size: size / 1024)
You can also leave off "map", so:

    ls | (f: f.size) | red + | (size: size / 1024)
A pipeline produces a stream, so there's no clean way to get the single int result in a variable, but you can store the stream (containing the int) into a variable:

    ls | ... | (size: size / 1024) >$ x
Now x has the stream. To read back the stream and print it:

    x <$
To do something else with the stream:

    x <$ (n: n * 1000)
etc.


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: