Skip to content

Instantly share code, notes, and snippets.

View forrest-akin's full-sized avatar
😎

Forrest Akin forrest-akin

😎
View GitHub Profile
@Avaq
Avaq / combinators.js
Last active July 4, 2024 07:20
Common combinators in JavaScript
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
@yelouafi
yelouafi / algebraic-effects-series-1.md
Last active June 29, 2024 20:05
Operational Introduction to Algebraic Effects and Continuations

Algebraic Effects in JavaScript part 1 - continuations and control transfer

This is the first post of a series about Algebraic Effects and Handlers.

There are 2 ways to approach this topic:

  • Denotational: explain Algebraic Effects in terms of their meaning in mathematics/Category theory
  • Operational: explain the mechanic of Algebraic Effects by showing how they operate under a chosen runtime environment

Both approaches are valuables and give different insights on the topic. However, not everyone (including me), has the prerequisites to grasp the concepts of Category theory and Abstract Algebra. On the other hand, the operational approach is accessible to a much wider audience of programmers even if it doesn't provide the full picture.

@graninas
graninas / haskeller_competency_matrix.md
Last active June 30, 2024 10:13
Haskeller competency matrix
@hwayne
hwayne / channels.tla
Created September 2, 2020 19:58
Go Channels in TLA+
A model of https://utcc.utoronto.ca/~cks/space/blog/programming/GoConcurrencyStillNotEasy
---- MODULE channels ----
EXTENDS Integers, TLC, Sequences
CONSTANTS NumWorkers, NumTokens
NULL == "NULL" \* Should be a constant, being lazy
Workers == 1..NumWorkers
Processes == Workers \union {0} \* Main
@mmazzarolo
mmazzarolo / service-workers.md
Last active April 22, 2024 03:40
Service Workers Tips

Service Workers Tips

Reloading a service worker

Reloading a page won't update/remove the previous version of its service worker. To make sure you're using the latest version of your service worker, make sure to check the "Update on reload" toggle in the "Application" ⭢ "Service Workers" section of the Chrome DevTools.

Simulate a network condition

To simulate a network condition (e.g.: offline, 3g, etc...) in a service worker on Chrome, uncheck the "Update on reload" toggle.