{-
handleCss :: Either IOError String -> IO ()
handleCss result =
    case result of
        Left _ ->
            putStrLn $ "[ERRO] " ++ show err

        Right ok ->
            case parseCss ok of
                Left err' ->
                    putStrLn $ "[PARSE CSS FALHOU]" ++ (show err')

                Right ok' ->
                    print ok'
-}

{- 
handleHtml :: Either IOError String -> IO ()
handleHtml result =
    case result of
        Left err ->
            putStrLn $ "[ERRO] " ++ show err

        Right content ->
            let 
                result =
                    content
                        |> TL.pack
                        |> Text.Taggy.run True
            in
                case eitherResult result of
                    Left err ->
                        putStrLn err

                    Right tags -> do
                        mapM_ print tags
                        putStrLn "\n"
                        tags
                            |> listToTree
                            |> (flip (!!) 0)
                            |> show
                            |> putStrLn
-}

strToDom :: String -> DOM
strToDom str =
    str
        |> TL.pack
        |> Text.Taggy.run True
        |> eitherResult
        |> fromRight
        |> listToTree
        |> (flip (!!) 0)
strToDom :: String -> DOM
strToDom str =
    str
        |> TL.pack
        |> Text.Taggy.run True
        |> eitherResult
        |> fromRight
        |> listToTree
        |> (flip (!!) 0)
strToDom str =
    str
        |> TL.pack
        |> Text.Taggy.run True
        |> eitherResult
        |> fromRight
        |> listToTree
        |> (flip (!!) 0)