Skip to content

Comment on Classes often aren't the simplest tool for the jobparent

Comments

Really depends upon what you're talking about. Examplle you can have a `Maybe (IO ())` data which would indicate "call this for side effects if it is present, otherwise do not". You could also model this as e.g.

   foo :: [(Text, IO ())]
so thsi would be a list of capabilities, each with a name.

Ofc this is a bit tricky, you would have to do a lot of heavy lifting in C to pull this off; but it wouldn't be hard to do in e.g. JS at the FFI layer before Haskell.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.