Trying to use Prelude's built in function to listify a string by space delimiter, as described by SO answer here.
I have the following:
module MiniForth
( functions
, ...
) where
import Data.Char -- I actually import here
import Prelude hiding (words) -- this avoids the ambiguity in the words function when declaring it locally
words :: String -> [String]
-- ^ Takes a string and breaks it into separate words delimited by a space
--
-- Examples:
--
-- >> words "break this string at spaces"
-- ["break","this","string","at","spaces"]
--
-- >> words ""
-- []
--
words s = case dropWhile Char.isSpace s of
"" -> []
s' -> w : words s''
where (w, s'') = break Char.isSpace s'
but I still get the error when running Doctest:
Not in scope: ‘Char.isSpace’
for both lines. I have imported it, so why is it not in scope?