Skip to content

Instantly share code, notes, and snippets.

@i-am-tom
i-am-tom / Optics.hs
Created March 8, 2023 11:52
A short workshop on optics
#!/usr/bin/env cabal
{- cabal:
build-depends: base, containers, lens
-}
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE ImportQualifiedPost #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
@tfausak
tfausak / stack.yaml
Created December 31, 2020 18:56
GHC 9.0.1 RC1
# The GHC team announced the first release candidate for the 9.0.1 release of
# GHC: https://discourse.haskell.org/t/glasgow-haskell-compiler-9-0-1-rc1-now-available/1706
#
# This is an example `stack.yaml` file that you can use to try out the release
# candidate. Save this file in your current directory and run `stack setup`.
# After that you should be able to use Stack as normal, including
# `stack exec ghci` and `stack build`.
#
# If for whatever reason you don't want to use Stack, you can download the
# official release tarballs at: https://downloads.haskell.org/ghc/9.0.1-rc1/
@angerman
angerman / Installation.md
Last active February 1, 2024 11:38
Installing nix on macOS BigSur

The nixos.org website suggests to use:

sh <(curl -L https://nixos.org/nix/install)

For macOS on Intel (x86_64) or Apple Silicon (arm64) based macs, we need to use

sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume
#!/bin/bash
# TODO: Get current git tag
VER=${1:-"1.0.0"}
psc-package dependencies | perl -pe 's/^(.*)$/"\1"/g' | jq -s . > deps.json
jq < psc-package.json --slurpfile bower bower.json --slurpfile deps deps.json --arg version "$VER" --arg deps "$DEPS" \
'{(.name): { dependencies: ($deps | .[0]), repo: ($bower | .[0].repository.url | gsub("git:";"https:") ), version: $version } }'
@nwolverson
nwolverson / package-from-bower.sh
Created March 9, 2017 21:07
create psc-package.json from bower.json
#!/bin/bash
SET=${1:-"erl-0.10.5"}
SOURCE=${2:-"https://github.com/purerl/package-sets.git"}
if [ ! -f "psc-package.json" ]; then
jq < bower.json "{name, set: \"$SET\", source: \"$SOURCE\", depends: [] }" > psc-package.json
fi
jq < bower.json '.dependencies | keys | map(gsub("purescript-";"")) | join("\n")' -r | while read -r line ; do
psc-package install $line;
@haasn
haasn / about:config.md
Last active April 2, 2024 18:46
Firefox bullshit removal via about:config

Firefox bullshit removal

Updated: Just use qutebrowser (and disable javascript). The web is done for.

@merijn
merijn / Scraper.hs
Created July 9, 2015 08:20
Concurrent webscraper
{-# LANGUAGE OverloadedStrings #-}
import Control.Concurrent.Async
import Control.Concurrent.QSem
import Control.Monad
import Control.Monad.Catch
import Control.Monad.Trans
import Control.Monad.Reader
import Data.ByteString.Lazy (ByteString)
@chrisdone
chrisdone / typing.md
Last active May 9, 2024 15:27
Typing Haskell in Haskell

Typing Haskell in Haskell

MARK P. JONES

Pacific Software Research Center

Department of Computer Science and Engineering

Oregon Graduate Institute of Science and Technology