title | date | tags | ||
---|---|---|---|---|
GCMForMojo 的部署与设置 |
2017-01-21 11:07:03 -0800 |
|
When it comes to encoding data on the pure λ-calculus (without complex extensions such as ADTs), there are 3 widely used approaches.
The Church Encoding, which represents data structures as their folds. Using Caramel’s syntax, the natural number 3 is, for example. represented as:
0 c0 = (f x -> x)
1 c1 = (f x -> (f x))
2 c2 = (f x -> (f (f x)))
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 --prop --without-K --safe #-} | |
module Synthesis where | |
-- Utilities | |
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_) | |
open import Agda.Builtin.Equality using (_≡_; refl) | |
open import Agda.Builtin.Nat using (zero; suc; _+_) renaming (Nat to ℕ) | |
infixl 8 _∧_ _×_ |