Skip to content

Instantly share code, notes, and snippets.

@lessandro
Created June 11, 2012 16:28
Show Gist options
  • Select an option

  • Save lessandro/2911076 to your computer and use it in GitHub Desktop.

Select an option

Save lessandro/2911076 to your computer and use it in GitHub Desktop.
‎13:57 < lzm> saml: also, why are sql databases natural transmorfism endofunctors?
13:59 < saml> you know relation/
13:59 < saml> relation
13:59 < saml> relation is a pair or tuple
13:59 < saml> (a,b) a is related to b
14:00 < saml> and database table is a collection of those tuples
14:00 < saml> so a table can represent a function (like truth table, for example)
14:01 < saml> now, if you go up one category, you can store functions (tables) in columns of a table
14:01 < saml> for practicality, you store table ids
14:01 < saml> (table_id_1, table_id_2, ...) that's a row of this meta table
14:01 < saml> so, table_1 is related to table_2
14:01 < saml> or, (f,g)
14:01 < saml> f -> g
14:02 < saml> that's a functor transforming function f to function g
14:02 < saml> and now natural transformantion is transformantion between functors
14:02 < saml> so, that's another higher up table
14:03 < saml> endofunctor is a functor that is id
14:03 < saml> given endofunctor f, f(g) = g
14:03 < saml> where g is a category
14:03 < saml> so you see how flexible tables are?
14:04 < saml> that's beauty of relational database
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment