Posts

Showing posts with the label functor

Is Haskell's `Const` Functor analogous to the constant functor from category theory?

18 1 I understand that many of the names in Haskell are inspired by category theory terminology, and I'm trying to understand exactly where the analogy begins and ends. The Category Hask I already know that Hask is not (necessarily) a category due to some technical details about strictness/laziness and seq , but let's put that aside for now. For clarity, The objects of Hask are concrete types, that is, types of kind * . This includes function types like Int -> [Char] , but not anything that requires a type parameter like Maybe :: * -> * . However, the concrete type Maybe Int :: * belongs to Hask . Type constructors / polymorphic functions are more like natural transformations (or other more general maps from Hask to itself), rather than morphis...