top | item 9877082

H4sh – Exposing the Haskell List library as a set of shell utilities

58 points| Mayeu | 10 years ago |github.com

13 comments

order

xnyhps|10 years ago

I was going to post that I was happy to see a new project using hs-plugins, but then I noticed:

> h4sh was written during a cold, but sunny weekend in August 2005.

hs-plugins looks so cool, but I'm afraid it's bit-rotten and abandoned. :(

kazinator|10 years ago

> 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.

amelius|10 years ago

Can it also make immutable copies (snapshots) of the filesystem?

gh02t|10 years ago

Doubt it. That's something done by the filesystem itself and doesn't really belong in the shell. You can do it with btrfs or zfs though. LVM too.