[Haskell-cafe] how to calculate the sum of list of lists?

2007-02-05 Thread Miranda Kajtazi
Help, How to calculate the sum of list of lists in Haskell? Please help me, Miranda ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] How to remove all numbers from a list that are divisible by an integer

2007-02-05 Thread Miranda Kajtazi
Hi, Thanx to all for the previous hints how to solve and write the function to calculate the sum of a list of lists. Now I need to know how to remove all numbers that are divisable by an integer. Lets say I have a list [2,4,5,6,8] and when I divide them with number 2, my list should look like

[Haskell-cafe] How to remove all numbers from a list that are divisible by an integer

2007-02-05 Thread Miranda Kajtazi
Hi all, I'm trying to create a function which filters out all number from a list that are divisible by an integer. Ex. the list [2,3,4,5,6] div 2...should give me the list like: [3,5], other numbers should be removed divisible by 2. filter :: (a - Bool) - [a] - [a] filter p [] = [] filter p