Previous Entry Share Next Entry
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...

  • 1
when the tentacles get too handsy stop and have some calamari

Congratulations! I haven't got that far, but I do appreciate things that work that way.

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.

Heh -- I don't think I've ever heard that particular description, but I kind of see it. I finally grokked Monads when I stopped trying to understand the mathematical descriptions, and instead focused on, "A Monad is something you want to be able to use in a for comprehension".

And yeah, it always lands you in a mirror reality, on the far side of The Curse of Lady Monadgreen...

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.

Ah, Free Monads, the new hotness. They're basically all anybody talks about these days, far as I can tell. (Although I just came across a post arguing that they are merely a stepping-stone to the perfect world ahead, which will be based on higher-order Monads. I understood about a quarter of that one.)

I can see the appeal in principle, but so far I'm not adoring the resulting code (in particular, it sounds like things aren't entirely elegant with multiple algebras yet), and as you say, there's a lot of foot-shuffling when you bring up performance...

  • 1

Log in

No account? Create an account