diff --git a/projects/Idris/src/LessMacrosMoreTypes/RowPolymorphism.md b/projects/Idris/src/LessMacrosMoreTypes/RowPolymorphism.md index 6763000..3cf22fe 100644 --- a/projects/Idris/src/LessMacrosMoreTypes/RowPolymorphism.md +++ b/projects/Idris/src/LessMacrosMoreTypes/RowPolymorphism.md @@ -19,9 +19,11 @@ This article is inspired by my work on implementing the _Brown Benchmark for Tab ## What is Row Polymorphism -At time of writing, the [Wikipedia page](https://en.wikipedia.org/wiki/Row_polymorphism) for row polymorphism starts with +At time of writing, the [Wikipedia page](https://en.wikipedia.org/wiki/Row_polymorphism) for row polymorphism starts with: + > In programming language type theory, row polymorphism is a kind of polymorphism that allows one to write programs that are polymorphic on row types such as record types and polymorphic variants. -and then leads into some mathematical notation heavy text that doesn't really elucidate much, and what the hell does "polymorphic on row types" even mean? + +leading into some text dense with mathematical notation that doesn't do much in explaining what any of this _looks_ like, and what the hell does "polymorphic on row types" even mean? Consider a basic `record` in Idris as an example: ```idris @@ -32,13 +34,13 @@ record ImACat where meows_a_lot : Bool ``` -This certainly seems like it might fit the bill, it says `record` right there. But what are these "row types"? +This certainly seems like it might fit the bill, it says `record` right there, and the wikipedia snippet _did_ mention records. But what are these "row types"? ### Row Types -Row types often are called records in other contexts, and while "record" may be a somewhat more intuitive name for someone approaching this from the perspective of many common programming languages, I will continue to largely use the name "row type" as it will make more sense in the tabular data context I will be framing the rest of this post in terms of. +"Row Type" and "Record Type" are sometimes used interchangeably in this corner of type theory. While "record" may be a somewhat more intuitive name for someone approaching this from the perspective of many popular programming languages, we will mostly be using the name "Row Type", as it will make more sense in the tabular data context that will serve as framing for this article. -Consider some tabular data, say a table in a database, or a spread sheet. Tabular data is composed of a 2d grid of rows and columns, typically with each column having a name and potentially a type constraint on the values in that column. Consider this example of some tabular data: +Imagine some tabular data, say a table in a database or a spread sheet. Tabular data is composed of a 2d grid of rows and columns, typically with each column having a name and potentially a type constraint on the values in that column. Consider this example: