Skip to content

Instantly share code, notes, and snippets.

View kellenff's full-sized avatar

Kellen Frodelius-Fujimoto kellenff

  • Renton, WA, USA
View GitHub Profile
@beardedtim
beardedtim / monads.md
Last active July 18, 2022 16:40
Monads are like burritos...and trees...and clocks...and...

Monads and Why The Hell We Need Weird Words

Once you understand what monads are, and why they exist, you lose the ability to explain it to anybody.

Here's to hoping I don't understand them

Table of Contents

@ruizb
ruizb / advanced-example.md
Last active September 26, 2023 20:21
Reader monad example using fp-ts

The following section is not part of monet.js documentation, but I think it's worth showing how we can compose readers using fp-ts.

Reader composition

Let's say we have the following piece of code:

interface Dependencies {
  logger: { log: (message: string) => void }
 env: 'development' | 'production'
@castarco
castarco / TypedRegistryPattern.ts
Last active February 9, 2022 13:13
A "new" pattern to create fully-typed registries/containers!
// This first file contains the first iteration of this pattern. It's already
// nice, but not enough for full-fledged IoC libraries.
// There's a second file in this same gist that goes one step further, although,
// for now, it still needs some extra polish.
// -----------------------------------------------------------------------------
// First: the two main interfaces.
// They are the core of the pattern.
// -----------------------------------------------------------------------------
export interface WritableRegistry {