This is a common point of confusion and you've asked the question clearly enough for it to be answerable.
I'm not sure that "functor from category to it's subcategory" is the same as "functor from category to the same category".
It's not the same. A functor consists of four pieces of data: a source category C, a target category D, a mapping of objects of C to objects of D, and a mapping of morphisms of C to morphisms of D, satisfying some conditions. If you change D, then you change the functor.
However when we define a functor, we often have some choice in the category D. I infer from your question that Lst
is a subcategory of Hask
whose objects are types of the form [a]
, though I'm not sure what the morphisms of Lst
are supposed to be. We could define a functor []
of either of these two shapes:
[]
: Hask
-> Lst
(i.e., the target category of []
is Lst
)
[]
: Hask
-> Hask
(i.e., the target category of []
is Hask
)
These are technically different functors, and we have to make a choice. In this context, the correct choice is choice 2. We need the source and target categories to be the same because we need to apply []
to the output of []
, in join
. So C = Hask
and M = []
.
In general, it turns out to rarely be useful to consider categories like Lst
that are defined as the image of some type constructor. I'm not sure where this (very common) idea comes from. I recommend you set aside the idea of "the category Lst
". Just one category is enough for now!
For an analogy consider the function that squares a real number f(x) = x^2. We can view this as a function f : R -> R from the real numbers to the real numbers, even though it so happens that f(x) only takes on nonnegative real values. The target of f does not have to be equal to the image of f (the values that are actually attained by f on its input values).
M : C -> C
corresponds tom
inclass Monad m where ..
, andC
is the categoryHask
, but in the context.. : C -> C
,C
is referring to an object ofC
, which in this case is a type. I suppose it is 'more correct' to writeM : Obj(C) -> Obj(C)
. – user2407038