Advertisement
Guest User

Untitled

a guest
May 29th, 2015
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. -- Funcion para saber si un numero esta en una lista
  2. contiene e [] = False
  3. contiene e (x:xs) = if e == x then True
  4. else contiene e xs
  5. -- Funcion aplicar funcion a lista
  6. mapear f [] = []
  7. mapear f (x:xs) = f x : mapear f xs
  8.  
  9. -- Funcion filtrar (filter)
  10. filtrar f [] = []
  11. filtrar f (x:xs) = if f x then (x : filtrar f xs) else filtrar f xs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement