Skip to content

Instantly share code, notes, and snippets.

@CMCDragonkai
CMCDragonkai / nix_string_and_path_concatenation.md
Last active November 14, 2024 21:22
Nix: String and Path Concatenation #nix #nixos

Nix String and Path Concatenation

From Bas van Dijk:

To understand these things I would recommend using nix-repl:

$ nix-repl
Welcome to Nix version 1.11.2. Type :? for help.
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h> /* of course */
#include <X11/Xutil.h> /* duuuh */
#include <sys/ipc.h>
#include <sys/shm.h>
#include <X11/extensions/XShm.h> /* obviously */
@TOTBWF
TOTBWF / ObfuscatedSKI.hs
Last active February 23, 2023 06:29
A Lambda Expression to SKI Combinator compiler, written entirely using SKI combinators.
This file has been truncated, but you can view the full file.
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ImpredicativeTypes #-}
{-# LANGUAGE TemplateHaskell #-}
module ObfuscatedSKI where
import Unsafe.Coerce (unsafeCoerce)
--------------------------------------------------------------------------------
-- A Lambda to SKI Combinator Compiler, written entirely using SKI Combinators
--
@chiroptical
chiroptical / babyShark.hs
Last active August 14, 2024 11:59
Baby shark as a Haskell program
{-# LANGUAGE BlockArguments #-}
module Main where
main :: IO ()
main = do
babyShark
do do do do do do babyShark
do do do do do do babyShark
do do do do do do babyShark
@emilypi
emilypi / base.hs
Last active September 6, 2024 05:43
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleContexts #-}
module MyLib where
import Data.Kind (Type)
-- This is how we're normally write a recursive list data structure
--
data List a = Nil | Cons a (List a)