Created
April 24, 2021 06:21
-
-
Save gpratoe/3fa21fdd78f87e5a08e9324299cfe4bc to your computer and use it in GitHub Desktop.
Soluciones ejercicios Haskell mumuki UNC (8. Listas) - https://mumuki.io/introalgo-unc/lessons/192-programacion-funcional-listas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Ejercicio 4: algunosTuits | |
algunosTuits :: [a] -> [a] | |
algunosTuits = take 3 | |
--Ejercicio 7: El tipo de map | |
nuestroMap :: (b->a)->[b] -> [a] | |
--Ejercicio 8: Textos | |
textos :: [(String, String)] -> [String] | |
textos = map snd | |
--Ejercicio 9: Recortar tuits | |
recortarUnTuit (a,b) = (a, take 15 b) | |
recortar :: [(String,String)]-> [(String,String)] | |
recortar = map recortarUnTuit | |
--Ejercicio 10: Tuit corto | |
tuitCorto (a,b) = ((<10).(length)) b | |
--Ejercicio 11: cantidadTuitsCortos | |
cantidadTuitsCortos :: [(String,String)] -> Int | |
cantidadTuitsCortos = (length).(filter tuitCorto) | |
--Ejercicio 12: El tipo de filter | |
nuestroFilter :: (a -> Bool) -> [a] -> [a] | |
--Ejercicio 13: Resumir | |
resumir = ((csv).(textos).(recortar)) | |
--Ejercicio 14: Creá tu propio csv | |
csv = intercalate "," |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment