This file contains 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 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 | |
, ImplicitParams | |
, LambdaCase | |
, OverloadedStrings | |
, PatternSynonyms | |
, Strict | |
, UnicodeSyntax | |
#-} | |
{-# options_ghc -Wincomplete-patterns -Wunused-imports #-} |
This file contains 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 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 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 Main | |
data Expr = E | |
data Stmt | |
= If Expr Stmt Stmt -- if (condition) then A else B | |
-- loop (condition): | |
-- do xxx | |
| Loop Expr Stmt | |
| SE String |
This file contains 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 Main | |
import Control.App | |
import Control.App.Console | |
import Data.SortedSet | |
data Op = Add | Sub | Mul | Div | |
data Expr | |
= Var String |
This file contains 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 #-} | |
module Tyck | |
( Term (..), | |
Type (..), | |
emptyContext, | |
emptySolution, | |
topInfer, | |
infer, | |
check, |
This file contains 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
#lang racket | |
(define prime-list '(2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59)) | |
(define (factor-list n) | |
(define p-factor-list | |
(for/list ([p prime-list] | |
#:when (= (remainder n p) 0)) | |
p)) | |
(println p-factor-list) |
This file contains 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
#lang racket | |
(require syntax/parse/define | |
(for-syntax syntax/stx)) | |
(begin-for-syntax | |
(define-syntax-class type | |
#:datum-literals (->) | |
(pattern (~literal Type) | |
#:attr occurs (λ (D) #f)) | |
(pattern x:id |
This file contains 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
#lang racket/base | |
(require racket/future | |
racket/async-channel | |
racket/function | |
racket/match) | |
(define process-map (make-hasheq)) | |
(struct pid ()) | |
(struct process (id fu ch)) |
NewerOlder