I'm a newbie with functional programming and Clean. I want to split a string on whitespace, like the words
function in Haskell.
words :: String -> [String]
input: "my separated list "
output: ["my","separated","list"]
This is the definition in Haskell:
words :: String -> [String]
words s = case dropWhile {-partain:Char.-}isSpace s of
"" -> []
s' -> w : words s''
where (w, s'') =
break {-partain:Char.-}isSpace s'
But Clean doesn't have break
, and I dont know what it means, and how to implement it in Clean:
s' -> w : words s''
where (w, s'')