onfig            -- ^ Pointer to the 'Config' object, for accessing the @categories@.
           -> Text              -- ^ The cell value from the 'Table'.
           -> Maybe Category    -- ^ The name of the 'Category' if it is a category, otherwise an empty 'Text'.
toCategory Config{..} t = do
    guard $ t /= "\160" && t /= "syksy" && t /= "kevät"
    guard $ isJust $ L.find (`T.isInfixOf` (T.toLower t)) $ concat categories
    return $ normalize $ T.toLower t


{- | Accumulate a 'Category' to a list of 'Category's based on what @categories@
    cannot overlap.

    In the /config.yaml/ file the @categories@ are listed in hierarchial order,
    making the once from the top being on the top if more than one 'Category' is
    found for that particular 'Course'.

    If the 'Category' to check can be found in the list of @categories@, it will
    grab the index in the list of @categories@ for that 'Category' and generate
    the new list of 'Category's for the 'Course'.
-}
accumCategory :
toCategory :: Config            -- ^ Pointer to the 'Config' object, for accessing the @categories@.
           -> Text              -- ^ The cell value from the 'Table'.
           -> Maybe Category
toCategory Config{..} t = do
    guard $ t /= "\160" && t /= "syksy" && t /= "kevät"
    guard $ isJust $ L.find (`T.isInfixOf` (T.toLower t)) $ concat categories
    return $ normalize $ T.toLower t


{- | Accumulate a 'Category' to a list of 'Category's based on what @categories@
    cannot overlap.

    In the /config.yaml/ file the @categories@ are listed in hierarchial order,
    making the once from the top being on the top if more than one 'Category' is
    found for that particular 'Course'.

    If the 'Category' to check can be found in the list of @categories@, it will
    grab the index in the list of @categories@ for that 'Category' and generate
    the new list of 'Category's for the 'Course'.
-}
toCategory Config{..} t = do
    guard $ t /= "\160" && t /= "syksy" && t /= "kevät"
    guard $ isJust $ L.find (`T.isInfixOf` (T.toLower t)) $ concat categories
    return $ normalize $ T.toLower t


{- | Accumulate a 'Category' to a list of 'Category's based on what @categories@
    cannot overlap.

    In the /config.yaml/ file the @categories@ are listed in hierarchial order,
    making the once from the top being on the top if more than one 'Category' is
    found for that particular 'Course'.

    If the 'Category' to check can be found in the list of @categories@, it will
    grab the index in the list of @categories@ for that 'Category' and generate
    the new list of 'Category's for the 'Course'.
-}