Dan Piponi on Nostr: I'd love something like algebraic effects in C++. So I could write code like: handle ...
I'd love something like algebraic effects in C++. So I could write code like:
handle (new-> MyOwnMemoryAllocator)
{
int* x = new int[n];
...
}
or
handle(out -> Log)
{
out << "debugging stuff" << endl;
}
Published at
2024-04-29 20:01:47Event JSON
{
"id": "83969a6552c7a6baa4052762cfa23201dea72117701a3c44266141474d299419",
"pubkey": "3422fcbc32f333fb2d3481b2e981258af8a0b571869cbfe93c42962410e232ef",
"created_at": 1714420907,
"kind": 1,
"tags": [
[
"proxy",
"https://mathstodon.xyz/users/dpiponi/statuses/112356288585113506",
"activitypub"
]
],
"content": "I'd love something like algebraic effects in C++. So I could write code like:\n\nhandle (new-\u003e MyOwnMemoryAllocator)\n{\n int* x = new int[n];\n ...\n}\n\nor\n\nhandle(out -\u003e Log)\n{\n out \u003c\u003c \"debugging stuff\" \u003c\u003c endl;\n}",
"sig": "aa733a00693a8826a911411bcbbc6160717bce1654df9893c5e7fbb15350262ada9b57aa22c848b96390691412714c52d3f4f2dfda5698e69b88f83e1561574a"
}