I'm learning Haskell on my own and I'm following the material of a course.
I would like to know if this is idiomatic Haskell.
asList :: [String] -> String
asList ss = "[" ++ (concat $ intersperse "," ss) ++ "]"
I'm learning Haskell on my own and I'm following the material of a course. I would like to know if this is idiomatic Haskell.
|
||||
It looks idiomatic to me. There's one slight improvement to the code that I could come up with. There is a function that does what you're doing in the middle, called
Using that, your function becomes:
|
|||||||||
|
The Here is an implementation that avoids that problem:
|
|||||||||||||||||
|
insertBST
, you should probably include the correspondingsearchBST
function in that question too. – 200_success♦ Nov 19 '14 at 19:28