jducoeur: (Default)
jducoeur ([personal profile] jducoeur) wrote2016-10-26 02:12 pm
Entry tags:

Oh, lord, I'm turning into a functional programmer...

It's been a long time coming, but I'm finally beginning to grok pure FP. I'm in the process of rewriting SpaceCore (one of the most dead-central Actors in modern Querki) to make the guts of all the functions pure, pulling all the side-effects out to the edges. (Not out of any sense of righteous purity, but because I need these bloody things to be composable, and it's the best way to do it.)

And I just caught myself saying, "Ah, that class is a Semigroup; I should probably instantiate that typeclass, so that I can combine the instances".

No doubt you'll find me in some alley sometime soon, mumbling about Applicatives, Free Monads and other such Cthulhoid horrors. Have pity on me...

[identity profile] ilaine-dcmrn.livejournal.com 2016-10-26 06:23 pm (UTC)(link)
when the tentacles get too handsy stop and have some calamari
andrewducker: (Illuminati)

[personal profile] andrewducker 2016-10-26 08:07 pm (UTC)(link)
Congratulations! I haven't got that far, but I do appreciate things that work that way.
mangosteen: (Default)

[personal profile] mangosteen 2016-10-26 09:17 pm (UTC)(link)
Someone once describe a monad to me as an "intelligent comma". It was at that moment that I momentarily shifted 3 degrees out of phase with reality, only to return to a changed world.

[identity profile] fredrickegerman.livejournal.com 2016-10-27 07:19 pm (UTC)(link)
It's just an abstraction of let-binding. Here, let me show you the tutorial I wrote...

If you encounter the urge to use a free monad and you're not authoring a very low-level library with performance tests, back away slowly until you reach a safe distance. Then run like hell.