Skip to content

Instantly share code, notes, and snippets.

View doivosevic's full-sized avatar

doivos doivosevic

View GitHub Profile
showSTENs :: Int -> [StackTrace] -> String
showSTENs tabLen = unlines . showSTENs' 0 . build
where
showTabs :: Int -> String
showTabs numSpaces = replicate numSpaces ' '
showSTENs' :: Int -> [STENode] -> [String]
showSTENs' tabs [] = [""]
showSTENs' tabs stens = concat $ map showSTEN (groupAndJoin . sort $ stens)
where
showSTEN (STENode ste []) = [showTabs (tabs * tabLen) ++ show ste]