Skip to content

Instantly share code, notes, and snippets.

View paulyoung's full-sized avatar
💭
Type check and prove things

Paul Young paulyoung

💭
Type check and prove things
View GitHub Profile

Mara's statement on the retraction of ThePhd's RustConf keynote

I was one of the people who didn't vote for ThePhd's keynote; originally because I simply preferred another promising candidate. Later, after hearing technical concerns from an expert that I mostly agreed with, also because of the topic, although I must admit I am no expert on the topic.

The candidate I voted for originally got a few approving comments at first, but ended up being mostly ignored later, mostly because of our lack of process and proper voting.

When it was brought up in the leadership chat that 'there are concerns', I focused on the talk itself rather than focusing on the process failure. That was a mistake, for which I apologize. I am not an expert on this topic, and should not have rushed myself into talking about things outside my expertise, even under pressure.

In another situation this could have been a minor mistake with no consequences, just one of several opinions in a discussion, but in this situation it became part

@mehd-io
mehd-io / csv_to_parquet.sh
Created March 21, 2023 16:23
Convert CSV to Parquet using DuckDB CLI
#!/bin/bash
# You can put this in your .bashrc or .zshrc
function csv_to_parquet() {
file_path="$1"
duckdb -c "COPY (SELECT * FROM read_csv_auto('$file_path')) TO '${file_path%.*}.parquet' (FORMAT PARQUET);"
}
@Gabriella439
Gabriella439 / HasCal.hs
Last active May 5, 2022 09:47
First steps towards modeling PlusCal as a Haskell eDSL
{-# LANGUAGE ApplicativeDo #-}
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE UndecidableInstances #-}
module HasCal where
import Control.Applicative (Alternative(..), liftA2)
@Gabriella439
Gabriella439 / lfp.md
Last active March 18, 2022 17:39
Introduction for "Lightweight Functional Programming Specification"

Lightweight Functional Programming specification

The purpose of this document is to specify a baseline set of functional programming features that users can request and that programming languages can advertise support for. This feature set strives to be "JSON-like" and "purely functional".

The goals of this specification are (in descending order of importance):

  • Cultivate a portable functional programming style
@Gabriella439
Gabriella439 / default.nix
Created January 7, 2022 16:14
Nix build of vscode with haskell-language-server
let
nixpkgs = builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/c473cc8714710179df205b153f4e9fa007107ff9.tar.gz";
sha256 = "0q7rnlp1djxc9ikj89c0ifzihl4wfvri3q1bvi75d2wrz844b4lq";
};
config = {
allowUnfree = true;
};
@Gabriella439
Gabriella439 / default.nix
Last active December 15, 2021 04:41
How to build ghcid using nixpkgs
let
nixpkgs = builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/c473cc8714710179df205b153f4e9fa007107ff9.tar.gz";
sha256 = "0q7rnlp1djxc9ikj89c0ifzihl4wfvri3q1bvi75d2wrz844b4lq";
};
compiler = "ghc921";
overlay = pkgsNew: pkgsOld: {
ghcid = pkgsNew.haskell.packages."${compiler}".ghcid;
@nomeata
nomeata / main.mo.md
Created September 15, 2021 16:34
Certified Assets from Motoko (PoC/Tutorial)

Every now and then someone asks whether Motoko canisters can use certified variables, or whether they can serve HTTP requests with certification, and I always responded that yes, Motoko can do that, all that’s missing are a few libraries. But I figured I should put my hand where my mouth is, and actually demonstrate that it’s possible.

So here we go. If you go to https://ce7vw-haaaa-aaaai-aanva-cai.ic0.app/ you will see that

To prove the latter claim, here is the commented code; you can also browse the full repository.

main.mo

@natefaubion
natefaubion / Main.purs
Last active July 20, 2023 00:02
Record currying
module Main where
import Prelude
import Data.Symbol (class IsSymbol)
import Prim.Row as Row
import Prim.RowList as RowList
import Record as Record
import Type.Proxy
@tfausak
tfausak / DerivingViaPlugin.hs
Last active August 23, 2021 14:13
Cursed Haskell: Deriving via plugin
-- https://downloads.haskell.org/~ghc/9.0.1/docs/html/users_guide/extending_ghc.html#compiler-plugins
-- https://downloads.haskell.org/~ghc/9.0.1/docs/html/libraries/ghc-9.0.1/GHC-Plugins.html
module DerivingViaPlugin where
import qualified Control.Monad as Monad
import qualified GHC.Data.Bag as G
import qualified GHC.Hs as G
import qualified GHC.Plugins as P
import qualified GHC.Types.Basic as G
$ sha256sum $(nix-build -E '(import (builtins.fetchGit { url = "git@github.com:dfinity/sdk"; ref = "refs/tags/0.7.0";} + "/distributed-canisters.nix") {})')/*/*.wasm
2664385b7ad001123d8cea1f7147fad005d012116139787d9054b2f3a62718ec /nix/store/0s2iplbgj08d32xdyjcwwyajhhg9fgzs-distributed-canisters/assetstorage/assetstorage.wasm
d6e9f851519a6dc419e3281448a84e4866fbb5011258868e2b5dda31d529bdcf /nix/store/0s2iplbgj08d32xdyjcwwyajhhg9fgzs-distributed-canisters/ui/ui.wasm
a609400f2576d1d6df72ce868b359fd08e1d68e58454ef17db2361d2f1c242a1 /nix/store/0s2iplbgj08d32xdyjcwwyajhhg9fgzs-distributed-canisters/wallet/wallet.wasm
$ sha256sum $(nix-build -E '(import (builtins.fetchGit { url = "git@github.com:dfinity/sdk"; ref = "refs/tags/0.7.1";} + "/distributed-canisters.nix") {})')/*/*.wasm
2664385b7ad001123d8cea1f7147fad005d012116139787d9054b2f3a62718ec /nix/store/0s2iplbgj08d32xdyjcwwyajhhg9fgzs-distributed-canisters/assetstorage/assetstorage.wasm
d6e9f851519a6dc419e3281448a84e4866fbb5011258868e2b5dda31d529bdcf /nix/s