extractStackPackageList :: Text -> [String]
extractStackPackageList = filter (/= ".") .
                          map (stripQuotes . T.unpack . (\x -> fromMaybe x $ T.stripPrefix "location: " x)) .
                          mapMaybe (T.stripPrefix "- ") .
                          takeWhile ("- " `T.isPrefixOf`) .
                          drop 1 .
                          dropWhile (/= "packages:") .
                          T.lines
  where
    stripQuotes ('\'':rest) | take 1 (reverse rest) == "\'" = init rest
    stripQuotes x = x
extractStackPackageList :: Text -> [String]
extractStackPackageList = filter (/= ".") .
                          map (stripQuotes . T.unpack . (\x -> fromMaybe x $ T.stripPrefix "location: " x)) .
                          mapMaybe (T.stripPrefix "- ") .
                          takeWhile ("- " `T.isPrefixOf`) .
                          drop 1 .
                          dropWhile (/= "packages:") .
                          T.lines
  where
    stripQuotes ('\'':rest) | take 1 (reverse rest) == "\'" = init rest
    stripQuotes x = x
extractStackPackageList = filter (/= ".") .
                          map (stripQuotes . T.unpack . (\x -> fromMaybe x $ T.stripPrefix "location: " x)) .
                          mapMaybe (T.stripPrefix "- ") .
                          takeWhile ("- " `T.isPrefixOf`) .
                          drop 1 .
                          dropWhile (/= "packages:") .
                          T.lines
  where
    stripQuotes ('\'':rest) | take 1 (reverse rest) == "\'" = init rest
    stripQuotes x = x