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 NoMonomorphismRestriction #-} | |
module Main (main) where | |
import Control.Monad (void) | |
import Control.Monad.Identity | |
import Criterion.Main | |
import qualified Data.Conduit as C | |
import qualified Data.Conduit.Combinators as CC | |
import qualified Data.Conduit.List as C | |
import qualified Data.Machine as M |
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
data Spine a | |
= NS (NS a a (a,a,a)) | |
| AS (AS a a a) | |
deriving (Show) | |
-- non-adjacent spine: list of increasing size trees, with no two trees of adjacent index | |
data NS a b c | |
= Nil | |
| NMore (NS a c (a,b,c)) | |
| NCons b (NS a (a,b,c) (a,c,(a,b,c))) |
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
-- Inspired by https://www.fpcomplete.com/user/edwardk/fibonacci/leonardo | |
open import Data.Nat | |
module Leonardo (A : Set) where | |
-- Tree n is a tree of size the nth Leonardo number | |
data Tree : ℕ → Set where | |
tip : A → Tree 0 | |
tip' : A → Tree 1 |
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 2013-11-13-relations where | |
open import Level hiding (zero;suc) | |
open import Function | |
open import Relation.Binary hiding (Sym) | |
open import Relation.Binary.PropositionalEquality as PE hiding (subst;sym;trans;refl) | |
open import Data.Empty | |
open import Data.Product using (∃) | |
open import Induction.WellFounded |
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 2013-12-20-confluence-problem-v2 where | |
open import 2013-12-20-relations | |
open import Function | |
open import Data.Unit using (⊤;tt) | |
open import Relation.Binary hiding (Sym) | |
open import Relation.Binary.PropositionalEquality as PE hiding (subst;sym;trans;refl) | |
open import Data.Product as P hiding (map;zip;swap) | |
open import Data.Nat as Nat hiding (fold) | |
open import Data.Nat.Properties as NatP |
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 2013-11-13-confluence-problem where | |
open import 2013-11-13-relations | |
open import Function | |
open import Data.Unit using (⊤;tt) | |
open import Relation.Binary hiding (Sym) | |
open import Relation.Binary.PropositionalEquality as PE hiding (subst;sym;trans;refl) | |
open import Data.Product as P hiding (map;zip;swap) | |
open import Data.Nat as Nat hiding (fold) | |
open import Data.Nat.Properties as NatP |
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
-- Formalization of untyped lambda calculus | |
module 2013-10-23-lambda where | |
open import Level hiding (zero;suc) | |
open import Function using (_∘_;id;_⟨_⟩_) | |
open import Data.Empty | |
open import Data.Star as Star using (Star;_◅_;_◅◅_;ε;_⋆) | |
open import Relation.Binary | |
open import Relation.Binary.PropositionalEquality hiding (subst) | |
open import Data.Product as P hiding (map;zip) |
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 --without-K #-} | |
module 2013-06-26-midpoints where | |
{- | |
This is a proof that the HIT | |
data S A where | |
[_] : A -> S A; | |
mid : {x y : A} -> Id x y -> Id [ x ] [ y ] |
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 Sorting where | |
-- See https://www.twanvl.nl/blog/agda/sorting | |
open import Level using () renaming (zero to ℓ₀;_⊔_ to lmax) | |
open import Data.List hiding (merge) | |
open import Data.List.Properties | |
open import Data.Nat hiding (_≟_;_≤?_) | |
open import Data.Nat.Properties hiding (_≟_;_≤?_;≤-refl;≤-trans) | |
open import Data.Nat.Logarithm | |
open import Data.Nat.Induction |
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
{- | |
http://noamlewis.wordpress.com/2013/02/12/penalty-search-problem-revisited-dynamic-programming-control-parallel-to-the-rescue/ | |
-} | |
import Data.MemoCombinators | |
--f k = fromIntegral k | |
data CostTree |
NewerOlder