{-
Ðåàëèçóéòå ôóíêöèþ delAllUpper, óäàëÿþùóþ èç òåêñòà âñå ñëîâà, öåëèêîì ñîñòîÿùèå èç ñèìâîëîâ â âåðõíåì ðåãèñòðå. Ïðåäïîëàãàåòñÿ, ÷òî òåêñò ñîñòîèò òîëüêî èç ñèìâîëîâ àëôàâèòà è ïðîáåëîâ, çíàêè ïóíêòóàöèè, öèôðû è ò.ï. îòñóòñòâóþò.

GHCi> delAllUpper "Abc IS not ABC"
"Abc not"

Ïîñòàðàéòåñü ðåàëèçîâàòü ýòó ôóíêöèþ êàê öåïî÷êó êîìïîçèöèé, àíàëîãè÷íî revWords èç ïðåäûäóùåãî âèäåî.
-}

module Demo where

import Data.Char

delAllUpper :: String -> String
delAllUpper [] = []
delAllUpper xs = if (length (foo xs)) > 0 then init . foo $ xs else foo $ xs 

foo = concatMap upperWord . words
upperWord w = if all isUpper w then "" else w ++ " "