Maynard
quelklef.bsky.social
Maynard
@quelklef.bsky.social
Maynard
Here's an interesting (counter)example. The following (get, set) pair satisfies laws #1 and #2 of Data.Lens.Lens, and the WEAKENED form of #3, but not the strongest form.

As such, it provides an example of why the stronger form of law #3 is necessary
February 25, 2025 at 3:13 AM
gotta make sure it's beginner-friendly
February 25, 2025 at 2:34 AM
this single 6-line comment is one of the pieces of code i am most proud of

took quite a time to get to that type signature, and it's so simple, and it just works.
February 13, 2025 at 4:22 AM
Actually 🤔 I suppose we can identify emitter-combinators with emitters via `const`

this is kind of horrible but it works
February 9, 2025 at 2:45 AM
also really enjoying using "wiring diagrams" to explain event-based code

altho tbh I feel like i should learn the actual semantics of wiring diagrams. last i recall a diag like pic below just indicates that a ⊗ b ≤ F(a, b) in some monoidal category (which I am assuming we can relax to "monoid")
February 9, 2025 at 1:27 AM
really enjoying sticking diagrams in my code
February 9, 2025 at 1:27 AM
here is an operation I needed which, to my surprise, I could not find in the FRP libraries I looked at

(though I didn't look super duper hard)
February 2, 2025 at 3:37 AM
February 2, 2025 at 1:47 AM
i have unexpectedly entered the land of FRP
February 2, 2025 at 1:43 AM
you could add a new agent—here I call it PaymentMaker—whose role is to encapsulate this action-at-a-distance, and maybe that would be okay
January 30, 2025 at 8:48 AM
what comes to mind to me is to have the button callback register a listener with the webhook, and await the incoming confirmation
January 30, 2025 at 8:37 AM
for a specific instance, consider a straightforward event-based implementation for a "buy credit" button

the button callback handles initiating the purchase, but a *completely separate* piece of code handles finishing it (updating the UI). this is terrible code locality
January 30, 2025 at 8:37 AM
this is why you should hire me
January 30, 2025 at 5:18 AM
January 28, 2025 at 6:08 AM
January 24, 2025 at 9:51 PM
this feels like what the rest of the world think californians are all like
January 24, 2025 at 7:03 PM
January 21, 2025 at 9:21 PM
January 21, 2025 at 8:45 PM
it works :O
January 7, 2025 at 11:18 AM
I broke GHC :D
January 7, 2025 at 10:22 AM
I DID IT
January 7, 2025 at 8:54 AM
so satisfying to watch code that i forgot i made robust
January 7, 2025 at 7:25 AM
I think this is how I've been doing it ^^
January 6, 2025 at 8:16 PM
what the fuck
January 6, 2025 at 10:49 AM
here's what I believe to be the desugared form of the above

in order for the inner 'fork' to capture up to 'useFork', we need that 'k2' include the 'print'

but getting to the 'print' requires finishing the computation of 'told', which requires running the 'fork'!
January 6, 2025 at 10:48 AM