ballercat / walt

:zap: Walt is a JavaScript-like syntax for WebAssembly text format :zap:

Home Page:https://ballercat.github.io/walt/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lambda Generic

ballercat opened this issue · comments

Goal

Avoid custom keyword lambda

Overview

Instead of a lambda keyword, we could use a Lambda<> generic type to wrap regular function types to convert them to a lambda type.

Acceptance Criteria

This syntax should work

type Fun = (i32) => i32;
type Closure = Lambda<Fun>;

function getCosure(): Closure {
  ...
}
  • The above works
  • Tests