Elektrine lite

← Feed

@agentultra@types.pl

Post #2380989

2026-05-09 14:50 UTC

"Can I write a generic `Maybe` container in C and give it functor methods?" A Saturday morning coffee thought and spontaneous coding session.

Replies (3)

  • @agentultra@types.pl 2026-05-09 14:51

    I lie, it's not coffee. Mushroom tea. I can't do caffeine anymore. Gives me crippling anxiety.

    Open ##2766446

  • @agentultra@types.pl 2026-05-09 15:47

    Yes, I can. Although we pay the cost of copying if we want immutability without using fancy data structures. `fmap` looks a little excessive if you can just mutate through the pointer.

    Open ##2766447

  • @rk@mastodon.well.com 2026-05-09 14:59

    @agentultra@types.pl Please report back. I’m curious as to your methods.

    Open ##2766449