diff --git a/cmd/lambda/lambda_engine_list.go b/cmd/lambda/lambda_engine_list.go index 338098d..c69dbd3 100644 --- a/cmd/lambda/lambda_engine_list.go +++ b/cmd/lambda/lambda_engine_list.go @@ -11,7 +11,7 @@ func LambdaEngineList() *cobra.Command { Use: "list", Aliases: []string{"ls"}, Short: "List available engines", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(*cobra.Command, []string) error { r := GetRegistry() for engine := range r.ListEngines() { diff --git a/pkg/codec/codec.go b/pkg/codec/codec.go index ecbe258..160547d 100644 --- a/pkg/codec/codec.go +++ b/pkg/codec/codec.go @@ -1,8 +1,20 @@ +// Package codec defines processes to convert between different representations +// of lambda calculus, and serialize the different representations. package codec +// A Conversion is a function that turns one representation into another. +// Returns an error if the input expression cannot be converted. type Conversion[T, U any] = func(T) (U, error) +// A Codec is an object that can serialize/deserialize one type of +// representation. It is assumed that for any x ∋ T, Decode(Encode(x)) = x. type Codec[T any] interface { + // Encode takes an expression, and returns its serialized format, as a + // string. Returns an error if the expression cannot be serialized. Encode(T) (string, error) + + // Decode takes the serialized format of an expression, and returns its true + // value. Returns an error if the string doesn't correctly represent any + // valid expression. Decode(string) (T, error) } diff --git a/pkg/lambda/expression.go b/pkg/lambda/lambda.go similarity index 100% rename from pkg/lambda/expression.go rename to pkg/lambda/lambda.go