Closed steeling closed 5 months ago
genTile = lambda _manifest: MyType1 => MyType2 {
...
}
Could be another syntax, unless this is already currently feasible?
nvm, answer is to do:
genTile = lambda _manifest: MyType1 { MyType2 { .... } }
For lambda, KCL will automatically infer your return value type in the function body, although you can explicitly specify it. For example:
f1 = lambda t: Type1 {
Type2 {}
} # The type of f1 is (Type1) -> Type2
f2 = lambda t: Type1 -> Type2 {
Type2 {}
} # The type of f2 is (Type1) -> Type2
Hey @Peefy , made a PR #324
Closed by #324
Looking to get the validation from specifying a return type in lambdas. Is this currently possible?
Something like
Is how I could do this in some other DSL's. Does KCL have some way to specify return types?