Capital on Nostr: npub1lnh4s…x96ts :: The main thing I like about unions is the free association of ...
npub1lnh4sey03wehr2gr02c3a60jj4h2zl8a9053zdx6eydwnthhk90svx96ts (npub1lnh…96ts) :: The main thing I like about unions is the free association of types. It allows me to write a function that takes in a subset of a larger type. With enum/ADTs, you have to handle every member or select which underlying type you want to operate on.
If I only care about "colors with a red channel", I still have to deal with HSL and CMYK in Rust, even if it's just adding a default match.
Published at
2023-06-29 04:02:02Event JSON
{
"id": "06b5df3dd3817d72172cdff66ed54e2f670baafebed6a45ae4615f89e7d544b1",
"pubkey": "19132ebf4163a2399191bc90c23f33d1fe4945cbe9c807b0d196b172a2701961",
"created_at": 1688011322,
"kind": 1,
"tags": [
[
"p",
"fcef58648f8bb371a9037ab11ee9f2956ea17cfd2be91134dac91ae9aef7b15f",
"wss://relay.mostr.pub"
],
[
"p",
"bdb979148ae3366a99d59c148b503cf44563ea9736055a0b7d7c1b9bc3215ea9",
"wss://relay.mostr.pub"
],
[
"e",
"5c7d29aafa58cb98c51e90327a1de73438a4d3364d76bcc99ec4a0847575a659",
"wss://relay.mostr.pub",
"reply"
],
[
"mostr",
"https://furry.engineer/users/CapitalEx/statuses/110625510004777229"
]
],
"content": "nostr:npub1lnh4sey03wehr2gr02c3a60jj4h2zl8a9053zdx6eydwnthhk90svx96ts :: The main thing I like about unions is the free association of types. It allows me to write a function that takes in a subset of a larger type. With enum/ADTs, you have to handle every member or select which underlying type you want to operate on.\n\nIf I only care about \"colors with a red channel\", I still have to deal with HSL and CMYK in Rust, even if it's just adding a default match.\n\nhttps://cdn.pawb.social/mastodon-fe/media_attachments/files/110/625/249/548/072/305/original/9ee7235e86ad0c6a.png",
"sig": "ed22628acd663586af388df43c7b2411943cf98f3017ab0ae88bae7756cd4592e5af81d075cc6ed2292b54fe76546a53a396382a7e4c0de802a4f3808e41b9b0"
}