I inspired myself of a function I found on this site, which counts the occurences of words in a String. Here is the code:
import Data.Text (pack, count) occurenc