joinstr acc depth (x:xs) =
    joinstr ((head acc ++ x):(tail acc)) (depth + nesting x) xs
    where
    nesting c | head c == '{' =  1
              | last c == '}' = -1
              | otherwise     =  0

-- |1 if given True, 0 if given False
joinstr acc depth (x:xs) =
    joinstr ((head acc ++ x):(tail acc)) (depth + nesting x) xs
    where
    nesting c | head c == '{' =  1
              | last c == '}' = -1
              | otherwise     =  0

-- |1 if given True, 0 if given False
joinstr acc depth (x:xs) =
    joinstr ((head acc ++ x):(tail acc)) (depth + nesting x) xs
    where
    nesting c | head c == '{' =  1
              | last c == '}' = -1
              | otherwise     =  0

-- |1 if given True, 0 if given False