[Haskell-beginners] System administration using Haskell

Dominic Espinosa dcespin at fastmail.fm
Fri Jun 14 23:54:56 CEST 2013


Hello Kevin,

In conjunction with general haskell tutorials, you might be interested in
the following libraries on hackage:

* shelly - convenience functions for systems programming
* hsshellscript - similar
* system-filepath - high-level interface for manipulating directories
* shqq - run shell commands using quasi-quoting, like perl's backtick
  operator
* process - spawn external commands (supplying command name, arguments,
   environment variables, etc

These are mostly under category 'System' on hackage, here: 
http://hackage.haskell.org/packages/archive/pkg-list.html#cat:system

There are many other libraries that facilitate interacting with the OS
(especially if the OS is Unix), if you browse around hackage. Additionally,
the System.Posix.* modules provide direct bindings to POSIX services (fork,
nice, setenv, semaphores, shared memory, and so on), if that's what you
need. 

StackOverflow is pretty good for finding example code for "how do I do
X in Haskell", so by all means search there as well.

I've found that writing "shell scripts" or small unix tools in Haskell is a
bit slower at first than writing them in, say, perl, but the payoff in 1)
avoiding bugs and 2) maintainability is gigantic. Give it a try -- you may
be impressed. These days I turn to haskell for all but the smallest of
scripts. 

Good luck on your quest.

On Fri, Jun 14, 2013 at 05:29:08PM +0000, Kelleher, Kevin wrote:
> After more than two decades using the C-family of languages
> (C, C++, Java, C#, Perl, unix shells), I've been trying to learn
> Haskell.  Each time I've begun with enthusiasm, and eventually
> run out of gas before I've gotten to writing real code. Haskell's
> learning curve is not very steep, but it is very long. 
> I haven't yet gotten to the things I do the most, which all 
> involve side-effects: mostly actions on directories and files,
> as well as calls to system utilities or other pieces of software.
> 
> I'm working my way through "Real Life Haskell" and watching
> Erick Meijer's lectures, but I'm beginning to fear I'll run
> out of gas again if I can't write some programs that touch
> the real world.
> 
> Are there any tutorials or other material that will get me
> going in that area?
> 
> thanks,
> 
> Kevin
> 
> This message (including any attachments) is intended only for
> the use of the individual or entity to which it is addressed and
> may contain information that is non-public, proprietary,
> privileged, confidential, and exempt from disclosure under
> applicable law or may constitute as attorney work product.
> If you are not the intended recipient, you are hereby notified
> that any use, dissemination, distribution, or copying of this
> communication is strictly prohibited. If you have received this
> communication in error, notify us immediately by telephone and
> (i) destroy this message if a facsimile or (ii) delete this message
> immediately if this is an electronic communication.
> 
> Thank you.
> 
> 
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners



More information about the Beginners mailing list