Quantcast
Channel: Haskell –  Bartosz Milewski's Programming Cafe
Browsing all 58 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

C++ Ranges are Pure Monadic Goodness

We have this friendly competition going on between Eric Niebler and myself. He writes some clever C++ template code, and I feel the compulsion to explain it to him in functional terms. Then I write a...

View Article


Image may be NSFW.
Clik here to view.

Category Theory for Programmers: The Preface

For some time now I’ve been floating the idea of writing a book about category theory that would be targeted at programmers. Mind you, not computer scientists but programmers — engineers rather than...

View Article


Image may be NSFW.
Clik here to view.

Formula 1: Go Functional!

I was recently visiting the Ferrari museum in Maranello, Italy, where I saw this display of telemetry data from racing cars. The processing and the display of telemetry data is an interesting...

View Article

Image may be NSFW.
Clik here to view.

Categories Great and Small

In the previous installment of Category Theory for Programmers we talked about the category of types and functions. If you’re new to the series, here’s the Table of Contents. You can get real...

View Article

Image may be NSFW.
Clik here to view.

Kleisli Categories

In the previous installment of Categories for Programmers, Categories Great and Small, I gave a few examples of simple categories. In this installment we’ll work through a more advanced example. If...

View Article


Image may be NSFW.
Clik here to view.

Products and Coproducts

Categories for Programmers. In the previous installment we discussed how to add logging to pure functions. See the Table of Contents. Follow the Arrows The Ancient Greek playwright Euripides once said:...

View Article

Image may be NSFW.
Clik here to view.

Simple Algebraic Data Types

Categories for Programmers. Previously Products and Coproducts. See the Table of Contents. We’ve seen two basic ways of combining types: using a product and a coproduct. It turns out that a lot of data...

View Article

Image may be NSFW.
Clik here to view.

Functors

This is part of Categories for Programmers. Previously: Simple Algebraic Data Types. See the Table of Contents. At the risk of sounding like a broken record, I will say this about functors: A functor...

View Article


Image may be NSFW.
Clik here to view.

Functoriality

This is part 8 of Categories for Programmers. Previously: Functors. See the Table of Contents. Now that you know what a functor is, and have seen a few examples, let’s see how we can build larger...

View Article


Image may be NSFW.
Clik here to view.

Function Types

This is part 9 of Categories for Programmers. Previously: Functoriality. See the Table of Contents. So far I’ve been glossing over the meaning of function types. A function type is different from other...

View Article

Image may be NSFW.
Clik here to view.

Natural Transformations

This is part 10 of Categories for Programmers. Previously: Function Types. See the Table of Contents. We talked about functors as mappings between categories that preserve their structure. A functor...

View Article

Image may be NSFW.
Clik here to view.

Using Monads in C++ to Solve Constraints: 1. The List Monad

I am sometimes asked by C++ programmers to give an example of a problem that can’t be solved without monads. This is the wrong kind of question — it’s like asking if there is a problem that can’t be...

View Article

Image may be NSFW.
Clik here to view.

From Lenses to Yoneda Embedding

Lenses are a fascinating subject. Edward Kmett’s lens library is an indispensable tool in every Haskell programmer’s toolbox. I set out to write this blog post with the goal of describing some new...

View Article


Image may be NSFW.
Clik here to view.

Free Monoids

This is part 12 of Categories for Programmers. Previously: Limits and Colimits. See the Table of Contents. Monoids are an important concept in both category theory and in programming. Categories...

View Article

Image may be NSFW.
Clik here to view.

The Yoneda Lemma

This is part 15 of Categories for Programmers. Previously: Representable Functors. See the Table of Contents. Most constructions in category theory are generalizations of results from other more...

View Article


Image may be NSFW.
Clik here to view.

Operads, Type Level Nats, and Tic-Tac-Toe

This summer I spent some time talking with Edward Kmett about lots of things. (Which really means that he was talking and I was trying to keep up.) One of the topics was operads. The ideas behind...

View Article

Image may be NSFW.
Clik here to view.

Yoneda Embedding

This is part 16 of Categories for Programmers. Previously: The Yoneda Lemma. See the Table of Contents. We’ve seen previously that, when we fix an object a in the category C, the mapping C(a, _) is a...

View Article


Image may be NSFW.
Clik here to view.

It’s All About Morphisms

This is part 17 of Categories for Programmers. Previously: Yoneda Embedding. See the Table of Contents. If I haven’t convinced you yet that category theory is all about morphisms then I haven’t done my...

View Article

Image may be NSFW.
Clik here to view.

Tambara Modules

I came in contact with Tambara modules when working on a categorical understanding of lenses. They were first mentioned to me by Edward Kmett, who implemented their Haskell version,...

View Article

Image may be NSFW.
Clik here to view.

Adjunctions

This is part 18 of Categories for Programmers. Previously: It’s All About Morphisms. See the Table of Contents. In mathematics we have various ways of saying that one thing is like another. The...

View Article
Browsing all 58 articles
Browse latest View live