AlBasmala RSS About

Posts   tagged   “types”

Here are some of my latest thoughts on types… such as thread-first and loop (•̀ᴗ•́)و


Typed Lisp, A Primer

Article image

Let's explore Lisp's fine-grained type hierarchy!

We begin with a shallow comparison to Haskell, a rapid tour of type theory, try in vain to defend dynamic approaches, give a somewhat humorous account of history, note that you've been bamboozled —type's have always been there—, then go into technical details of some Lisp types, and finally conclude by showing how macros permit typing.

Goals for this article:

  1. Multiple examples of type constructions in Lisp.
  2. Comparing Lisp type systems with modern languages, such as Haskell.
  3. Show how algebraic polymorphic types like Pair and Maybe can be defined in Lisp. Including heterogeneously typed lists!
  4. Convey a passion for an elegant language.
  5. Augment Lisp with functional Haskell-like type declarations ;-)

Unless suggested otherwise, the phrase “Lisp” refers to Common Lisp as supported by Emacs Lisp. As such, the resulting discussion is applicable to a number of Lisp dialects —I'm ignoring editing types such as buffers and keymaps, for now.

Graphs are to categories as lists are to monoids

Article image

Numbers are the lengths of lists which are the flattenings of trees which are the spannings of graphs. Unlike the first three, graphs have two underlying types of interest –the vertices and the edges– and it is getting to grips with this complexity that we attempt to tackle by considering their ‘algebraic’ counterpart: Categories.

In our exploration of what graphs could possibly be and their relationships to lists are, we shall mechanise, or implement, our claims since there will be many details and it is easy to make mistakes –moreover as a self-learning project, I'd feel more confident to make


Thanks for reading everything! 😁 Bye! 👋

Creative Commons License
Life & Computing Science by Musa Al-hassy is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License