I'm trying to understand this function (taken from here)
escape :: String -> String
escape =
let
escapeChar c =
case c of
'<' -> "<"
'>' -> ">"
_ -> [c]
in
concat . map escapeChar
My questions are:
- According to the type,
escapeis a function that takes aString. But it seems that in in the fuction definition it does not receive any argument. How does this work? - What is the relationship between
escapeCharandc? How is that relationship established? Doesccoming right afterescapeCharhave a meaning?