Hi all,
I think i will love this list :)
Yesterday I was looking at this Haskell Exercises for beginners [1] 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 [2]. I can read al little bit of category theory but I would love to know how to apply [2] 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
Federico