Skip to content

Instantly share code, notes, and snippets.

View cartazio's full-sized avatar

Carter Tazio Schonwald cartazio

View GitHub Profile
# Options / Usage
# put this script in the same directory as your *.cabal file
# it will use the first line of "cabal info ." to determine the package name
# custom options for "cabal install"
CUSTOM_OPTIONS=(--haddock-options='-q aliased')
# hackage server to upload to (and to search uploaded versions for)
cartazio / simplemat.c
Created January 29, 2019 01:57
old matrix mat code
// #include <emmintrin.h>
#include <immintrin.h>
// #if defined (__SSE4_2__) || defined (__SSE4_1__)
// for some reason i can't get anything newer than sse4.2 work with both gcc-clang and clang
// #include <smmintrin.h>
// #endif
#include <memory.h>
cartazio / settings
Created February 10, 2023 21:26
known good ghc 9.4.4 setttings file
[("GCC extra via C opts", "")
,("C compiler command", "gcc")
,("C compiler flags", "--target=arm64-apple-darwin ")
,("C++ compiler command", "g++")
,("C++ compiler flags", "--target=arm64-apple-darwin ")
,("C compiler link flags", "")
,("C compiler supports -no-pie", "NO")
,("Haskell CPP command", "gcc")
,("Haskell CPP flags", "-E -undef -traditional -Wno-invalid-pp-token -Wno-unicode -Wno-trigraphs")
,("ld command", "ld")
cartazio / finitary.agda
Created January 4, 2022 17:50 — forked from atennapel/finitary.agda
Finitary non-indexed datatype signatures
{-# OPTIONS --type-in-type #-}
open import Agda.Builtin.Unit
open import Agda.Builtin.Sigma
open import Data.Product
data Ty : Set where
U : Ty
Pi : (A : Set) -> (A -> Ty) -> Ty
PiInd : Ty -> Ty
cartazio / howto grep
Last active September 7, 2021 21:05
how to grep all of hackage!

first decide where to place your local copy of stuff


how to get the most recent version of everything

cabal list --simple | awk '{print ($1)}' | uniq | time xargs -P20 -n1 cabal get

then use grep/ ripgrep or whatever to find where code exists/is used/ is defined

then look at the matches

#! /usr/local/bin/fish
if test -n "$HOME" ;
set -xg NIX_LINK "$HOME/.nix-profile"
# Set the default profile.
if not test -L "$NIX_LINK" ;
echo "creating $NIX_LINK" >&2
set -l _NIX_DEF_LINK /nix/var/nix/profiles/default
/nix/store/cdybb3hbbxf6k84c165075y7vkv24vm2-coreutils-8.23/bin/ln -s "$_NIX_DEF_LINK" "$NIX_LINK"
$ rg -e fromListN -t haskell ./
139: let termCounts = V.fromListN (M.size nodeItems)
174: let termCounts = V.fromListN (M.size nodeItems)
171: let termCounts = V.fromListN (M.size nodeItems)
d/dx (x ^ a) == d/dx (a -> x )
we never consider a ^ x === x -> a ()
log_x(\nu Y -> T) == \mu Z -> log_X T , where Z == log_X Y
(translation: every time we see log_X Y , in T, replace taht with Z )
module Main where
import Data.Word
import Data.Int
import Foreign.Ptr
import Foreign.C.Types
main = c_MD5Final `seq` print "yay"
cartazio /
Last active July 5, 2019 04:26
ghc build directions

directions to do a release quality build of GHC == 8.0.* with the Make based build system with all the docs

context: this is a draft for planned edits / cleanups to the current mac build directions

getting setup

  1. have apple command line tools installed, as well as mactex, and your favorite OS X package manager (which for the rest of these directions we assume is brew)

  2. since we assume we're using brew, install it!