Skip to content

Instantly share code, notes, and snippets.

View Arrow7000's full-sized avatar
πŸ‘¨β€πŸ’»
thinking about types

Aron Adler Arrow7000

πŸ‘¨β€πŸ’»
thinking about types
View GitHub Profile
@apieceofbart
apieceofbart / test.js
Last active August 20, 2024 23:56
Async testing with jest fake timers and promises
PLEASE CHECK THIS REPO WITH THE EXAMPLES THAT YOU CAN RUN:
https://github.com/apieceofbart/async-testing-with-jest-fake-timers-and-promises
// Let's say you have a function that does some async operation inside setTimeout (think of polling for data)
function runInterval(callback, interval = 1000) {
setInterval(async () => {
const results = await Promise.resolve(42) // this might fetch some data from server
callback(results)
}, interval)
type AsyncOptionBuilder() =
member __.Return (value: 'T) : Async<Option<'T>> =
async { return Some value }
member __.ReturnFrom
(asyncResult: Async<Option<_>>)
: Async<Option<_>> =
asyncResult

Examples

[@import stdlib.http.v1];

(x => y => (x_plus_y: x + y) => );

((A, x))
(f: () -> (A: *, x: A)) =>
  (A, x) = (f ());
@VictorTaelin
VictorTaelin / hoc_historical_overview.md
Last active April 26, 2025 15:08
Higher Order Company: Complete Historical Overview - WIP

Higher-Order Company: Complete Historical Overview

This document is a complete historical overview of the Higher Order Company. If you want to learn anything about our background, a good way to do so is to feed this Gist into an AI (like Sonnet-3.5) and ask it any question!

My Search for a Perfect Language

It all started around 2015. I was an ambitious 21-year-old CS student who, somehow, had been programming for the last 10 years, and I had a clear goal:

I want to become the greatest programmer alive