From: Samir Benmendil Date: Tue, 23 Jan 2018 22:46:38 +0000 (+0000) Subject: Show values for Lists X-Git-Url: https://git.rmz.io/my-scheme.git/commitdiff_plain/200ca1efa940b94af2099828c36d6580addb6de9?ds=inline;hp=200ca1efa940b94af2099828c36d6580addb6de9 Show values for Lists `unwordsList :: [LispVal] -> String` composes three functions: * `map :: (a -> b) -> [a] -> [b]` a function with two "arguments"[0], a function `(a -> b)` and a list of `a`s (`[a]`) and returns a `[b]`, i.e. it applies the function in the first argument to every element of the second * `showAll :: LispVal -> String` described in the previous commit. `map showAll` returns a function that applies `showAll` to each element of the list it gets. * `unwords :: [String] -> String` which joins a list of Strings with spaces. The `.` dot operator is used to pass the output of rhs to the input of lhs. So in essence, `unwordsList` is a function that will `unword` the list of Strings returned by `map`ing `showVal` to the list of `LispVal`s passed to `unwordsList`. [0] Remember that all functions are curried, and actually only take one argument and return a "partial function" that takes the next argument. ---