Hacker News new | past | comments | ask | show | jobs | submit login
Comprehending Ringads (2016) [pdf] (ox.ac.uk)
26 points by mpweiher on May 5, 2018 | hide | past | favorite | 3 comments



The author is developing a theory of expressions (generalizations of list comprehensions) operating on 'ringads', which are monads with a few additional operations and laws.

The academic style probably blurs the fact that this has very deep practical applications, as it provides a framework that permits to write down database joins and OLAP multidimensional queries (including aggregation) in multiple ways that can be considered equivalent through application of monad and ringad laws. This in turn can enable us to interpret such expressions efficiently, by picking the one that corresponds to a desirable execution plan.

Another paper that I would consider related is the one that points out how comprehension expressions can express SQL features like 'order by' and 'group by', namely 'Comprehensive comprehensions' by Wadler and Peyton-Jones.


> The academic style probably blurs the fact that this has very deep practical applications

Whilst this is certainly true, and worth pointing out, it's also rather a shame. The paper's abstract says exactly this, in quite a clear way, but I think many people wouldn't even make it as far as reading the abstract :(

> List comprehensions are a widely used programming construct, in languages such as Haskell and Python and in technologies such as Microsoft's Language Integrated Query. They generalize from lists to arbitrary monads, yielding a lightweight idiom of imperative programming in a pure functional language. When the monad has the additional structure of a so-called ringad, corresponding to 'empty' and 'union' operations, then it can be seen as some kind of collection type, and the comprehension notation can also be extended to incorporate aggregations. Ringad comprehensions represent a convenient notation for expressing database queries. The ringad structure alone does not provide a good explanation or and efficient implementation of relational joins; but by allowing heterogeneous comprehensions, involving both bag and indexed table ringads, we show how to accommodate these too.


Not related to the content, but I always enjoy looking at beautifully typeset LaTeX documents.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: