Hello again! Been a while, right? Sorry for being AWOL the best part of six months; I got my dream job writing Haskell and PureScript with some brilliant minds over at Habito, and I’ve had a lot to learn! Anyway, one such mind is Liam, (who’ll be a familiar face to anyone getting stuck in with PureScript), and we have been spending our lunch times on various little projects. So, I thought it’d be cool to share one of these projects with you!
It’s not goodbye, Fantasists. We’ll have other projects, new memories, more chance encounters. Let’s end on a high: talking about the humble
Category, and how we’ve been learning this since the beginning. While it may not be the most immediately useful structure, it’s a gem for the curious.
The worst is behind us. We’ve mastered the
Monad, conquered the
Comonad, and surmounted the
Semigroup. Consider these last two posts to be a cool-down, because the end is in sight. Today, to enjoy our first week of rest, we’re going to revise functors.
A number of times, we’ve seen types with two inner types:
Function, and so on. However, in all cases, we’ve only been able to
map over the right-hand side. Well, Fantasists, the reason has something to do with a concept called kinds that we won’t go into. Instead, let’s look at solutions.
‘Ello ‘ello! Remember that
Monad thing we used to be afraid of, and how it just boiled down to a way for us to sequence our ideas? How
Extend was really just
Chain backwards? Well, today, we’ll answer the question that I’m sure has plagued you all week: what is a backwards
You’re still here? That means you survived
Monad! See? Told you it isn’t that scary. It’s nothing we haven’t already seen. Well, today, we’re going to revisit
Chain with one slight difference. As we know,
Chain takes an
m a to an
m b with some help from an
a -> m b function. It sequences our ideas. However, what if I told you… we could go backwards? Let’s
Extend your horizons.
Today is the day, Fantasists. We all knew it was coming, but we hoped it wouldn’t be so soon. Sure enough, though, here we are. We’ve battled through weeks of structures, and reached the dreaded
Monad. Say your goodbyes to your loved ones, and let’s go.
Happy Tuesday, Fantasists! Sorry for the wait; I’ve been chasing around an issue to change this entry! No movement on that yet, so let’s soldier on! We’ve seen that
You told me to leave you alone. My Papa said, “Come on home”. My doctor said, “Take it easy”, but your lovin’ is much too strong. I’m added to your…
Chain! Maybe we didn’t compose that one, but we’re going to
compose plenty of things today!
Traversable Monday™, everyone! Granted, tomorrow would have made for a catchier opening, but I wasn’t thinking this far ahead when I picked the day to release these. Still, I bet you can’t wait for
Monads now! Putting all that aside, does everyone remember how great the
insideOut function from the
Applicative post was? Well, today’s post is all about your new favourite typeclass.
Welcome back, Fantasists! This week has been hectic, so I haven’t caught up the companion repository as I’d hoped to. However, I should have some time to devote to it this week, so watch this space! Anyway, why don’t we have some down time before we get onto the really grizzly parts of the spec? Let’s take a look at
Two-ish weeks ago, we talked about the wonderful flexibility of
Function when you start treating it as a
Functor. We started off with composition, then branching composition, and then finally environment-aware composition. We also gave our humble function a new name:
Reader. Today, we’re going to walk the same path for
Pair, and build up a closely-related idea.
We’re in double digits! Isn’t this exciting? It also means that, by my estimations, we’re well over half way! Before we get too excited by
Comonad, though, might I tempt you with an…
I asked my German friend whether any of this series’ posts particularly stood out. They said 9, so I’d better make this a good one! I told you we were doing jokes now, right? Moving on… Today, we’re going to finish up a topic we started last week and move from our
Apply types to
Applicative. If you understood the Apply post, this one is hopefully going to be pretty intuitive. Hooray!
Hello! I was explaining the other day how
Function’s implementations of the different typeclasses can be useful, and I thought I might as well write them up in case they can be useful to someone. It’s also much easier than writing 140-character blocks. Specifically, we’ll go through
Chain, with examples all the way.
Aaand we’re back - hello, everyone! Today, we’re going to take another look at those mystical
Functor types. We said a couple weeks ago that functors encapsulate a little world (context) with some sort of language extension. Well, what happens when worlds collide? Let’s talk about
Honestly, at this rate, the spec is going to grow faster than this blog series… We interrupt our usual schedule to introduce Fantasy Land’s newest member: let’s welcome
Ord! Spoiler alert: if you’ve been following this series, this is going to be a pretty easy one.
Well, well, well. We’re a fair few weeks into this - I hope this is all still making sense! In the last article, we talked about functors, and how they’re really just containers to provide “language extensions” (or contexts). Well, today, we’re going to talk about another kind of functor that looks… ooky spooky:
Fantasy Landers, assemble! We’ve been
concatenating for two weeks now; are you ready for something a bit different? Well, good news! If you’re humming, “Oh won’t you take me… to functor town?”, then this is the article for you. Today, friends, we’re going to talk about functors.
Good Tuesday, Fantasists! This week, we’re going to take a quick(!) look at the semigroup’s older sibling: the monoid. We saw last week that a
Semigroup type is one that has some concept of combining values (via
concat). Well, a
Monoid type is any
Semigroup type that happens to have a special value - we’ll call it an identity value - stored on the type as a function called
Today, after a moment of thanks to all those following this series (seriously, thank you ♥), we can move onto a question that has occupied human thought for aeons: how do we generalise the process of combining (or mooshmashing) things together? With semigroups, of course!
Greetings, traveller. I hope you’ve been having a good one since I posted the first part of this series, and I’d have a read of that before going any further. Assuming you’re up-to-date, there’s one more little thing I thought we should talk about before we go head-first into the spec: Damas–Hindley–Milner type signatures.
Oh, hey, stranger! Long time no talk. In case you’re interested, I’ve moved house, job, and company since my last post, hence the hiatus. Sorry! Anyway, speaking of terrible segues, have you ever noticed that you can write every list function with reduceRight?
More information on functors than you probably ever wanted, with all sorts of weird and wonderful examples.
Hello, reader mine! Today, I’m on a train back to the north to see my family for the holidays, which gives me the perfect opportunity to write about a conversation I had yesterday: why are terminals so damn unusable?
Hello! Sorry for taking so long to write another post. I’ve been really quite busy looking for a new place to live and a new office to work in, you see. Anyway, instead of adding another post in my introductory theme, I thought I’d show you how this Orrery works! It’s written in Elm, which isn’t supported by GitHub’s highlighter yet, so I’ve modified it a little (my excuse for why the code blocks look a bit naff).
I’m Tom. I write code, which hopefully turns out better than my introductions. Fingers crossed.