19 Feb 2018
Welcome back! This time, we’re going to write that
27 Jan 2018
evaluate function we
mentioned in the last article… Strictly,
this function will be better named
reduce, as it will perform an operation
called beta reduction (or β-reduction, if you’re so inclined). What
this means is that, any time we see an
Abstraction on the left-hand side
Application, we can simplify by taking the abstraction’s body, and
replacing any mention of its parameter with the argument.
Part two already, is it? Well, I suppose it’s about time to write some code!
Last time, we covered the constructions of the
lambda calculus, as well as De Bruijn indices. Today, we’re going to
cover basically the same thing, but encoding everything we learnt in Idris!
If you’re not familiar with Idris or dependently-typed programming, things are
going to start getting… weird.
09 Jan 2018
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!
10 Jul 2017
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
26 Jun 2017
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
19 Jun 2017
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
12 Jun 2017
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
05 Jun 2017
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
30 May 2017
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
15 May 2017
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…
08 May 2017
Chain! Maybe we didn’t compose that one, but we’re going to
compose plenty of things today!
01 May 2017
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
27 Apr 2017
Two-ish weeks ago, we talked about the wonderful flexibility of
24 Apr 2017
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
17 Apr 2017
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
15 Apr 2017
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
10 Apr 2017
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
09 Apr 2017
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
03 Apr 2017
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:
27 Mar 2017
Fantasy Landers, assemble! We’ve been
21 Mar 2017
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
13 Mar 2017
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!
09 Mar 2017
Congratulations! You’ve mastered the fundamentals of
08 Mar 2017
daggy, nailed the intro to type signatures, and are ready to begin your journey through Fantasy Land. First stop: the setoid.
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.
03 Mar 2017
24 Feb 2017
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?
31 Dec 2016
More information on functors than you probably ever wanted, with all sorts of weird and wonderful examples.
24 Dec 2016
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?
11 Dec 2016
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).
12 Nov 2016
03 Nov 2016
29 Oct 2016
A hundred-ish years ago, long before Pokémon and the Slap Chop, there lived a clever one named Giuseppe Peano, who came up with a neat way to describe the natural numbers (
27 Oct 2016
0, 1, 2, 3, ...):
I’m Tom. I write code, which hopefully turns out better than my introductions. Fingers crossed.