Gabriele Petronella
gabro27.bsky.social
Gabriele Petronella
@gabro27.bsky.social
Co-founder and CTO @ buildo.com
Watching the video I think this is as typesafe as useContext. It won’t statically enforce that it is set, it will just enforce what you can set/get from it.

Your example is the same as not setting a Provider, from what I can understand
October 12, 2025 at 12:24 PM
I first learned about it in react aria examples, where IIRC it’s used to display the value of the slider knob as it changes
October 11, 2025 at 3:14 PM
I’ve done the first few lessons and I’m finally building an intuition for when to use transitions vs keyframe animations.
September 27, 2025 at 7:21 PM
If you make that “lazy” you can:

const x = () => f()
const y = () => f()

is the same program as

const x = () => f()
const y = x
September 6, 2025 at 4:58 AM
It’s required in the sense that eager computations do not follow this property, eg. if f returns a Promise

const x = f()
const y = f()

is not safely replaceable by

const x = f()
const y = x

since Promises are eager and their result is cached
September 6, 2025 at 4:58 AM
In PL theory it’s also called referential transparency, and it’s a really cool property to have!
September 6, 2025 at 4:50 AM
Right, so back to the original example,
the cardinality of Unit -> X is the same as X.
The cardinality of X -> Unit is 1.
September 5, 2025 at 8:16 PM
One hand wavy intuition is that types have cardinalities: Unit has a cardinality of 1, so going in that direction you’re “shrinking” X and losing information (you’re mapping infinite X to 1).
It’s a bit like hashing (going from a big set to a smaller set), if that makes any sense
September 5, 2025 at 7:59 PM
The fascinating thing is that in languages like Scala this is actually how it works, not just in theory.

def f = 42 // a function without parameters

type checks the same as

val f = 42 // a constant value

(*caveats apply because the JVM, but this is conceptually sound)
September 5, 2025 at 7:48 PM
Basically:
() => x is the same as x

but

(x) => {} is not the same as x
September 5, 2025 at 7:45 PM
Unit -> X means you create an X from nothing. The only possible way is having an X already. In js terms: a function returning a constant is isomorphic to that constant

X -> Unit consumes an X, so it’s not the same as having an X.
September 5, 2025 at 7:38 PM
I’ve straight up started seeing nudity/soft porn (not marked as such) in my Discover timeline
September 5, 2025 at 6:12 PM
Very different, but yeah, you basically play normal chess for 2 mins and then it becomes flag fiesta
August 17, 2025 at 9:10 AM
Finally, Scala 3 is quite advanced in this regard, and there’s is active research to build an effect system into the language using “capabilities”, which again is another angle to “proofs” (e.g. prove this function does not throw).
Here’s a cool paper (a bit hard to digest, but you might like it)
Capturing Types | ACM Transactions on Programming Languages and Systems
Type systems usually characterize the shape of values but not their free variables. However, many desirable safety properties could be guaranteed if one knew the free variables captured by values. We ...
dl.acm.org
August 16, 2025 at 10:27 PM
They’re similar in the sense that you need to “prove” you have a db instance before you can use, or “prove” you know how to add two things, etc. Often you can materialize those proofs by importing a library, similarly to the Mathlib examples in your post
August 16, 2025 at 10:27 PM
Not sure how much you know about it already, but you may like the concept of “typeclasses” which are widely used in those languages and sort of resemble proofs in Lean.
August 16, 2025 at 10:27 PM
Pleasant read, thanks for the intro!
Many concepts you talk about are alien in TypeScript, but quite familiar in functional languages like Haskell and Scala (Lean syntax looks a bit like Haskell and I doubt it’s coincidental).
August 16, 2025 at 10:27 PM
Bullet is the worse, I play 3-0 and that’s barely considerable chess at my level
August 16, 2025 at 5:26 PM
Uninteresting is one thing, but I can definitely when it goes off tracks completely. Usually it’s like 20-30 relevant posts and then it shows popular network posts (aka crap).
Now it’s just crap , so it’s broken like it was a while back when they found and fixed a bug after @danabra.mov reported it
August 3, 2025 at 8:48 PM
AI generated PRs like this deserve random AI generated reviews. Kinda like Cloudflare AI labyrinth, but for PRs. Let the bots fight each other!
July 24, 2025 at 7:44 PM