display a list differently Haskell? -
hey wandering if possible show list:
["one", "two", "three"]
to shown as
"one", "two", "three"
need done file
thanks
you can intercalate
data.list
showlist :: show => [a] -> string showlist = intercalate ", " . map show
the map show
converts each element it's string representation quotes (and internal quotes escaped), while intercalate ", "
inserts commas , spaces between pieces , glues them together.
Comments
Post a Comment