The haskellscript package

[Tags:bsd3, program]

This tool provides the ability to script in a shell with Haskell (including dependencies) the same way that has been possible with bash scripts or Python.


Print out JSON constructed with Aeson

Lookup weather for your current IP address


A sandbox capable install of Cabal.


The script falls into three main parts:

#!/usr/bin/env haskellscript
import Data.Aeson
import Data.ByteString.Lazy hiding (putStrLn, unpack)
import Data.Text
import Data.Text.Encoding
jsonExample = object ["Test" .= True, "Example" .= True]
main = putStrLn $ unpack $ decodeUtf8 $ toStrict $ encode jsonExample

Note that because the dependencies specified are hashed to enable re-use it's worth specifying exact versions across multiple scripts to prevent the version used being quite old after a while.


Versions, 0.1.1, 0.1.2, 0.2.0, 0.2.1, 0.2.2, 0.2.3
Dependencies base (>=4.6 && <4.9), cryptohash, directory, either, filepath, mtl, process, text [details]
License BSD3
Copyright Copyright (C) 2015 Sean Parsons
Author Sean Parsons
Category Development
Home page
Bug tracker
Source repository head: git clone git://
Uploaded Thu May 28 21:58:36 UTC 2015 by seanparsons
Distributions NixOS:0.2.3
Downloads 800 total (36 in the last 30 days)
0 []
Status Docs not available [build log]
Last success reported on 2015-11-12 [all 7 reports]
Hackage Matrix CI


Maintainer's Corner

For package maintainers and hackage trustees