[Haskell-cafe] Article review: Category Theory
Yitzchak Gale
gale at sefer.org
Wed Jan 17 13:52:29 EST 2007
David House wrote:
> I've written a chapter for the Wikibook that attempts to teach some
> basic Category Theory in a Haskell hacker-friendly fashion.
> http://en.wikibooks.org/wiki/Haskell/Category_theory
Very, very nice!
A few comments:
A few semicolons were missing in the do blocks
of the Points-free style/Do-block style table. I
fixed that. I think it would be simpler without the
do{} around f x and m - are you sure it's needed?
You wrote: "category theory doesn't have a notion
of 'polymorphism'". Well, of course it does - after
all, this is "abstract nonsense", it has a notion
of *everything*. But obviously we don't want to
get into that complexity here. Here is a first
attempt at a re-write of that paragraph:
Note: The function id in Haskell is 'polymorphic' -
it can have many different types as its domain
and range. But morphisms in category theory
are by definition 'monomorphic' - each morphism
has one specific object as its domain and one
specific object as its range. A polymorphic
Haskell function can be made monomorphic by
specifying its type, so it would be more
precise if we said that the Haskell function
corresponding to idA is (id :: A -> A).
However, for simplicity, we will ignore this
distinction when the meaning is clear.
It is nice that you gave proofs of the >>= monad
laws in terms of the join monad laws. I think
you should state more clearly that the two
sets of laws are completely equivalent.
(Aren't they?) Maybe give the proofs in the opposite
direction as an exercise.
Regards,
Yitz
More information about the Haskell-Cafe
mailing list