Skip to content

Instantly share code, notes, and snippets.


View GitHub Profile
edmundsmith /
Created Jul 7, 2019
Method for Emulating Higher-Kinded Types in Rust

Method for Emulating Higher-Kinded Types in Rust


I've been fiddling about with an idea lately, looking at how higher-kinded types can be represented in such a way that we can reason with them in Rust here and now, without having to wait a couple years for what would be a significant change to the language and compiler.

There have been multiple discussions on introducing higher-ranked polymorphism into Rust, using Haskell-style Higher-Kinded Types (HKTs) or Scala-looking Generalised Associated Types (GATs). The benefit of higher-ranked polymorphism is to allow higher-level, richer abstractions and pattern expression than just the rank-1 polymorphism we have today.

As an example, currently we can express this type:


Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](

m-ou-se / replace-debian-with-arch.txt
Last active Jun 22, 2020
Instructions to replace a live Debian installation with Arch
View replace-debian-with-arch.txt
# Download latest archlinux bootstrap package, see
wget '*-x86_64.tar.gz'
# Make sure you'll have enough entropy for pacman-key later.
apt-get install haveged
# Install the arch bootstrap image in a tmpfs.
mount -t tmpfs none /mnt
cd /mnt
tar xvf ~/archlinux-bootstrap-*-x86_64.tar.gz --strip-components=1
mohamed /
Last active May 24, 2020
Build Google gn build tool standalone
#!/usr/bin/env sh
set -euv
# Updated on April 2019 to reflect changes in GN
# See:
# We need a recent git
raichoo / gist:01969563d1a534cf4f26
Last active Jul 19, 2017
Typed Interpreter in Haskell
View gist:01969563d1a534cf4f26
{-# OPTIONS_GHC -Wall -fno-warn-incomplete-patterns #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE NPlusKPatterns #-}
module Main where
chrisdone /
Last active Nov 2, 2019
Statically Typed Lisp

Basic unit type:

λ> replTy "()"
() :: ()

Basic functions:

evansb / Parser.hs
Created Aug 11, 2014
3 lines Parser in Haskell (Line 9,11,12)
View Parser.hs
import Control.Monad.State.Lazy
import Control.Monad.Error
import Control.Monad.Identity
import Control.Applicative
import Data.Char
-- Begin parser
type Parser a = StateT String (ErrorT String Identity) a
tungel / my Arch Linux cheat-sheet
Created Jul 8, 2013
I have kind of short term memory so I like to take note of what I've done. This cheat-sheet log some of the things I've done to my Arch Linux machine. Lots of these stuffs are based on my personal preference and may not be applicable to you. Also take note that: I'm not responsible if you break your machine by following any of the steps in this …
View my Arch Linux cheat-sheet
Installing Arch:
sudo vim /etc/pacman.conf
Update packages list: sudo pacman -Syy
run sudo pacman -Syu before installing any software (to update the repositories first)
* Timing issue:
- Change hardware clock to use UTC time:
sudo timedatectl set-local-rtc 0
leoleozhu / git with
Last active Dec 21, 2016
use Git with proxy
View git with

install socat

sudo apt-get install socat

edit ~/.ssh/config

    proxycommand socat - PROXY:localhost:%h:%p,proxyport=8080

###If you want to use SOCKS proxy, edit it like this. host ProxyCommand socat - SOCKS:localhost:%h:%p,socksport=7070

View gist:5107998


Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPad

Consumer key: CjulERsDeqhhjSme66ECg
You can’t perform that action at this time.