I'm not sure I've ever heard of this concept, tbh. Categorically, you have arrows. Haskell is often modeled by the category Hask of types and arrows between types. If we denote these categorical arrows in notation as fat arrows then things like Int,
(),
Maybe (Maybe (Maybe String))
forall a . a -> a
are objects and things like Int => (),
() => Int
Maybe (Maybe (Maybe String)) => Maybe (Maybe (Maybe String))
are arrows. Arrows are often called morphisms so you might talk about the morphisms as the elements of a Hom set like Hom((), Int).Notably, the Haskell arrows, the type of functions, happen to internalize the categorical arrows. This makes Hask cartesian closed. Thus, we have a correspondence between the arrows a => b
and the objects a -> b
This is why we often talk about function types as being categorical arrows.--- All that said, the type `m a` is not a function type let alone an arrow unless we happen to specialize `m` to be one. More specifically, the type `forall m . m a` is never a function type no matter the choice of `a`. The notation `(-> m a)` or `(m a ->)` is... not actually a type. It's a type constructor at best (though it's illegal Haskell notation) which fits into a different kind of categorical construction if you want to go there. The type `(a -> b)` "is" a valid arrow via the correspondence I mentioned earlier. The thing that's being referred to is the fully applied type constructor. If we have type Arr a b = a -> b
then `Arr` is a type constructor of kind `(* -> * -> )` (e.g. a "type constructor constructor") and `Arr a` a type constructor of kind `( -> )`.The type* `Arr a b` is in correspondence with the morphisms of Hask. A combination of arrows would be a morphism from pairs of internal arrows to... something else (a -> b, c -> d) => r
we can represent that with an internal arrow (a -> b, c -> d) -> r
and then use the currying natural isomorphism (a -> b) -> (c -> d) -> r
which is the (internal) type of "arrow combining morphisms".That's the clearest I can explain what I'm on about. Where do you fit your notion of categorical morphism into there? |
The reason I said that is because I visualize it like this:
Which is why I said that (>>) ("chevron" above) combines two functions, just() and nothing().