Skip to content

Instantly share code, notes, and snippets.

Chaitanya Koparkar ckoparkar

  • Indiana University
  • Bloomington, IN
View GitHub Profile

Rough notes as I read and use

  • I'm using luarocks for the first time today, but what's bad about it and what is letrec trying to fix?
  • Dang, letrec should be named something else...
  • The store should slurp in modules compiled as .so/.dll files as well? Need to search under package.cpath...
  • Minor point, but all the built-in modules (table, string etc.) should be added to skip-module?.
  • "-meta" files should contain more metadata...? Maybe something like:
   +  log-meta-SHA.lua
View A.hs
-- ghc-8.6.5 -O0 -ddump-ds -ddump-simpl -ddump-to-file -fexpose-all-unfoldings -dsuppress-uniques \
-- -fforce-recomp -dsuppress-idinfo A.hs
module A where
import qualified Data.Map as M
data Foo = A Int
| B Foo Int
deriving Eq
View bug.v
Require Import List.
Require Import Omega.
Import ListNotations.
Definition strong_head {A : Type} : forall ls : list A, ls <> [] -> A.
refine (fun (ls : list A) =>
match ls with
| [] => fun _ => _
| a :: _ => fun _ => a
View pldi.patch
diff --git a/pldi19/ b/pldi19/
index 1bf8650..412c330 100755
--- a/pldi19/
+++ b/pldi19/
echo "Running in-memory benchmarks (Table 1)..."
echo "Sending results to $LITMUS_RESULT_FILE"
-# Some benchmarks require 100M iterations. Only used for CNF and Cap'n Proto.
View add1_no_gc.c
#include <assert.h>
#include <stdio.h>
// #include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <alloca.h>
#include <sys/mman.h>
#include <sys/resource.h>
#include <sys/stat.h>
View nocase_test_litmus_add1.c
#include <assert.h>
#include <stdio.h>
// #include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <alloca.h>
#include <sys/mman.h>
#include <sys/resource.h>
#include <sys/stat.h>
View Locs.gib
Prog {ddefs = [("Tree",
DDef {tyName = "Tree",
dataCons = [("Leaf", [(False, IntTy)]),
[(False, PackedTy "Tree" "loc92"),
(False, PackedTy "Tree" "loc93")]),
[(False, CursorTy),(False, PackedTy "Tree" "loc94"),
(False, PackedTy "Tree" "loc95")]),
("INDIRECTION159", [(False, CursorTy)])]})],
View Bug.hs
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ForeignFunctionInterface #-}
{-# OPTIONS_GHC -Wno-name-shadowing #-}
module Bug where
`rts.c` has a minimal RTS I'm using to test the object file linking. It houses the `main` function.
The main function calls `main_expr`, which is provided by this LLVM module.
View Blade.hs
module Blade where
import qualified Data.Set as S
-- Implemented the inclusion-exclusion algorithm:
-- <>
-- (∑ Aj) in the formula
-- These all the numbers we've counted more than once
doubleCounts :: [Int]
View Tree.hs
module Tree where
data Tree = Leaf Int | Node Int Tree Tree
deriving (Show, Read, Eq, Ord)
type Forest = [Tree]
mkTree :: Int -> Tree
mkTree n =
case n of
You can’t perform that action at this time.