DEV Community

Cover image for Haskell Development on VoidLinux: A match in heaven and hell
Wayne Van Son
Wayne Van Son

Posted on

Haskell Development on VoidLinux: A match in heaven and hell

I'm a huge fan of voidlinux. As it's my daily driver, it taught me to get good at linux and the phenomonal tools within it's ecosytem.

Let's go through the process at this point in time and see if we can get a working Haskell environment in place.

Stack as a sandbox: the easy way

If you're a voidlinux advocate, you'll note that this is not what you want. It takes up lot's of space and it's far easier than it should be.

However this will get you going.

1. Uninstallation

DO NOT install the following. If you have any of these, uninstall them.

  • ghc
  • cabal-install
  • haskell-language-server

Stack will install a ghc and cabal-install when you call stack in your project directory. It will find the correct tools based on the resolver property in your stack.yaml file.

2. Installation

DO install the following.

  • stack
  • ncurses-libtinfo-devel

stack is the tool of choice for managing haskell projects.
ncurses-libtinfo-devel provides the file /lib/libtinfo.so and related symbolic links. Without it, stack doesn't know what the architecture of your machine is and cannot build GHC.

3. haskell-language-server

Install the haskell language server for your IDE. In vscode, it's called Haskell.

4. Open IDE

Stack should now work flawlessly for all projects.

When a project is opened in your vscode, the Haskell extension will download and install the appropriate GHC and Cabal versions.

Binaries: the hard way

Well you asked for it, binaries built purely for your architecture.

1. Installation

Install the following packages from the voidlinux repositories.

  • ghc
  • stack
  • cabal-install
  • haskell-language-server

If all went well, skip step two because haskell-language-server has been added to the list of available packages.

2. build haskell-language-server

This is complicated for new users, but for voidlinux veterans this should be very fun indeed.

In summary, you'll process the following instructions:

  1. clone void-linux/void-packages from GitHub.
  2. pull and rebase the patch from branch package/haskell-language-server at https://github.com/waynevanson/void-packages.
  3. Build haskell-language-server for your machine, which is now available due to the step prior.
  4. Install the package post build with xi from xtools.

3. Enjoy!

Stack should now work great in all projects that have can build with ghc-8.8.4. If your project does not use this, you'll have to use the easy method instead.

Conclusion

This is extremely rushed but I hope it helps someone if they're in need of this. I had no one.

Please email me at waynevanson@gmail.com if you require guidance. Hopefully haskell-language-server is in the packages by then and this article can be streamlined.

Top comments (0)