How to destructure types #2255
Answered
by
wilkomanger
wilkomanger
asked this question in
Questions & support
-
Perhaps I've missed it, but I saw that you can destructure lists and tuples: (Missing from the Language Tour btw) let [x, y] = [1, 2]
let #(u, v) = $(3, 4) How can this be done with types? Such as: type Something {
Something(first: Int, second: Int)
}
let (first, second) = function_that_returns_something() |
Beta Was this translation helpful? Give feedback.
Answered by
wilkomanger
Jun 30, 2023
Replies: 1 comment 2 replies
-
Figured it out 😄 type Something {
Something(first: Int, second: Int)
}
let Something(first, second) = function_that_returns_something() Would be nice to mention in the Let bindings page in the Language Tour! |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
wilkomanger
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Figured it out 😄
Would be nice to mention in the Let bindings page in the Language Tour!