docs: registry
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
// Package convert defined some standard conversions between various types of
|
||||
// representations.
|
||||
package convert
|
||||
|
||||
import (
|
||||
@@ -124,10 +126,13 @@ func decodeExression(l lambda.Expression) saccharine.Expression {
|
||||
}
|
||||
}
|
||||
|
||||
// Lambda2Saccharine converts a pure lambda calculus expression into its
|
||||
// Saccharine counterpart.
|
||||
func Lambda2Saccharine(l lambda.Expression) (saccharine.Expression, error) {
|
||||
return decodeExression(l), nil
|
||||
}
|
||||
|
||||
// Saccharine2Lambda desugars a saccharine expression into pure lambda calculus.
|
||||
func Saccharine2Lambda(s saccharine.Expression) (lambda.Expression, error) {
|
||||
return encodeExpression(s), nil
|
||||
}
|
||||
|
||||
@@ -2,11 +2,17 @@
|
||||
// expression.
|
||||
package engine
|
||||
|
||||
// A Process handles the reduction of a
|
||||
// A Process handles the reduction of a single expression.
|
||||
type Process[T any] interface {
|
||||
// Get the current state of the process.
|
||||
// Returns an error if the current state cannot be represented.
|
||||
Get() (T, error)
|
||||
|
||||
// Step performs reduction(s) on the representation. If the number of steps
|
||||
// defined is less than zero, it will perform as many reductions as
|
||||
// possible. Returns whether a reduction was performed.
|
||||
Step(int) bool
|
||||
}
|
||||
|
||||
// An Engine is an object that handles
|
||||
// An Engine is an function that generates reduction processes.
|
||||
type Engine[T any] = func(T) (Process[T], error)
|
||||
|
||||
Reference in New Issue
Block a user