Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Problem:
- * We would like to reverse sentences by keeping them readable but changing the meaning
- * For instance, after apply your function on `you can cage a swallow can't you`
- * you must get: `you can't swallow a cage can you`.
- *
- * We want solve every problem separaltely rather than create a tightly coupled function which only can solve one problem.
- *
- * To ease the pain of defining this problems, you take the functions headers and some docs for granted:
- *
- * words :: String -> List String
- * This function should take a string and return a list with each word
- *
- * ---
- *
- * reverse :: List a -> List a
- * This function should take a list of any type and reverse it by creating a new list with the same type of List a
- *
- * ---
- *
- * unwords :: List String -> String
- * This function should take a List of strings and join it into a string with separating spaces
- *
- * ---
- *
- * reverseLine :: String -> String
- * This function should take a string sentence and must return it reversed, changing the meaning
- *
- * In this last one, think how you can take advantage of the others functions.
- * Can you compose them in some way to solve the problem?
- *
- *
- * Tips: Try to use point-free style when you compose your functions.
- *
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement