introalg:taller07_4
Diferencias
Muestra las diferencias entre dos versiones de la página.
| Ambos lados, revisión anteriorRevisión previaPróxima revisión | Revisión previa | ||
| introalg:taller07_4 [2007/05/14 22:52] – nicolasw | introalg:taller07_4 [2025/11/15 13:47] (actual) – editor externo 127.0.0.1 | ||
|---|---|---|---|
| Línea 79: | Línea 79: | ||
| ===== Generalización de las funciones vistas (map, filter, fold) ===== | ===== Generalización de las funciones vistas (map, filter, fold) ===== | ||
| + | |||
| Línea 103: | Línea 104: | ||
| < | < | ||
| - | veintePorCiento : [Float] -> [Float] | + | veintePorCiento |
| veintePorCiento [] = [] | veintePorCiento [] = [] | ||
| veintePorCiento (x:xs) = 0.2*x : veintePorCiento xs | veintePorCiento (x:xs) = 0.2*x : veintePorCiento xs | ||
| Línea 141: | Línea 142: | ||
| probar con mapNumeros.(*2).[0, | probar con mapNumeros.(*2).[0, | ||
| + | |||
| Línea 150: | Línea 152: | ||
| < | < | ||
| esPar :: Int -> Bool | esPar :: Int -> Bool | ||
| - | esPar x = x `mod` 2 == 0 | + | esPar = esDivisor |
| soloPares :: [Int] -> [Int] | soloPares :: [Int] -> [Int] | ||
| Línea 175: | Línea 177: | ||
| probar con filtraNumeros.entre0y9.[], | probar con filtraNumeros.entre0y9.[], | ||
| + | |||
| Línea 195: | Línea 198: | ||
| productoria :: [Int] -> Int | productoria :: [Int] -> Int | ||
| - | productoria [] | + | productoria [] |
| productoria (x:xs) = producto x (productoria xs) | productoria (x:xs) = producto x (productoria xs) | ||
| </ | </ | ||
| Línea 203: | Línea 206: | ||
| concatenaInt :: [[Int]] -> [Int] | concatenaInt :: [[Int]] -> [Int] | ||
| concatenaInt [] = [] | concatenaInt [] = [] | ||
| - | concatenaInt (xs:xss) = (++) xs concatenaInt xss | + | concatenaInt (xs:xss) = (++) xs (concatenaInt xss) |
| </ | </ | ||
| Línea 237: | Línea 240: | ||
| < | < | ||
| - | mapa : (a -> b) -> [a] -> [b] | + | mapa :: (a -> b) -> [a] -> [b] |
| mapa f [] = | mapa f [] = | ||
| mapa f (x:xs) = | mapa f (x:xs) = | ||
introalg/taller07_4.1179193972.txt.gz · Última modificación: (editor externo)
