Problem 67

treeToString : Tree a -> String
treeToString tree =
    case tree of
        Empty ->
            ""

        Node v Empty Empty ->
            String.filter noQuotes (toString v) 

        Node v left right ->
            String.filter noQuotes
              ((toString v) 
                ++ "(" 
                ++ treeToString left
                ++ ","
                ++ treeToString right
                ++ ")")



noQuotes : Char -> Bool
noQuotes c = 
    (c /= '\'') && (c /= '\"')

Back to problem

results matching ""

    No results matching ""