News for hackers. Stuff that matters.
Re:H4sh – Exposing the Haskell List library as a set of shel... by kazinator on Monday July 13, 2015 @04:12PM (#9880724)
> take 100 data | map show.length | sort | reverse | head

   $ txr -t '[(opip get-lines (mapcar length) sort reverse)]' | head
   asdfasdf
   adsfas
   da
   sfa
   f
   sdfadsf
   asd
   asdf
   [Ctrl-D]
   8
   7
   6
   4
   3
   3
   2
   1
   0
Pattern for wrapping any list processing function as a command:

   $ mapcar()
   > {
   >    txr -t "[(opip get-lines (mapcar $@))]"
   > }
   $ mapcar length < /etc/motd
   63
   0
   43
   0
   28
   33
   0
   36
   42
   0
Bored now.

There are no comments on this comment yet.