This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {- | |
| This file demonstrates a technique for making working with de Bruijn-indexed | |
| terms easier that I learnt from the paper /The Linearity Monad/ by Jennifer | |
| Paykin and Steve Zdancewic. After defining well-typed terms `Γ ⊢ τ` using de Bruijn | |
| indices, we define an auxiliary function `lam` that takes in the variable term explicitly: | |
| > lam : {V : Type} {Γ : Cxt V} {τ σ : Ty V} | |
| > → (({Δ : Cxt V} → {{IsExt Δ (Γ , τ)}} → Δ ⊢ τ) | |
| > → (Γ , τ) ⊢ σ) | |
| > → Γ ⊢ τ ⇒ σ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# OPTIONS --postfix-projections #-} | |
| module tuple where | |
| ------------------------------------------------------------------------------ | |
| -- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# language | |
| BlockArguments | |
| , ConstraintKinds | |
| , ImplicitParams | |
| , LambdaCase | |
| , OverloadedStrings | |
| , PatternSynonyms | |
| , Strict | |
| , UnicodeSyntax | |
| #-} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| ## Defaults | |
| keepGensDef=30; keepDaysDef=30 | |
| keepGens=$keepGensDef; keepDays=$keepDaysDef | |
| ## Usage | |
| usage () { | |
| printf "Usage:\n\t ./trim-generations.sh <keep-gernerations> <keep-days> <profile> \n\n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module C : sig | |
| type t | |
| val empty : t | |
| val one : char -> t | |
| val union : t -> t -> t | |
| val inter : t -> t -> t | |
| val top : t | |
| val mem : char -> t -> bool | |
| val make : (char -> bool) -> t | |
| val equal : t -> t -> bool |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# OPTIONS --cubical #-} | |
| module natmod where | |
| open import Cubical.Foundations.Prelude | |
| data Ctx : Type | |
| data _⊢_ : Ctx → Ctx → Type | |
| data Ty : Ctx → Type | |
| data Tm : Ctx → Type | |
| -- This is halfway between EAT and GAT. | |
| -- GAT is hard! Why is EAT so easy? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# OPTIONS --cubical --no-import-sorts --postfix-projections -W ignore #-} | |
| module freeCCC where | |
| open import Cubical.Foundations.Prelude | |
| open import Cubical.Foundations.HLevels | |
| open import Cubical.Foundations.Function | |
| open import Cubical.Foundations.Isomorphism | |
| open import Cubical.Data.Unit using (Unit; isPropUnit; isSetUnit) | |
| open import Cubical.Data.Bool using (Bool; true; false; if_then_else_; isSetBool) | |
| open import Cubical.Data.Sum using (_⊎_; inr; inl) | |
| open import Cubical.Data.Sigma using (Σ; _×_; ΣPathP) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <string.h> | |
| #include <assert.h> | |
| FILE *in; long M[1<<24]={0}, *D, *R, H=0x130000, IP=0, T; | |
| long getu() { long t, h = getc(in); if (h < 0xC0) return h; | |
| t = ((h&0x1F) << 6) | (getc(in) & 0x3F); if (h < 0xE0) return t; | |
| t = ( t << 6) | (getc(in) & 0x3F); if (h < 0xF0) return t; | |
| t = ( t << 6) | (getc(in) & 0x3F); return t & 0x1FFFFF; } | |
| void putu(long c) { if (c < 0x80) { putchar(c); return; } | |
| if (c < 0x7FF) { putchar(0xC0|(c>>6)); } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# language LambdaCase, Strict, BangPatterns, ViewPatterns, OverloadedStrings #-} | |
| {-# options_ghc -Wincomplete-patterns #-} | |
| module UnivPoly where | |
| import Data.Foldable | |
| import Data.Maybe | |
| import Data.String | |
| import Debug.Trace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; Exporting free identifier table operations that close over a global map | |
| #lang racket/base | |
| (require racket/list | |
| syntax/id-table) | |
| (provide env-ref env-has-id? env-add!) | |
| (define id-table (make-free-id-table)) |
NewerOlder