Skip to content

Instantly share code, notes, and snippets.

View cxandru's full-sized avatar

Cass Alexandru cxandru

View GitHub Profile
@cxandru
cxandru / Razor.lagda
Created January 12, 2026 12:40
Alexandru's recursion razor
The question is how to encode the mutual nested recursion happening in "razor" using structured recursion (ideally recursive coalgebras)
\begin{code}
open import Level using (Level;_⊔_;0ℓ)
open import Relation.Nullary
open import Relation.Binary.PropositionalEquality.Core
module Razor where
open import Data.Nat
open import Data.Product
open import Function.Base
@cxandru
cxandru / GenerateYourNeighbors.fs
Created November 28, 2024 18:42
Generator for valid Binary Search Trees (BSTs) for property-based testing using FSharp's FsCheck framework
module GenerateYourNeighbors
open FsCheck
type BST<'a> =
| Empty
| Node of BST<'a> * 'a * BST<'a>
[<StructuralEquality;StructuralComparison>]
type Extended<'a when 'a: comparison> =
| NegInfty