This file contains 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
/** | |
* A logarithmic string length algorithm in the TypeScript type system utilizing | |
* a memoizing recursive type. Computes the length of any string with far | |
* superior performance than any other current implementations via a doubling | |
* cache and string patterns backing the checks. Works for any string with less | |
* than 10,000 characters due to the tuple size limits for the cache (in total). | |
* | |
* @author Carter Snook <[email protected]> github.com/sno2 | |
* @license https://unlicense.org/ (credit would be nice tho) | |
*/ |
This file contains 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
A: How are you? | |
B: Good. How is your day going? | |
A: Tentatively good! I'm doing a bit of homework that's due tomorrow but it doesn't mean much! I've got some more projects to finish today though so that's good | |
B: What's your most favourite thing you've done for a project? | |
A: I really liked writing for a bit. Writing for a company I've worked for was a bit tough. | |
B: I like writing too! What did you write? | |
A: A story that I was working on at the time I wrote this one. I've also been writing a lot lately, actually. |
This file contains 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
function add(a: number, b: number): Promise<number> { | |
return Promise.resolve(a + b); | |
} | |
{ | |
const safeAdd = goify(add); | |
const [val /* 7 */, err /* null */] = await safeAdd(2, 5); | |
} |