![]() adding a type class that insists a has an addition, and likewise b, doesn't force f to be a homomorphism of addition. DOES CATEGORY THEORY SUBSUME TYPE THEORY FULLIf we take the full subcategory then f:a->b need not respect the type class's intentions. What is less clear is to what extent we intend to restrict the functions (morphisms). For example, if you impose a type class it is clear it restricts the types, i.e. Certainly a subcategory could be modeled by a type class, but it takes some head scratching to decide if you believe type classes always give subcategories and vice-versa. So again, consider the concept as a good introduction but not a mathematical theorem.įor 6. If $X$ and $Y$ are finite sets this function could very well be described in first order logic. That is higher-order in the computer science lingo but nothing about that requires it to be higher-order in the sense of logic. So a function that takes other functions as input is a function $f:X^Y\to Z$ and a function that outputs functions is a function $f:X\to Y^Z$. By analogy, just because the integers $\mathbb$ is the set of functions $Y\to X$. One is not however exploring a model of Category Theory! This example category may have nothing to say about what it means in general categories. So "translate category theory into Hask" means only that because Hask is a category you can write down something in category theory and see what it means in Hask. Hask is a category, but it is not Category Theory. ![]() I think a more accurate description of what is trying to be said is that: How does category theory represent a typeclass? As a subcategory of $Hask$? How does category theory represent a higher order function? As special morphisms from or to special objects representing function types? Is a type constructor just a function, so does category theory represent a type constructor as a morphism? How does category theory represent the things in 4, 5 and 6, specifically, Way of capturing the fact that in category theory things are often Typeclasses, along with the polymorphism they provide, make a nice ![]() Things that take a function and return another function are Things that take a type and return another type are type We work in the category $Hask$ and its subcategories. In Haskell programming language, according to ĥ9.2.2 Translating categorical concepts into Haskell ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |