ANNOUNCE: h4sh - Haskell functions for shell scripting
h4sh -- Haskell functions for shell scripting Unix is all about programs that do one thing, and one thing well. Unfortunately, over time, the common unix text processing commands have become bloated and silly, with rather arbitrary features for programs that should have simple semantics (consider uniq and wc outputting leading space, or cut indexing fields from 1, just for starters). On the other hand Haskell has a powerful and beautiful List library for processing text as lists of strings. h4sh exposes the Haskell List library as a set of shell utilities. Utilising function composition via pipes, we can transparently program in Haskell, in the shell :) Commands are generated from a description of their type. Higher order functions like map are handled using runtime evaluation, provided by the hs-plugins System.Eval library, allowing arbitrary Haskell code to be provided as arguments to, for example, map and filter. A (contrived) example: take -n 100 f | id | map -e show.length | filter -e '/= "0"' | sort | reverse | head Get it: http://www.cse.unsw.edu.au/~dons/h4sh.html darcs get --partial http://www.cse.unsw.edu.au/~dons/code/h4sh -- Don Stewart
h4sh 0.2 has been released. h4sh has stablised, and this is intended to be the last release for some time. Changes since h4sh 0.1 include: * New functions available in the shell: foldl, foldr, unfoldr, iterate, ($), transpose, group, show, concatMap * Compilation strategies added for a wider range of types. * Removed argument flags. Instead arguments are provided in their Haskell type order. * Renamed some functions to avoid clashes with existing shell commands * Added HOWTO of one-liners. * Cabalised. * Simplified build dependencies. * Added support library of regex operators * Use mmapped FastPackedStrings for IO. Good space and time improvements * Functions expecting a single argument will read from stdin if no argument is provided. * Lift group from a -> [a], to [a] -> [[a]] Get it: darcs get --partial http://www.cse.unsw.edu.au/~dons/code/h4sh Cheers, Don Stewart
participants (1)
-
dons@cse.unsw.edu.au