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
From Coq Require Import Program.Basics. | |
Reserved Notation "ยฌ A" (at level 75, right associativity). | |
Notation "โฅ" := Empty_set. | |
Notation "ยฌ A" := (A -> โฅ). | |
Axiom callcc : forall {A B : Type}, ((A -> B) -> A) -> A. | |
Definition LEM {P : Type} : P + ยฌP := |
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
Require Import Coq.Program.Basics. | |
Open Scope program_scope. | |
(* transportแต(p, -) : P(x) โ P(y) *) | |
Definition transport {A : Type} {x y : A} (P : A -> Type) (p : x = y) : P x -> P y := | |
fun (px : P x) => eq_rect x P px y p. | |
(* (f ~ g) := ฮ (x:A) f(x) = g(x) *) | |
Definition homotopy {A : Type} {P : A -> Type} (f g : forall (x : A), P x) : Type := | |
forall (x : A), f x = g x. |
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
(import (scheme base) | |
(only (scheme write) display) | |
(only (srfi 18) make-thread thread-start! thread-join!)) | |
;; Helpers | |
(define-syntax for | |
(syntax-rules () | |
((_ (i start end) body ...) | |
(do ((i start (+ i 1))) |
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 AllowAmbiguousTypes #-} | |
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE PartialTypeSignatures #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE StandaloneDeriving #-} |
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
sat : 'a producer * 'a producer -> 'a producer | |
(p1 <|> p2) ts == case p1 ts | |
of SOME x => SOME x | |
| NONE => p2 ts | |
sat : ('a -> bool) -> 'a producer -> 'a producer | |
sat predicate p ts = case p ts | |
of result as SOME (ERROR _, _) => result | |
| SOME x => if predicate x then SOME x else NONE |
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
.DEFAULT: dict-test | |
dict-test: dict-test.uo | |
mosmlc -toplevel $^ -o $@ | |
key-sig.ui key-sig.uo: key-sig.sml | |
mosmlc -toplevel -c $^ | |
dict-sig.ui dict-sig.uo: dict-sig.sml |
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
signature DICT = | |
sig | |
type key | |
type 'a dict | |
exception NotFound of key | |
val empty : 'a dict | |
val find : key * 'a dict ->'a | |
val bind : key * 'a * 'a dict -> 'a dict | |
end |
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
--[=[ | |
Relevant functions for creating lenses | |
Note that not all functions are always implemented | |
For Lens s t a b: | |
over : (a -> b) -> s -> t | |
Map a function over the target of the lens | |
Ex. over(each..each, function(x) return x+1 end, {{1,2},{3,4}}) |
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
# Latest resolver with ghc-8.4.3 | |
resolver: lts-12.14 | |
# Local packages | |
packages: | |
- . | |
extra-deps: | |
- Cabal-2.2.0.1 | |
- MemoTrie-0.6.9 |
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
ring_buffer: 0x404180 | |
Got value 1! | |
================== | |
WARNING: ThreadSanitizer: data race (pid=19155) | |
Read of size 4 at 0x000000404184 by thread T2: | |
#0 ring_dequeue /home/ssoss/Desktop/Amber/Amber/util/tests/minimal-ring-race.c:84 (minimal-race+0x4013c5) | |
#1 consumer /home/ssoss/Desktop/Amber/Amber/util/tests/minimal-ring-race.c:122 (minimal-race+0x4014c5) | |
#2 <null> <null> (libSDL2-2.0.so.0+0x6875f) | |
Previous write of size 4 at 0x000000404184 by thread T1: |
NewerOlder