maralorn on Nostr: Behold the beauty of injecting an x in the middle to convert a tuple to a triple: ...
Behold the beauty of injecting an x in the middle to convert a tuple to a triple:
intoMiddle :: b -> (a,c) -> (a,b,c)
intoMiddle x = uncurry (,x,)
#Haskell
Published at
2024-12-03 10:29:57Event JSON
{
"id": "df14f836abee3ff9c079fad789a6af58f98845958725e5d89eb47b290056b15e",
"pubkey": "c76b777391990342128bd6a0dcae7ae5ec4ccac44d3155eac2ad32413ebdd06b",
"created_at": 1733221797,
"kind": 1,
"tags": [
[
"t",
"haskell"
],
[
"proxy",
"https://chaos.social/users/maralorn/statuses/113588423732564386",
"activitypub"
]
],
"content": "Behold the beauty of injecting an x in the middle to convert a tuple to a triple:\n\nintoMiddle :: b -\u003e (a,c) -\u003e (a,b,c)\nintoMiddle x = uncurry (,x,)\n\n#Haskell",
"sig": "aca450d9d7b8c9edb0018aadef4ed6c68d8c8530285c40668eecbdec21ec66b331768e8fe00aa2e6af5c2961ed8bee93823620199393df894e9ac2adb2d75a38"
}