# A Sample of Standard ML, the TreeSort Algorithm, and Monoids

DevFeed: [A Sample of Standard ML, the TreeSort Algorithm, and Monoids](<https://devfeed.tech/articles/a-sample-of-standard-ml-the-treesort-algorithm-and-monoids-40310.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2013/04/07/a-sample-of-standard-ml-and-the-treesort-algorithm/>)

Published: 2013-04-07T21:57:37Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Standard ML](<https://devfeed.tech/topics/standard-ml.md>), [Functional programming](<https://devfeed.tech/topics/functional-programming.md>), [Category Theory](<https://devfeed.tech/topics/category-theory.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>)

Tags: [algorithms](<https://devfeed.tech/tags/algorithms.md>), [category-theory](<https://devfeed.tech/tags/category-theory.md>), [functional-programming](<https://devfeed.tech/tags/functional-programming.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [ml](<https://devfeed.tech/tags/ml.md>), [monoids](<https://devfeed.tech/tags/monoids.md>), [programming](<https://devfeed.tech/tags/programming.md>), [sorting](<https://devfeed.tech/tags/sorting.md>), [standard-ml](<https://devfeed.tech/tags/standard-ml.md>), [trees](<https://devfeed.tech/tags/trees.md>), [universal-properties](<https://devfeed.tech/tags/universal-properties.md>)

## AI overview

A tutorial introducing Standard ML through functional programming, category theory, and the TreeSort algorithm. It explains why ML is used for manually implementing category-theoretic ideas and highlights parametric polymorphism and type inference.

## Source excerpt

In this post we will assume the reader has a passing familiarity with some of the basic concepts of functional programming (the map, fold, and filter functions). We introduce these topics in our Racket primer, but the average reader will understand the majority of this primer without expertise in functional programming. Follow-ups to this post can be found in the Computational Category Theory section of the Main Content page. Preface: ML for Category Theory A few of my readers have been asking for more posts about functional languages and algorithms written in functional languages.