Skip to content

Instantly share code, notes, and snippets.

Avatar

Carter Tazio Schonwald cartazio

View GitHub Profile
@cartazio
cartazio / settings
Created February 10, 2023 21:26
known good ghc 9.4.4 setttings file
View settings
[("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
cartazio / finitary.agda
Created January 4, 2022 17:50 — forked from atennapel/finitary.agda
Finitary non-indexed datatype signatures
View finitary.agda
{-# 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
cartazio / howto grep hackage.md
Last active September 7, 2021 21:05
how to grep all of hackage!
View howto grep hackage.md

first decide where to place your local copy of stuff

cd $YOURPLACE

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

View $HOME .nix-profile etc profile.d nix.fish
#! /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"
end
View examples-fromListN.hs
$ rg -e fromListN -t haskell ./
./network-topic-models-0.2.0.1/RunLDA.hs
139: let termCounts = V.fromListN (M.size nodeItems)
./network-topic-models-0.2.0.1/RunCI.hs
174: let termCounts = V.fromListN (M.size nodeItems)
./network-topic-models-0.2.0.1/RunST.hs
171: let termCounts = V.fromListN (M.size nodeItems)
View babyCalculusEqations.hs
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 )
View Sadd.hs
module Main where
import Data.Word
import Data.Int
import Foreign.Ptr
import Foreign.C.Types
main = c_MD5Final `seq` print "yay"
@cartazio
cartazio / ghc-8.0-mac-build-steps.md
Last active July 5, 2019 04:26
ghc build directions
View ghc-8.0-mac-build-steps.md

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!

@cartazio
cartazio / StructExample.hs
Created June 6, 2019 23:31
hacky unfinished scribblings about how to do fancy struct instances
View StructExample.hs
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE RoleAnnotations #-}
{-# LANGUAGE ExplicitForAll#-}
module Main where
import Data.Struct
--import Data.Struct.TH
--import qualified Data.Coerce as Crc
import Data.Coerce (coerce)
@cartazio
cartazio / xcode5-haskell-directions.md
Last active May 28, 2019 00:35
xcode 5 + OS X 10.9 mavericks GHC work around nuttiness
View xcode5-haskell-directions.md

PSA :

just use GHC for OSX https://ghcformacosx.github.io

the rest of these directions are preserved for historical purposes

TLDR version, if you have homebrew

xcode-select --install ; brew tap homebrew/versions ;   brew tap homebrew/dupes \