Want to take part in these discussions? Sign in if you have an account, or apply for one below
Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.
While studying scalaz using the help of the nice mapping from Haskell to Scalaz learning scalaz I came across the description of Reader. It shows that a function can be considered as a Functor - just as a List or Set can. Since Functors are a map between categories I was wondering what a function functor was a map from and to. So it seems to be able to be from any category to something, which for a while I thought could be the Arrow Category. So that would mean that a function functor would be a map from C to Arr(C). But then I’d need to find
In ScalaZ a functor of functions is hardwired to an initial type. So that one has a functor of all function Int => X for example. ( presumably because Arr(C) is somehow a 2 Category, but functors are not ) So I suppose needs to be a map from Obj(c) to the functions of type Int=>X ( taking Int as fixed ) in Arr(c). But then that means that Arr(c) can’t be the object of the function functor, as there is no such object in Arr(c)….
Any hints?
Just a short remark: In Haskell, for a fixed type r, the Reader r monad is a functor Hask -> Hask, where Hask is the category of Haskell types and functions between those. More specifically, it is the functor Hom(r, __) (internal Hom in Hask). This is all modulo the usual caveats about the category Hask.
In general category theory, there is a functor Hom(r, __) : C -> Set for any object r of any category C.
1 to 2 of 2