core icon indicating copy to clipboard operation
core copied to clipboard

Translate F#/C# tuple deconstruction to TypeScript deconstruction

Open Jand42 opened this issue 8 years ago • 0 comments

F#

let (a, b, _, _) = t

and C#

var (a, b, _, _) = t;

tuple deconstruction should both translate to nice TypeScript array deconstruction:

let [a, b, , ] = x

F# list decontruction

let (h :: t) = l

is also possible to map to

switch (l.$) {
  case 0:
    throw new WebSharper.MatchFailureException(0, 0, 0);
  case 1:
    var { $1: h, $2: t } = l;
}

Jand42 avatar Oct 11 '17 17:10 Jand42