[Haskell-cafe] [OT?] Haskell-inspired functions for BASH

Jeremy Shaw jeremy at n-heptane.com
Thu Apr 1 10:41:19 EDT 2010


How about:

http://www.cse.unsw.edu.au/~dons/h4sh.html

It brings a lot of familiar Haskell functions to the command-line. And *is*
actually written in Haskell ;)

- jeremy

On Wed, Mar 31, 2010 at 6:05 PM, Patrick LeBoutillier <
patrick.leboutillier at gmail.com> wrote:

> Hi all,
>
> I've been studying Haskell for about a year now, and I've really come
> to like it. In my daily work I write a lot of BASH shell scripts and I
> thought I'd try add some of the haskell features and constructs to
> BASH to make my scripting life a bit easier. So I've been working on a
> small BASH function library that implements some basic functional
> programming building blocks.
>
> Note: There is no actual Haskell code involved here.
>
> I put up the full manpage here:
> http://hpaste.org/fastcgi/hpaste.fcgi/view?id=24564
> Source is here:
> http://svn.solucorp.qc.ca/repos/solucorp/bashkell/trunk/trunk/
>
> All this is very prototypical, but here is an example of some of the
> stuff I've got so far (map, filter, foldr):
>
> $ ls data
> 1.txt  2.txt
>
> # basic map, argument goes on the command line
> $ ls -d data/* | map basename
> 1.txt
> 2.txt
>
> # map with lambda expression
> $ ls -d data/* | map '\f -> basename $f .txt'
> 1
> 2
>
> # simple filter, also works with lambda
> $ ls -d data/* | map basename | filter 'test 1.txt ='
> 1.txt
>
> # sum
> $ ls -d data/* | map '\f -> basename $f .txt' | foldr '\x acc -> echo
> $(($x + $acc))' 0
> 3
>
> Basically I'm looking for a bit of feedback/info:
> - Does anyone know if there are already similar projets out there?
> - Does anyone find this interesting?
> - Any other comment/suggestion/feedback
> - Where's a good place to promote such a project?
>
>
> Thanks a lot,
>
> Patrick LeBoutillier
>
>
> --
> =====================
> Patrick LeBoutillier
> Rosemère, Québec, Canada
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100401/e0d97fb0/attachment.html


More information about the Haskell-Cafe mailing list