Writings by Petar Radosevic, Code with Paper and Pencil.


Haskell Packages for Development

, tagged with haskell

Developing Haskell packages has become a joy with the just released Cabal sandboxes. Sandboxes completely remove the need for globally installed packages. Except for a few, the packages which are crucial to me for developing in Haskell.

Below a list of those packages, I hope you find at least one which brings even more joy to your Haskell programming.

GHC Mod

ghc-mod are backend commands which enrich Haskell programming on editors including Emacs, Vim, and Sublime. It’s a great way to know if you made mistakes or to find out how you can improve your code. Both haskell-mode for Emacs and syntastic for Vim look at ghc-mod for warnings or errors.

cabal install ghc-mod

Hoogle

Hoogle searches through API’s by function name or type signature. Hoogle has multiple interfaces which can help you search, foremost being the commandline tool, equally named hoogle. For myself, I’m on OSX and love the Alfred workflow.

Before using Hoogle it’s important to get the latest API data from Hackage with hoogle data.

Hi

I’m still unsure what the best way is to setup a new Haskell project. Luckily Fujimura shows me the way with hi. Hi generates a scaffold when you want to start a new Haskell project. Simply start a new Haskell project with:

hi --module-name "Foo.Bar.Baz" --author "Petar Radosevic" --email "petar@wunki.org"

You can also skip author and email by creating a configuration file at ~/.hirc.

Codex

Codex creates a tags file for your project, even including the dependencies! No more manually looking for function definitions.

Run codex update and setup your editor to work with the created tags to get going.

Stylish Haskell

Stylish Haskell is a code prettifier which cleans up imports, removes trailing whitespace, and more. It has both Vim and Emacs integration and is a great tool to run before committing any new code.

Conclusion

These are the much needed packages I use for my Haskell projects. I’m pretty sure I missed some, let me know in the comments which help you.

You can find me on Twitter: @wunki.

Comments

comments powered by Disqus