You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Declares a type for a lambda that can be passed around similar to an interface.
Parameters
export (optional): keyword to expose the lambda type declaration publicly
typeName: PascalCase name of the type
returnType: What type the lambda returns
(parameterName, parameterType): Zero or more pairs of parameter names and types
Sample usage
lambda type declare : export FormatInt string value int
Why?
This is different from lambda type inline (#588), which is more akin to declaring a type primitive like null.
Languages need a prettier way than lambda type inline to declare lambda types, especially when many methods take in the same lambda type.
For example, in C#, FormatInt would be:
publicdelegatestringFormatInt(intvalue);
...while in TypeScript, FormatInt would be:
typeFormatInt=(value: number)=>string;
The text was updated successfully, but these errors were encountered:
What command(s) would you like to add?
lambda type declare
Declares a type for a lambda that can be passed around similar to an interface.
Parameters
export
(optional): keyword to expose the lambda type declaration publiclytypeName
: PascalCase name of the typereturnType
: What type the lambda returnsparameterName
,parameterType
): Zero or more pairs of parameter names and typesSample usage
Why?
This is different from
lambda type inline
(#588), which is more akin to declaring a type primitive likenull
.Languages need a prettier way than
lambda type inline
to declare lambda types, especially when many methods take in the same lambda type.For example, in C#,
FormatInt
would be:...while in TypeScript,
FormatInt
would be:The text was updated successfully, but these errors were encountered: