Skip to content

Instantly share code, notes, and snippets.

{ pkgs ? import <nixpkgs> {}}:
let
texpkgs = pkgs.texlive.combine {
inherit (pkgs.texlive) scheme-small latexmk;
};
in
pkgs.stdenv.mkDerivation {
name = "mbd";
@chrisdone
chrisdone / 1Core.hs
Created January 11, 2017 17:06
Xeno examples
-- RHS size: {terms: 254, types: 135, coercions: 0}
Xeno.$wparse [InlPrag=[0]]
:: GHC.Prim.Addr#
-> GHC.ForeignPtr.ForeignPtrContents
-> GHC.Prim.Int#
-> GHC.Prim.Int#
-> ()
[GblId,
Arity=4,
Str=DmdType <L,U><L,U><L,U><S,U>,
@3noch
3noch / scoped-bootstrap.nix
Last active November 4, 2016 12:46
Nix expression to build scoped Twitter Bootstrap CSS
# This expression builds a copy of Twitter Bootstrap CSS but with every rule embedded inside a CSS selector of
# your choice. This makes it easy to embed a Bootstrap-themed component in a site that doesn't use Bootstrap.
#
# Usage
# * Install nix from https://nixos.org/nix/ (it's a fancy package manager that won't mess up your system)
# * Save this file to `scoped-bootstrap.nix`
# * With nix stuff on your PATH, run `nix-build scoped-bootstrap.nix`
# * The result will be in `./result/` (a symlink). Copy to desired location.
# * If you don't want to keep `nix`: `rm -rf /nix`
@Icelandjack
Icelandjack / Constraints.org
Last active April 2, 2024 20:22
Type Classes and Constraints

Reddit discussion.

Disclaimer 1: Type classes are great but they are not the right tool for every job. Enjoy some balance and balance to your balance.

Disclaimer 2: I should tidy this up but probably won’t.

Disclaimer 3: Yeah called it, better to be realistic.

Type classes are a language of their own, this is an attempt to document features and give a name to them.

@phadej
phadej / poly-nfdata.hs
Last active November 6, 2017 22:24
Example how is possible to write polykinded type-classes in GHC-8.0. It's not that bad or messy, but I'm not sure it's practical either.
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeSynonymInstances #-}
@aisamanra
aisamanra / simple_hans_server.hs
Created June 1, 2016 06:09
A basic application written using ssh-hans
module Main where
{-
Here is a real---if not particularly interesting---interaction with this server:
[gdritter@armilla ~]$ ssh -p 9999 localhost incr
ok.
[gdritter@armilla ~]$ ssh -p 9999 localhost incr
ok.
[gdritter@armilla ~]$ ssh -p 9999 localhost double
@martijnvermaat
martijnvermaat / nixos.md
Last active May 9, 2024 01:11
Installation of NixOS with encrypted root
@roelvandijk
roelvandijk / Nub.hs
Last active February 7, 2016 16:51 — forked from fizruk/Nub.hs
Incredibly slow type-level Nub
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
module Nub where
import Data.Proxy
import Data.Type.Bool
@vasanthk
vasanthk / System Design.md
Last active May 24, 2024 06:19
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?