Monads and Streaming

Monads and Streaming

by ferris

This week I took a bit of a break from demo stuff, mostly because the folks behind the Elm programming language released an article entitled A Farewell to FRP, which I found really strange, since I remember FRP being one of the things that made me keep an eye on Elm in the first place. The article itself ended up being just some details about how the default way to structure Elm apps was changing and why, but it didn't make that much sense to me since I had never actually used the language before. So, I thought, what better time than RIGHT NOW to give it a shot and learn it?

So, I started elmsteroids, an Asteroids clone in Elm. I got pretty far in a couple days; the ship moves around and I have asteroids and bullets, and the asteroids disappear when the bullets hit them. Pretty slow progress if I had been using tools I was used to, but that's not the point :)

The biggest thing that I had to force myself to really get my head around was a monad for threading state through computations. Monads have always been one of those things that kindof eluded me, but when forced to sit down and understand what's going on (and write it yourself, as Elm doesn't have most monads out-of-the-box) it actually clicked pretty quickly, which made me pretty stoked! I also ended up spending some of the weekend learning about other abstractions; I can now say I'm fairly comfortable with applicatives as well. Really fun stuff :)

The other big thing I did this week was start streaming again! It had been a little over two months since I had done this last, so it was about damn time I did another. I ended up doing 3 streams; first a small stepmania stream (as I was early for the planned n64 stream), an n64 stream, and another quick stream where I banged on elmsteroids a bit and failed pretty hard at describing monads. That one's gonna take some practice yet :)

I also decked out my twitch and youtube, which should hopefully help me stay on top of streaming stuff. I want to stream some of the demo stuff I've been working on as well, and in general I want to get in the habit of streaming more, as I don't really have anything to lose, minus the fact that while I'm explaining things, it takes a bit more time, but I have a feeling I can move away from that a bit, as long as I keep thinking out loud and get some consistency and continuity between streams. So, we'll see how that goes moving forward :)

Until next time!