Philip Trettner on Nostr: Challenge of the day: Write a Rust version of the following pseudo code: fun foo(i: ...
Challenge of the day:
Write a Rust version of the following pseudo code:
fun foo(i: int,
f: fun int -> int,
ff: fun (fun int -> int) -> (fun int -> int)
) -> int:
return (ff(f))(i)
that is statically dispatched (no dyn, no fun ptr).
Published at
2024-08-09 09:53:02Event JSON
{
"id": "d3491a08b6304bc648ad1728faa66ff8d0f3cdf1dc5059ac907895d49768b60a",
"pubkey": "95de3e6560c01a9c326e5e96484fd909a45be96dbba922ca6a251851f485ad01",
"created_at": 1723197182,
"kind": 1,
"tags": [
[
"proxy",
"https://fosstodon.org/users/artificialmind/statuses/112931450526983142",
"activitypub"
]
],
"content": "Challenge of the day:\n\nWrite a Rust version of the following pseudo code:\n\nfun foo(i: int, \n f: fun int -\u003e int, \n ff: fun (fun int -\u003e int) -\u003e (fun int -\u003e int)\n ) -\u003e int:\n return (ff(f))(i)\n\nthat is statically dispatched (no dyn, no fun ptr).",
"sig": "295ad3d60aa233fd963ed0acc972ea4d6f09e2c6faa7c80c609c32b94a50e9055113bf07a2b1e9d88ed5c6c59df594eedf5f9726089e2954cd5b42de2b6f5cc1"
}