Skip to content

Instantly share code, notes, and snippets.

View masaeedu's full-sized avatar

Asad Saeeduddin masaeedu

  • Montreal, QC, Canada
View GitHub Profile
@wmertens
wmertens / nix-store-in-git.md
Last active September 7, 2022 19:57
Store Nix store in git

Store Nix store in git

The Nix store is an immutable file tree store, addressed by output hashes ($outhash-$name or $out), but could also be tweaked to be addressed by the content hash of the file tree ($cas).

Git is a content-addressed immutable object store. It is optimized for storing files as blobs and directories as tree objects.

Here we consider using a git repository for deduplicating, compressing and distributing the Nix store. We want to achieve maximum deduplication so we extract small changes from files before storing, so they become more similar.

Method

@vivshaw
vivshaw / OOOOOoooOOooOoOoo.d.ts
Created October 18, 2021 15:36
👻 Haunted TypeScript 👻
declare namespace ⵔ {
type Ѻ
=never;type ⵔ
= "ⵔ"
type 〇
= "〇"
type O
= 〇
| ⵔ
type o <
@sjoerdvisscher
sjoerdvisscher / Endofunctors.hs
Last active July 24, 2024 12:18
Another go at implementing polynomial functors a la David Spivak
{-# LANGUAGE GHC2021, GADTs, DataKinds #-}
{-# LANGUAGE TypeData #-}
module Endofunctors where
import Control.Comonad (Comonad(..))
import Control.Comonad.Cofree (Cofree(..))
import Control.Monad (join, ap, void)
import Control.Monad.Free (Free(..))
import Data.Bifunctor (first, second, bimap)
import Data.Functor.Day