FP Laboratory 5

From Marek Běhálek Wiki
Revision as of 13:44, 17 September 2019 by Beh01 (talk | contribs) (Created page with "== High-order functions == == More complex functions == * Create a function that count the number of occurrences of all characters from a given string. <syntaxhighlight la...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

High-order functions

More complex functions

  • Create a function that count the number of occurrences of all characters from a given string.
countThem :: String -> [(Char, Int)]
*Main>countThem "hello hello hello"
[('h',3),('e',3),('l',6),('o',3),(' ',2)]