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
Does KCL have a way to type-hint first-class functions? i.e. this works with kcl run:
hello = lambda fn: any, c: int, d: int -> int {
fn(c, d)
}
a = hello((lambda a: int, b: int -> int {a + b}), 1, 2)
But obviously fn: any is a lie. I really need fn to be of the form (pseudocode incoming) (a: int, b: int) -> int, but I can't find anything like this in the documentation / other discussions (based on searching for "first-class" and "currying")
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Does KCL have a way to type-hint first-class functions? i.e. this works with
kcl run
:But obviously
fn: any
is a lie. I really needfn
to be of the form (pseudocode incoming)(a: int, b: int) -> int
, but I can't find anything like this in the documentation / other discussions (based on searching for "first-class" and "currying")Beta Was this translation helpful? Give feedback.
All reactions