Haskell show instance on list
Im having issues with adding a show instance to my data structure, wich is: data Structure = Structure String [Structure] and I would like to have this output: strct strct1 strct2 strct3 I've been trying this instance Show Structure where show (Structure a (xs)) = show a ++ "\n" ++ " " ++ show xs But its output is "strct" ["strct1" [], "strct2" []] So, I would need no brackets, no commas and no quotation marks. Any ideas? Thanks I'm sure there are better library routines for this, but wouldn't this work? unlines $ a : [" " ++ show x | x <- xs] However, that covers only one level. You probably