Skip to content

Instantly share code, notes, and snippets.

View andrejbauer's full-sized avatar

Andrej Bauer andrejbauer

View GitHub Profile
@zoeyfyi
zoeyfyi / Main.hs
Created November 22, 2022 07:12
Agda JSON backend
module Main (main) where
import Agda.Compiler.Backend (Backend (..), Backend' (..), Recompile (Recompile), callBackend, setTCLens)
import Agda.Compiler.Common (IsMain (..))
import Agda.Interaction.BasicOps (atTopLevel)
import Agda.Interaction.FindFile (SourceFile (..))
import Agda.Interaction.Imports (CheckResult (..), Mode (..), parseSource, typeCheckMain)
import Agda.Interaction.Options qualified as A (defaultOptions)
import Agda.Syntax.Abstract.Name qualified as A (ModuleName, QName (..))
import Agda.Syntax.Internal qualified as A (Name (..))
@pyrocto
pyrocto / TeX113.inputplugin
Created July 13, 2020 20:21
LaTeX-like names for unicode math symbols
#
METHOD: TABLE
ENCODE: Unicode
PROMPT: TeX 1.13
VERSION: 1.13
DELIMITER: ,
VALIDINPUTKEY: ^,.?!:;"'/\()[]{}<>$%&@*01234567890123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
TERMINPUTKEY:
BEGINCHARACTER
alpha α
@AndrasKovacs
AndrasKovacs / Ordinals.agda
Last active November 9, 2023 03:17
Large countable ordinals and numbers in Agda
{-# OPTIONS --postfix-projections --without-K --safe #-}
{-
Large countable ordinals in Agda. For examples, see the bottom of this file.
Checked with Agda 2.6.0.1.
Countable ordinals are useful in "big number" contests, because they
can be directly converted into fast-growing ℕ → ℕ functions via the
fast-growing hierarchy:
@sandello
sandello / sifp.cpp
Created February 29, 2012 23:47
Seemingly Impossible Functional Program in C++
// Ivan Pouzyrevsky, EWSCS'12.
#include <iostream>
#include <functional>
#include <memory>
#include <utility>
// This is a C++ implementation for Seemingly Impossible Functional Program, which in finite time tests whether
// a computable predicate on binary strings yields True for some binary string. It does so by exhaustive search
// on whole space. Some nasty-nasty tricks like call-by-need can make this algorithm run fast.