Skip to content

Instantly share code, notes, and snippets.

View Kintaro's full-sized avatar
🏠

Simon Wollwage Kintaro

🏠
View GitHub Profile
{ stdenv, lib, buildEnv, makeWrapper, runCommand, fetchurl, zlib, rsync }:
# rustc and cargo nightly binaries
let
convertPlatform = system:
if system == "i686-linux" then "i686-unknown-linux-gnu"
else if system == "x86_64-linux" then "x86_64-unknown-linux-gnu"
else if system == "i686-darwin" then "i686-apple-darwin"
else if system == "x86_64-darwin" then "x86_64-apple-darwin"
@14427
14427 / hkt.rs
Last active August 31, 2024 00:57
Higher-kinded type trait
use std::rc::Rc;
trait HKT<U> {
type C; // Current type
type T; // Type with C swapped with U
}
macro_rules! derive_hkt {
($t:ident) => {
impl<T, U> HKT<U> for $t<T> {