3.4 Haskell as category
Let us analyze Haskell from a category theory point of view. We will consider
two categories:
where the objects are standard Haskell types. We can then write
For instance, the function
is not an monomorphism, because
even though ,
we have
however it is an epimorphism as for any
with
, we
have
hence .
1 asd::VectorVector
2 asd v = let sdf = asd^2
3 in v \= 4 if True −− asd
4 then asd = 2
5 else f k
6 where f x = x 2 "asdasd"
7 % asd