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
Section Pigeon. | |
Require Import List. | |
Require Import Arith. | |
Variable A : Type. | |
Definition Unique : list A -> Prop := | |
list_rect _ True (fun x xs hyp => ~(In x xs) /\ hyp). | |
Definition Sub (xs ys : list A) : Prop := forall {x}, In x xs -> In x ys. | |
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
open import Data.Nat | |
open import Data.Fin hiding (_+_) | |
open import Function | |
open import Relation.Binary.PropositionalEquality | |
open import Data.Product renaming (map to pmap) | |
open import Data.Vec renaming (map to vmap) hiding ([_]) | |
open import Data.Unit | |
open import Data.Sum renaming (map to smap) | |
open import Level renaming (zero to lzero; suc to lsuc) |
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
import Data.List | |
%default total | |
data Tree : Type -> Type where | |
Tip : Tree a | |
Node : (x : a) -> (l : Tree a) -> (r : Tree a) -> Tree a | |
%name Tree t, u | |
data InTree : a -> Tree a -> Type 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
module _ (A : Set) where | |
open import Data.Empty | |
open import Data.List hiding ([_]) | |
open import Data.Nat | |
open import Data.Product renaming (map to productMap) | |
open import Data.Sum renaming (map to sumMap) | |
open import Data.Unit | |
open import Function |
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, DeriveFunctor #-} | |
import Prelude hiding (pi) | |
import Control.Applicative | |
import Control.Monad | |
import Prelude.Extras | |
import Bound | |
data Term a | |
= Var a |
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 | |
DataKinds, PolyKinds, TypeFamilies, MultiParamTypeClasses, | |
RankNTypes, FlexibleInstances, UndecidableInstances, | |
TypeOperators, ConstraintKinds, FlexibleContexts, | |
DeriveFunctor, ScopedTypeVariables #-} | |
import Data.Proxy | |
import Control.Monad.Free | |
data Pos = Here | GoLeft Pos | GoRight Pos |
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
open import Data.Nat | |
open import Data.List hiding (foldr) | |
open import Function | |
open import Data.Empty | |
open import Relation.Binary.PropositionalEquality | |
open import Data.Product | |
foldr : | |
{A : Set} | |
(B : List A → Set) |
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
import Data.Maybe | |
import Data.Char | |
import Data.List | |
dictionary :: [String] | |
dictionary = [[chr x] | x <- [0..127]] | |
encode :: String -> [Int] | |
encode [] = [] | |
encode (x:xs) = go dictionary [x] xs 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 | |
LambdaCase, NoMonomorphismRestriction, | |
RankNTypes, ScopedTypeVariables, | |
TupleSections, GADTs, FlexibleContexts, | |
ViewPatterns, GeneralizedNewtypeDeriving #-} | |
import Data.List | |
import Data.List.Split | |
import Data.Ord | |
import Control.Lens |
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
open import Function | |
open import Data.Nat | |
open import Data.Fin | |
open import Data.Empty | |
open import Data.Unit | |
open import Relation.Binary.PropositionalEquality | |
open import Relation.Nullary | |
open import Data.Product | |
open import Data.Vec hiding (_∈_; module _∈_) |