Capital on Nostr: npub1lnh4s…x96ts :: I'm actually trying to implement a feature Rust and Idris lack ...
npub1lnh4sey03wehr2gr02c3a60jj4h2zl8a9053zdx6eydwnthhk90svx96ts (npub1lnh…96ts) :: I'm actually trying to implement a feature Rust and Idris lack natively.
Crystal has the ability to combine types into an anonymous tagged union types. Since it's tagged, you can match against the type like you would an `enum` type in Rust.
However, unlike Rust, each member of a union in Crystal is a separate type. This allows you to recombine types into new unions.
I'm sure you could hack together something in Rust, but out-of-the-box, no support.
Published at
2023-06-28 22:00:09Event JSON
{
"id": "c0df03c331266792c0c14803113b0b18112e84d204b6efbeb50dc7e56cfe3557",
"pubkey": "19132ebf4163a2399191bc90c23f33d1fe4945cbe9c807b0d196b172a2701961",
"created_at": 1687989609,
"kind": 1,
"tags": [
[
"p",
"fcef58648f8bb371a9037ab11ee9f2956ea17cfd2be91134dac91ae9aef7b15f",
"wss://relay.mostr.pub"
],
[
"p",
"bdb979148ae3366a99d59c148b503cf44563ea9736055a0b7d7c1b9bc3215ea9",
"wss://relay.mostr.pub"
],
[
"e",
"16dc0470a2e692743144c9f25568db7eb093936e5794e72eefae467e57444513",
"wss://relay.mostr.pub",
"reply"
],
[
"mostr",
"https://furry.engineer/users/CapitalEx/statuses/110624087057217172"
]
],
"content": "nostr:npub1lnh4sey03wehr2gr02c3a60jj4h2zl8a9053zdx6eydwnthhk90svx96ts :: I'm actually trying to implement a feature Rust and Idris lack natively. \n\nCrystal has the ability to combine types into an anonymous tagged union types. Since it's tagged, you can match against the type like you would an `enum` type in Rust. \n\nHowever, unlike Rust, each member of a union in Crystal is a separate type. This allows you to recombine types into new unions.\n\nI'm sure you could hack together something in Rust, but out-of-the-box, no support.\n\nhttps://cdn.pawb.social/mastodon-fe/media_attachments/files/110/623/958/059/314/821/original/9c509f49b14ce1ac.png\n\nhttps://cdn.pawb.social/mastodon-fe/media_attachments/files/110/623/972/393/137/769/original/ce30e3fd9392dfab.png",
"sig": "e66c5c78b08b87b7990caafec884c2faf5d303da7e036d631cd4ad2dc88d6c1059b54fa7c59ce7da9198b6e6f14448f6b5ec625049169550f33ff65e217d4a3f"
}