loadStylesheets :: FilePath -> IO (Map ByteString ByteString)
loadStylesheets path = readDirectoryWith reader path >>=
    return . M.fromList . map fromJust . filter isJust . F.toList . free
  where
    reader file = if ".less" `isSuffixOf` file then do
        stylesheet <- loadStylesheet file
        return $ Just $ (U.fromString $ cssify file, stylesheet)
      else
        return Nothing
    cssify p = (drop (length path + 1) $ take (length p - 5) p) ++ ".css"


------------------------------------------------------------------------------
loadStylesheets :: FilePath -> IO (Map ByteString ByteString)
loadStylesheets path = readDirectoryWith reader path >>=
    return . M.fromList . map fromJust . filter isJust . F.toList . free
  where
    reader file = if ".less" `isSuffixOf` file then do
        stylesheet <- loadStylesheet file
        return $ Just $ (U.fromString $ cssify file, stylesheet)
      else
        return Nothing
    cssify p = (drop (length path + 1) $ take (length p - 5) p) ++ ".css"


------------------------------------------------------------------------------
loadStylesheets path = readDirectoryWith reader path >>=
    return . M.fromList . map fromJust . filter isJust . F.toList . free
  where
    reader file = if ".less" `isSuffixOf` file then do
        stylesheet <- loadStylesheet file
        return $ Just $ (U.fromString $ cssify file, stylesheet)
      else
        return Nothing
    cssify p = (drop (length path + 1) $ take (length p - 5) p) ++ ".css"


------------------------------------------------------------------------------