Home | ms@fp
Michal, soon aged 23, is thinking of having a birthday party with his friends.
He typically likes to follow a schedule which consists of Physical and
Mental activities. In particular, he enjoys Working out (P),
Hiking (P), Reading books (M), and learning a new Language
(L). However, Michal is unsure what schedule he should make for the 28-th,
his birthday, since he wants to see this friends at 18:00, so he’s limited to a
12-hour schedule this time (he typically has an alarm set to 6AM).
If functional programming were a theme park, Functors would be the friendly ride operators who take your values, lift them gently into a context, and make sure any transformation you apply goes smoothly and safely.
Monads may have a reputation for being the “philosophers” of functional programming—but when it comes to parsing, they’re surprisingly practical, elegant, and even a little magical.
Today, let’s take a pleasant stroll through monadic parsers and monad transformers, and see how they make parsing logic clean, composable, and expressive.
Recently, in a university course, I was fiddling with mathematical series
and their definitions in either a recursive or an explicit form. Sure,
sounds like some textbook, rather boring stuff, you may say. However, I found
it quite interesting (and fun too) and above all, I leveraged the power of
Haskell to play around with these series.
Well, starts (of virtually any kind) can be tough; but, hey, I made it
here (I clearly have not been postponing writing in here for a few months).
In any case, let’s embark on this journey together, shall we?