Alice ✨
banner
welltypedwit.ch
Alice ✨
@welltypedwit.ch
When the limestone of imperative programming has worn away, the granite of functional programming will be revealed underneath -Simon Peyton Jones

https://welltypedwit.ch
lean fixes this

(sorry)
November 12, 2025 at 1:22 PM
(or if you think that transformers is *slower* than mtl for that matter)
November 12, 2025 at 10:39 AM
literally their first example of gleam code is doing an unchecked side effect!
November 12, 2025 at 10:12 AM
gleam isn't pure though
November 12, 2025 at 9:21 AM
should have said react...
November 12, 2025 at 1:46 AM
what are they saying?
November 11, 2025 at 11:03 PM
i’d even settle for js or python
November 11, 2025 at 10:54 PM
idk, they seem kind of heteronormative
November 11, 2025 at 9:51 PM
js
November 11, 2025 at 7:32 PM
"the first constructor initialized to all defaults" definitely fits that criterion, even for errors
November 11, 2025 at 10:38 AM
in this case, your default value isn't supposed to be semantically meaningful (because that depends on the context), it's supposed to be a default value in the sense that it's definitely valid and can always be trivially constructed.
November 11, 2025 at 10:38 AM
"sensible defaults" don't exist in a vacuum anyway. what can be a default value always depends on the operation you're trying to do on it (that's why a Default type class is such a silly idea).
November 11, 2025 at 10:38 AM
it's not but it's also really not that important tbh (like, most languages get by just fine without it)
November 11, 2025 at 10:31 AM
it can be the first constructor all initialized to default values?
November 11, 2025 at 10:31 AM
alternatively dereferencing null can just return the default value
November 11, 2025 at 10:20 AM
i mean yeah, treating null as a reference to <statically known address of one large array of zeroes> doesn't seem very convoluted?
November 11, 2025 at 10:18 AM
sorry, i don't believe in capitalist ideas like ownership
November 11, 2025 at 10:12 AM
why would it need a gc? you would just need a statically initialized default value for every type (and if you have a guarantee that default values always have bit pattern 0, you only need a single 0 array as large as your largest type)
November 11, 2025 at 10:08 AM
yeah but references are silly so
November 11, 2025 at 10:05 AM
worse: that's a type error because the expression `f : (a b : Nat) -> Nat` still has type `(x y : Nat) -> Nat` and so doesn't have a parameter named "a"
November 11, 2025 at 2:20 AM