This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Tests whether the input is a list. | |
| * A list is an array with one row or column. | |
| */ | |
| isList = LAMBDA(input, AND(TYPE(input) = 64, OR(ROWS(input) = 1, COLUMNS(input) = 1))); | |
| /** | |
| * Applies an array-returning function to each element of the input list, | |
| * returning a flattened array. The result are arranged vertically. | |
| * ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _search = LAMBDA(txt, searchtext, [case_sensitive], | |
| // Test the inputs for errors so that we can distinguish | |
| // the error that comes from FIND/SEARCH as meaning "not-found". | |
| IFS( | |
| ISERROR(txt), | |
| txt, | |
| ISERROR(searchtext), | |
| searchtext, | |
| ISERROR(case_sensitive), | |
| case_sensitive, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Returns the day of the week for the provided date, | |
| * where Monday is the first day. | |
| */ | |
| dayOfWeek = LAMBDA(datetime, WEEKDAY(datetime, 2)); | |
| /** | |
| * Returns the name for the day of the week for the provided date. | |
| */ | |
| dayOfWeekName = LAMBDA(datetime, TEXT(datetime, "dddd")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface Lit<K> { | |
| kind: 'lit'; | |
| value: K; | |
| } | |
| interface BinOp<T> { | |
| kind: 'binop'; | |
| l: T; | |
| r: T; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface ObjectType { | |
| kind: "object" | |
| props: {[k: string]: Type[]}; | |
| } | |
| interface FunctionType { | |
| kind: "function"; | |
| calls: CallType[]; | |
| } |