-- | Module used for CSS compression. The compression is currently in a simple-- state, but would typically reduce the number of bytes by about 25%.--moduleHakyll.Web.CompressCss(compressCssCompiler,compressCss)whereimportData.Char(isSpace)importData.List(isPrefixOf)importControl.Arrow((>>^))importHakyll.Core.CompilerimportHakyll.Core.ResourceimportHakyll.Core.Util.String-- | Compiler form of 'compressCss'--compressCssCompiler::CompilerResourceStringcompressCssCompiler=getResourceString>>^compressCss-- | Compress CSS to speed up your site.--compressCss::String->StringcompressCss=compressSeparators.stripComments.compressWhitespace-- | Compresses certain forms of separators.--compressSeparators::String->StringcompressSeparators=replaceAll"; *}"(const"}").replaceAll" *([{};:]) *"(take1.dropWhileisSpace).replaceAll";;*"(const";")-- | Compresses all whitespace.--compressWhitespace::String->StringcompressWhitespace=replaceAll"[ \t\n][ \t\n]*"(const" ")-- | Function that strips CSS comments away.--stripComments::String->StringstripComments[]=[]stripCommentsstr|isPrefixOf"/*"str=stripComments$eatComments$drop2str|otherwise=headstr:stripComments(drop1str)whereeatCommentsstr'|nullstr'=[]|isPrefixOf"*/"str'=drop2str'|otherwise=eatComments$drop1str'