Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jdnavarro on github.
  • I am jdnavarro (https://keybase.io/jdnavarro) on keybase.
  • I have a public key ASDlwGCGpzI57Mv-bdFmeZsOdTGyE7Y1wvgXnl9mfR-TzQo

To claim this, I am signing this object:

@jdnavarro
jdnavarro / fedora-nspawn.markdown
Created January 27, 2016 14:19
Bootstrap systemd-nspawn Fedora container from an Arch Linux host

Install yum from AUR

$ yaourt -Sy yum

Add bootstrap repos to /etc/yum.d/boot.repo

[fedora]
name=fedora
baseurl=https://archives.fedoraproject.org/pub/fedora/linux/releases/23/Everything/x86_64/os/
enabled=1
@jdnavarro
jdnavarro / stack-external-libs.sh
Created September 19, 2015 11:25
One liner to find out dynamic libraries being used by current stack package, thanks to int-e on freenode
for i in $(stack exec ghc-pkg -- list --simple-output); do echo $i $(stack exec ghc-pkg -- field $i extra-libraries) done | grep extra-libraries
@jdnavarro
jdnavarro / PKGBUILD
Last active February 13, 2017 17:08
Updated libtinfo AUR PKGBUILD for ncurses-6
# Maintainer: Alexej Magura <agm2819*gmail*>
#
#
pkgname=libtinfo
pkgver=5
pkgrel=7
pkgdesc="symlink to ncurses for use in cuda and other packages"
arch=('any')
url="http://www.gnu.org/software/ncurses/"
license=('unknown')
@jdnavarro
jdnavarro / deb-deps.sh
Last active September 1, 2015 15:35
Obtain a cabal.config frozen with debian package versions
#!/bin/sh
set -e
type grep-aptavail >/dev/null 2>&1 || {
echo >&2 "grep-aptavail (dctrl-tools) needs to be installed";
exit 1;
}
. /etc/os-release
echo "-- $PRETTY_NAME"
echo "-- Created on $(date)"
@jdnavarro
jdnavarro / check-release.md
Last active September 11, 2015 12:38
Check list before Hackage release
  • Check documentation renders properly
  • Update CHANGELOG
  • Make sure builds are not using unreleased code: travis, stack, etc.
  • Version Bump
  • Wait for CI Build if applicable
  • Build tar.gz package, build it (maybe CI does it) and check it contains every file
  • git tag
  • push tag or/and GitHub release if applicable
  • Upload to Hackage
  • Upload docs
@jdnavarro
jdnavarro / lattice.md
Last active June 20, 2021 14:13
Idealized Haskell type class lattice

This is a personal mental model of how I would classify Haskell main type classes if semigroupoids were first-class.

Functor: <$>

  • Apply: <*>, <.>
    • Applicative: pure, return
    • Bind: join, =<<, <=<
  • Alternative (Alt): <|>, <!>
    • Zero (Alternative): zero, empty
  • CoApply: <@>
  • CoApplicative: copure, extract
cabal_version=1.20.0.3
cabal_directory=Cabal-${cabal_version}
cabal_archive=${cabal_directory}.tar.gz
curl -O https://www.haskell.org/cabal/release/cabal-${cabal_version}/${cabal_archive}
tar xvzf ${cabal_archive}
cd ${cabal_directory}
ghc --make Setup
./Setup configure --prefix /opt/local
mkdir tmp
{-# LANGUAGE LambdaCase #-}
module Main where
import Control.Category
import Data.Traversable
import Data.Tree
import Control.Comonad
import Data.List.NonEmpty
trav :: Eq a => (Traversable t, Comonad t) => [a] -> t a -> [a]