Skip to content

Instantly share code, notes, and snippets.

View hasufell's full-sized avatar
👀
Staring

Julian Ospald hasufell

👀
Staring
View GitHub Profile

Set Up a Haskell Development Environment in Three Steps

a Haskell Development Environment consist in a compiler (ghc), a language server (hls), a building tool (cabal or stack), and an editor compatible with the language server protocol.

The best way to have a coherent installation of these components is with the ghcup tool.

  • Step 1: Install GHCup. You'll be prompted to install some tools. Say yes to hls. Do not install stack yet (see below).
  • Step 2: Install vscode
  • Step 3: Open vscode and install the haskell extension either using the extension panel or pressing CTRL+P and ext install haskell.haskell.
@simonmichael
simonmichael / SM's Haskell Survival Guide.md
Last active March 5, 2022 03:26
SM's Haskell Survival Guide (draft)

SM's Haskell Survival Guide

Somewhat-repeatable recipes for getting a reliable haskell build toolchain installed as of 2022Q1. You might need to make adjustments, eg on Windows, but hopefully not too many.

Set up with ghcup

Current most popular method. Best way to get native arm tools on mac m1. You can use it to install the compiler ghc, build tools cabal and/or stack, and IDE/editor language server hls (under $HOME/.ghcup). Actively maintained.

  • install latest ghcup (manages haskell core tools)
@ThoNohT
ThoNohT / dehaskell.md
Last active April 24, 2024 23:30
Cleaning haskell packages from pacman

Cleaning up haskell packages on Arch Linux

In Arch Linux, all haskell packages are dynamically linked. This can be a headache for the user, since it results in a large amount of haskell-* packages being installed on your system, and the possibility for version conflicts. A way around this is to not depend on pacman at all for haskell packages, but manually install them. In this document I explain how I switched from a lot of haskell packages installed with pacman, to a few manually installed packages.

Finding packages to uninstall

To determine which packages to uninstall (and replace), a few tools are useful:

  • pacman itself
  • pacgraph
@jabberabbe
jabberabbe / coso.hs
Created October 4, 2021 20:15
tito fighting against the Haskell lexer
module Coso where
testOk1 = [1, 2, 3, 4]
testOk2 =
[ 1
, 2
, 3
]
@jonathanknowles
jonathanknowles / init.vim
Created August 26, 2020 09:43
Neovim Configuration
" auto-install vim-plug
if empty(glob('~/.config/nvim/autoload/plug.vim'))
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall
endif
call plug#begin('~/.config/nvim/plugged')
Plug 'junegunn/vim-easy-align'
Plug 'neomake/neomake'
@angerman
angerman / Thoughts.md
Created July 11, 2020 04:09
Thoughts on GitLab, Phabricator, ...

A central piece of modern collaborative software development is done using source control tools. One of the most prominent being git. While this is by no means the only one, it is probably the most commonly used one with a cottage industry of tooling around it.

While git is conceptually decentralised, it is mostly used though a central server. Today this central server is often GitHub, or to some degree GitLab, and even a lesser some other hosted options. This provides value in that it's easily accessable from a browser (the ubiquitous way to access information today), and provides discovery facilities.

However, one can argue that the most critical part of collaborative software development is

{-# LANGUAGE NamedFieldPuns #-}
import XMonad
import XMonad.Config.Desktop
import qualified Data.Map as Map
main :: IO ()
main =
xmonad $ desktopConfig {
terminal = "konsole",
@olivierlemoal
olivierlemoal / event_listener.py
Last active February 17, 2021 19:48
i3 script to toggle between last windows
Moved to https://github.com/olivierlemoal/i3-swap-focus
@nh2
nh2 / SocketUtils.hs
Created July 13, 2019 20:18
Check whether a port is open in Haskell
module SocketUtils
( isPortOpen
, simpleSockAddr
) where
import Data.Word (Word8)
import Foreign.C.Error (Errno(..), eCONNREFUSED)
import GHC.IO.Exception (IOException(..))
import Network.Socket (PortNumber, socket, connect, close', Family(AF_INET), SocketType(Stream), SockAddr(SockAddrInet), tupleToHostAddress)
import UnliftIO.Exception (try, bracket, throwIO)
@F21
F21 / signing-gpg-keys.md
Last active April 17, 2024 14:37
Signing someone's GPG key

This is a quick guide of the commands we use to sign someone's GPG key in a virtual key signing party.

Note: The steps cover only the technical aspects of signing someone's key. Before signing someone's key, you must verify their identity. This is usually done by showing government-issued ID and confirming the key's fingerprint

The commands will work for both GPG and GPG2.

I use Julian's key for the examples. His key id is 2AD3FAE3. You should substitute with the appropriate key id when running the commands.

Signing the key

  1. List the keys currently in your keyring: gpg --list-keys.