[Haskell-begin] Exercises for beginners and Natural Tansformations
fbrubacher at gmail.com
Sat Jul 19 09:00:12 EDT 2008
I think i will love this list :)
Yesterday I was looking at this Haskell Exercises for beginners  and got
somewhat stuck at Ex nbr 2 , here's why:
The idea of this exercises is that you don't use built in Haskell Lists, so
no pattern matching, instead you have to use the data type list provided in
the source of the exercise.
My friend who is more advanced in Haskell said this approach is good because
you get to learn natural Transformations. So I googled that and I came up
with this . I can read al little bit of category theory but I would love
to know how to apply  in the sum exercise.
Anyway as we all know summing all the elements in a list using Haskell lists
is trivial :
sum :: [Int] -> Int
sum (xs) = foldr(+)0xs
But how to do it with Natural transformations ???
Thanks a lot
Colonial Duty Free Shop
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners